take windowstate into account when showing window

git-svn-id: trunk@6472 -
This commit is contained in:
micha 2005-01-03 16:29:48 +00:00
parent 8a978ff3c6
commit b632390f1e

View File

@ -635,6 +635,7 @@ Procedure TWin32WidgetSet.ShowHide(Sender: TObject);
Var Var
Handle: HWND; Handle: HWND;
ParentPanel: HWND; ParentPanel: HWND;
Flags: dword;
Begin Begin
If (TControl(Sender).FCompStyle = csPage) or (TControl(Sender).FCompStyle = csToolButton) then exit; If (TControl(Sender).FCompStyle = csPage) or (TControl(Sender).FCompStyle = csToolButton) then exit;
Handle := ObjectToHWND(Sender); Handle := ObjectToHWND(Sender);
@ -648,7 +649,13 @@ Begin
begin begin
Windows.SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW or SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE or SWP_NOOWNERZORDER); Windows.SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW or SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE or SWP_NOOWNERZORDER);
end else begin end else begin
Windows.ShowWindow(Handle, SW_SHOW); Flags := SW_SHOW;
if TControl(Sender) is TCustomForm then
case TCustomForm(Sender).WindowState of
wsMaximized: Flags := SW_SHOWMAXIMIZED;
wsMinimized: Flags := SW_SHOWMINIMIZED;
end;
Windows.ShowWindow(Handle, Flags);
end; end;
If (Sender Is TCustomForm) Then If (Sender Is TCustomForm) Then
SetClassLong(Handle, GCL_HICON, LONG(TCustomForm(Sender).GetIconHandle)); SetClassLong(Handle, GCL_HICON, LONG(TCustomForm(Sender).GetIconHandle));
@ -710,6 +717,9 @@ end;
{ {
$Log$ $Log$
Revision 1.304 2005/01/03 16:29:48 micha
take windowstate into account when showing window
Revision 1.303 2005/01/01 18:56:47 mattias Revision 1.303 2005/01/01 18:56:47 mattias
implemented TTIProgressBar implemented TTIProgressBar