F1

请教高手:如何实现无论焦点在哪里,按下F1后,跳出另外一个窗口?
分一定给!!!

解决方案 »

  1.   

    添加一个ActionList,在里面添加一个Action,设置ShortCut为F1,在OnExcute中写:
    procedure TForm1.Action1Execute(Sender: TObject);
    begin
      ShowMessage('F1');
    end;或者添加一个ApplicationEvents控件,在OnMessage中写:
    procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
      var Handled: Boolean);
    begin
      if Msg.message = WM_KEYDOWN then
        if Msg.wParam = VK_F1 then begin
          ShowMessage('F1');
        end;
    end;