Home > Software engineering >  How to detect the shortcut is occupied by a what kind of program?
How to detect the shortcut is occupied by a what kind of program?

Time:09-26

All tried to get a handle to the window and then DWORD dw=: : SendMessage (HWND WM_GETHOTKEY, NULL, NULL);
Get the value of the whole is 0

CodePudding user response:

From the point of the annotation of WM_HOTKEY,
WM_HOTKEY is unrelated to the WM_GETHOTKEY and WM_SETHOTKEY hot keys.

So WM_GETHOTKEY may get less than,
Can try RegisterHotKey test, the return value RegisterHotKey fails if the keystrokes specified for the hot key have already had been registered by another hot key.


CodePudding user response:

Directly using the method of registration, if conflict, will return failure information, so that you can know if there is any conflict

CodePudding user response:

Baidu search relevant keywords,

CodePudding user response:

reference 1st floor zgl7903 response:
from the point of the annotation of WM_HOTKEY,
WM_HOTKEY is unrelated to the WM_GETHOTKEY and WM_SETHOTKEY hot keys.

So WM_GETHOTKEY may get less than,
Can try RegisterHotKey test, the return value RegisterHotKey fails if the keystrokes specified for the hot key have already had been registered by another hot key.


RegisterHotKey can only know the hotkeys have registered how can I know which program the hotkey was registered?

CodePudding user response:

refer to the second floor oyljerry response:
directly with registration if the conflict, will return failure information, so that you can know if there is any conflict
maybe I didn't say clear I want to know which program takes up the hotkey was only know if enrollment has been registered but don't know who was registered

CodePudding user response:

Windows hotkey registration principle

CodePudding user response:

reference zhao4zhong1 reply: 3/f
baidu search relevant keywords,


https://www.baidu.com/s? Wd=how to detect the shortcut is occupied by a what program

CodePudding user response:

refer to 6th floor zgl7903 response:
Windows hotkey registration principle
final which traverse the system hotkey to knowledge.. A pile of haven't seen the structure of the body and API

CodePudding user response:

refer to 7th floor zhao4zhong1 response:
Quote: reference zhao4zhong1 reply: 3/f

Baidu search relevant keywords,


https://www.baidu.com/s? Wd=how to detect the shortcut is occupied by a what program
I also search on search to a post that is using SendMessage (hWnd WM_GETHOTKEY, NULL, NULL)

CodePudding user response:

In my eyes, indirect to invoke the command line or GUI software for what I want information, related to call the bottom or top API, there is no essential difference between,
The command line with input and output redirection, use AutoHotKey GUI,

CodePudding user response:

The system hotkey can be hidden in a program or loses focus response; Feel no keyboard hook to use, the keyboard hook only gains focus when the program is effective:
Initialization time: ms_hHook=SetWindowsHookEx (WH_KEYBOARD_LL, & amp; LowLevelKeyboardProc, 0, 0);
Exit: UnhookWindowsHookEx (ms_hHook);
  • Related