3 ms·
Agreed, it's not the most elegant code, but it's so short and simple I haven't bothered reorganizing the code yet. I probably will start adding features like re
by RyanRies 11y ago
Agreed, it's not the most elegant code, but it's so short and simple I haven't bothered reorganizing the code yet. I probably will start adding features like re-bindable pause key, etc., and I will untangle the mess a bit at that time.
- asddubs 11y agoquickest way to do it is to negate your if conditions in the loop something like this: if (ForegroundWindow) { ... } else { MessageBox(NULL, L"Unable to detect foreground window!", L"UniversalPauseButton Error", MB_OK | MB_ICONERROR); } becomes if (!ForegroundWindow) { MessageBox(NULL, L"Unable to detect foreground window!", L"UniversalPauseButton Error", MB_OK | MB_ICONERROR); break; } ...
- xytop 11y agoI've added a pull request which reduces nesting a bit: https://github.com/ryanries/UniversalPauseButton/pull/2 https://github.com/ryanries/UniversalPauseButton/pull/2