Home > Back-end >  To understand these two sentences?
To understand these two sentences?

Time:09-24

18 px] id:=GlobalAddAtom (' hotkey);
Memo1. Lines. Append (' registered hotkey preferred... ');

CodePudding user response:

To the global atom table to add a string, and returns the unique identifier of the string,
Don't tube "[size=18 px]", the font size;
The second sentence is well understood, add one line Memo1,

CodePudding user response:

Delphi global hotkeys




//message processing 

Procedure hotykey (var MSG: TMessage); The message WM_HOTKEY;

Procedure TFMain. Hotykey (var MSG: TMessage);

The begin

If (MSG) LParamLo=MOD_CONTROL) and (MSG) LParamHi=VK_F12) then

//processing logic

end;
//registered hotkey==============================
//globalAddAtom add a string to the global atom table
FShowkeyid:=GlobalAddAtom (' mykey_show ');

//F12

RegisterHotKey (handle, FShowkeyid, 0, VK_F12);

//CTRL + F12

RegisterHotKey (handle, FShowkeyid1 mod_control, VK_F12);

//Alt + F12

RegisterHotKey (handle, FShowkeyid2 mod_alt, VK_F12);

//CTRL + Alt + f12

RegisterHotKey (handle, FShowkeyid3 mod_control + mod_alt, VK_F12);



//release the hotkey
UnregisterHotKey (Handle, FShowkeyid);
GlobalDeleteAtom (FShowkeyid);
  • Related