M
myveremy
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure WMHotKey(var Message: TWMHOTKEY); message WM_HOTKEY;
....
procedure TForm1.WMHotKey(var Message: TWMHOTKEY);
var
H: THandle;
begin
H := FindWindow(nil, 'form1');
if H > 0 then
begin
SendMessage(H, WM_SYSCOMMAND, SC_RESTORE, 0);
SetForegroundWindow(H);
end;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
UnregisterHotKey(Handle, GlobalAddAtom('hotkey'));
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
BorderStyle:=bsNone; ///////// 全屏
SetBounds(0,0,Screen.Width,Screen.Height); /////////
RegisterHotKey(Handle, GlobalAddAtom('hotkey'), mod_alt, vk_F1);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
form1.BorderStyle:=bssizeable; ////////////////
form1.WindowState:=wsmaximized; //////////////
end;
上面的方法在沒有按'按扭'前都可以,在我按了'按扭'后,
我切換到其它窗口,這時按'ALT+F1'就切換不回來了 ??????????
....
procedure TForm1.WMHotKey(var Message: TWMHOTKEY);
var
H: THandle;
begin
H := FindWindow(nil, 'form1');
if H > 0 then
begin
SendMessage(H, WM_SYSCOMMAND, SC_RESTORE, 0);
SetForegroundWindow(H);
end;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
UnregisterHotKey(Handle, GlobalAddAtom('hotkey'));
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
BorderStyle:=bsNone; ///////// 全屏
SetBounds(0,0,Screen.Width,Screen.Height); /////////
RegisterHotKey(Handle, GlobalAddAtom('hotkey'), mod_alt, vk_F1);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
form1.BorderStyle:=bssizeable; ////////////////
form1.WindowState:=wsmaximized; //////////////
end;
上面的方法在沒有按'按扭'前都可以,在我按了'按扭'后,
我切換到其它窗口,這時按'ALT+F1'就切換不回來了 ??????????