zsims / hunt-and-peck

Simple vimium/vimperator style navigation for Windows applications based on the UI Automation framework.
593 stars 54 forks source link

Improve setting foreground window #26

Closed extratype closed 3 years ago

extratype commented 3 years ago

If the user pressed the shortcut, it is hap.exe which received the last input event, so SetForegroundWindow() should work according to Microsoft. If SetForegroundWindow() fails, we just use ForceForeground(). I don't remember exactly when, I have seen ForceForeground() fails but SetForegroundWindow() succeeds.

zsims commented 3 years ago

Sorry for the delayed review, this looks great. Thanks for the PRs :)