I made a small useful program; I need to have hot keys in it, that is, I put Button1 so that when I click on it, the program displays a message. But I want, when she was in the tray and I pressed, for example, Ctrl + A , then this message was displayed.
1 answer
@ karmadro4 you have already suggested the WinApi function for implementation, I’ll just clarify:
RegisterHotKey(handle, 0, MOD_CONTROL, ord('A'));
- 2It is early to clarify, let the person read the man first. Kopipasta all the same will not earn. - karmadro4
- oneI understand correctly that the
handle
is the application identifier? - Costantino Rupert - @ Kotik_hochet_kushat, here is the identifier of the window. - AseN
- @ karmadro4? This is not copy-paste, imagine! - AseN
- one@CostantinoRupert
handle
is the window handle (HWND
) to which the window message for pressing a hot key will be sent. In your case, this will most likely be the handle of the main form. - kot-da-vinci
|