帮你顶一下!这种要用到API,书上很多介绍的,只要截获键盘消息就可以了!找找那种组合框弹出窗口的例子!
给你一个简单的键盘钩子程序,CTRL+ALT+M弹出窗口的,自己修改
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure WMhotkeyhandle(var msg:Tmessage);message wm_hotkey;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
hotkeyid:integer;
ifhide:boolean;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
hotkeyid := GlobalAddAtom('My HotKey')-$C000;
registerhotkey(handle,hotkeyid,mod_control or mod_alt,$4D);
Form1.Visible := false;
end;
procedure TForm1.Wmhotkeyhandle(var msg:Tmessage);
begin
if (msg.LParamHi=$4D) and (msg.lparamLo=mod_control + mod_alt) then
begin
msg.Result:=1;
application.Restore;
ifhide := false;
self.Show;
end;
end;
end.