Global system hotkey

Using the RegisterHotKey function and few other lines of code, you can register a global system hotkey, which is active even if your application is minimized.

First, you must create a WMHotKey procedure to catch a system WM_HOTKEY message. And then, you must define (in OnCreate event of main form) which hotkey you want to register and which action should be taken after you press it. Finally, in OnDestroy event of main form, you should unregister your hotkeys.


By the way: MOD_WIN, MOD_CONTROL, MOD_SHIFT, MOD_ALT are Delphi “windows.pas” standart constants. No need to write const MOD_CONTROL = 2;