本文整理自网络,侵删。
procedure ChangeAppWindow(const Handle: THandle; const SetAppWindow, RestoreVisibility: Boolean);var Style: Integer; WasVisible, WasIconic: Boolean;begin Style := GetWindowLong(Handle, GWL_EXSTYLE); if (SetAppWindow and (Style and WS_EX_APPWINDOW = 0)) or (not SetAppWindow and (Style and WS_EX_APPWINDOW = WS_EX_APPWINDOW)) then begin
WasVisible := IsWindowVisible(Handle); if WasVisible or WasIconic then begin ShowWindow(Handle, SW_HIDE); end else begin ShowWindow(Handle, SW_SHOW); end; end;end;
procedure TForm1.Button1Click(Sender: TObject);begin ChangeAppWindow(form1.Handle, False, False);
end;
procedure TForm1.Button2Click(Sender: TObject);begin ChangeAppWindow(form1.Handle, True, True);end;
相关阅读 >>
Delphi 5-7 桥接让Delphi xe2 datasnap中间层支持Delphi低版本开发客户端
Delphi自动以管理员身份在vista 和 windows7 下运行程序
Delphi xe5 中tmemo控件的应用――for android
更多相关阅读请进入《Delphi》频道 >>