我想做到这种效果,程序在后台运行,譬如只是在托盘区,然后我按个组合键就出来了,就像MYIE的老板键一样,请问最简单的方法应如何实现?我下载了一个CPkeymapHook的组件,倒是可以全局捕捉输入的字符了,但是对于这种组合键好像不行。请高手赐教!

解决方案 »

  1.   

    去Google找组件了
    这个不行,自然有别的可以http://lysoft.7u7.net
      

  2.   

    不用hook,
    注册一个hotkey不就可以了。
    RegisterHotKey
      

  3.   

    能够告知一下具体代码?
    小弟我初学Delphi!
    谢谢了!
      

  4.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;type
      TForm1 = class(TForm)
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      aatom:atom;
      procedure hotkey(var msg:tmessage);message wm_hotkey;
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}
    procedure TForm1.hotkey(var msg:tmessage);
    begin
      if (msg.LParamHi=VK_F12) and (msg.LParamLo=MOD_ALT)  then
        showmessage('');
    end;
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      aatom:=globaladdatom('hotkey');
      RegisterHotKey(handle,aatom,MOD_ALT,vk_F12);
    end;end.
      

  5.   

    alt+F12?
    为什么不管是前台还是后台都没有反应?
    我的系统是2000
      

  6.   

    代码考过去以后双击一下你的form
      

  7.   

    已经编译通过,并且可以运行了,只是按了Alt+f12之后没有任何反映而已
      

  8.   

    if (msg.LParamHi=VK_F12) and (msg.LParamLo=MOD_ALT)  then
        showmessage('');这两句设断点,晕过去,三句话都搞不定