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);

解决方案 »

  1.   

    多此一举,看看:
    procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      if (Key=VK_ESCAPE) then ShowMessage('ESC');
    end;
    注意将 From1的 KeyPreview 设置为 True.
      

  2.   

    谢谢 bear_c(大熊) m_cen() bear_c(大熊)说的很对,我改了一下,就解决问题了。m_cen()说的也不错,只不过要在这个窗体获得焦点时才行,谢谢你的热心。加分!