سؤال

What is the best way to intercept the Caps Lock button on Windows, for making a program like Launchy?

Currently, I'm setting a low-level hook with SetWindowsHookEx, but that's a bit too low-level for me, since I don't want to intercept other programs that are trying to be active a low level. I'm looking for the highest possible level of interception that can still prevent turning on Caps Lock itself... any better suggestions?

هل كانت مفيدة؟

المحلول 2

Apparently the best way is to use a low-level hook, since RegisterHotkey doesn't intercept the key.

نصائح أخرى

You can use RegisterHotKey:

RegisterHotKey(hWnd, 0, 0, VK_CAPITAL);

Your window will receive a WM_HOTKEY message whenever this key is pressed.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top