WM_HOTKEY
This message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key. WM_HOTKEY idHotKey = (int) wParam;
fuModifiers = (UINT) LOWORD(lParam);
uVirtKey = (UINT) HIWORD(lParam);
This message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key. WM_HOTKEY idHotKey = (int) wParam;
fuModifiers = (UINT) LOWORD(lParam);
uVirtKey = (UINT) HIWORD(lParam);
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (Key=VK_ESCAPE) then ShowMessage('ESC');
end;
注意将 From1的 KeyPreview 设置为 True.