0

I use RegisterHotkey to bind a key combination to a function in my program, and that works just fine, even when I don't have focus on my program.

However, I also need to capture WM_KEYUP, and that seems to only work if my program has focus.

Is there a good way to capture the WM_KEYUP even when another program has focus?

I see a lot of examples that catches WM_HOTKEY (which works fine when the key is pressed), but I haven't found any for releasing a hotkey when out of focus.

h607732
  • 3
  • 7
  • https://stackoverflow.com/questions/17579658/how-to-intercept-all-the-keyboard-events-and-prevent-losing-focus-in-a-winforms#17579778 – FrankM Dec 07 '17 at 14:10
  • After adding support for WM_KEYUP, it seems to work just fine. However, I've heard people say, that RegisterHotKey was "the way to do it" and that other methods carried risks. But I'll give this a go, thanks :-) It seems to work without any problems... – h607732 Dec 07 '17 at 14:43

0 Answers0