S
SP229
Unregistered / Unconfirmed
GUEST, unregistred user!
在网上找了一个效果不好,(对最小化程序没用),如果失去焦点没有最小化,可以使用热键(比如注册了<Alt+F8>使用程序获得焦点一次,下去就没用了.不知富翁们有没有更好的?
private
{ Private declarations }
procedure HotKeyDown(var Msg: Tmessage); message WM_HOTKEY;
public
{ Public declarations }
end;
var
Form1: TForm1;
HotKeyId: Integer;//热键变量
implementation
{$R *.dfm}
procedure TForm1.HotKeyDown(var Msg: Tmessage);
begin
if (Msg.LparamLo = MOD_ALT) AND (Msg.LParamHi= VK_F8) then // 假设热键为ALT+F8
begin
Form1.SetFocus;
Form1.Show;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
HotKeyId := GlobalAddAtom('MyHotKey') - $C000;//热键
RegisterHotKey(Handle, hotkeyid, MOD_ALT, VK_F8);
end;
private
{ Private declarations }
procedure HotKeyDown(var Msg: Tmessage); message WM_HOTKEY;
public
{ Public declarations }
end;
var
Form1: TForm1;
HotKeyId: Integer;//热键变量
implementation
{$R *.dfm}
procedure TForm1.HotKeyDown(var Msg: Tmessage);
begin
if (Msg.LparamLo = MOD_ALT) AND (Msg.LParamHi= VK_F8) then // 假设热键为ALT+F8
begin
Form1.SetFocus;
Form1.Show;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
HotKeyId := GlobalAddAtom('MyHotKey') - $C000;//热键
RegisterHotKey(Handle, hotkeyid, MOD_ALT, VK_F8);
end;