mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-22 17:39:26 +02:00
git-svn-id: trunk@51761 -
This commit is contained in:
parent
30819f343a
commit
d1d7473d27
@ -925,6 +925,7 @@ begin
|
|||||||
else
|
else
|
||||||
if Assigned(lWinControl) and (lWinControl = Application.MainForm) then
|
if Assigned(lWinControl) and (lWinControl = Application.MainForm) then
|
||||||
begin
|
begin
|
||||||
|
Win32WidgetSet.FLastMainFormState := Application.MainForm.WindowState;
|
||||||
PLMsg^.Result := Windows.DefWindowProc(Window, WM_SYSCOMMAND, WParam, LParam);
|
PLMsg^.Result := Windows.DefWindowProc(Window, WM_SYSCOMMAND, WParam, LParam);
|
||||||
WinProcess := False;
|
WinProcess := False;
|
||||||
Application.IntfAppMinimize;
|
Application.IntfAppMinimize;
|
||||||
|
@ -134,6 +134,8 @@ type
|
|||||||
FOnAsyncSocketMsg: TSocketEvent;
|
FOnAsyncSocketMsg: TSocketEvent;
|
||||||
FDotsPatternBitmap: HBitmap;
|
FDotsPatternBitmap: HBitmap;
|
||||||
|
|
||||||
|
FLastMainFormState: TWindowState;
|
||||||
|
|
||||||
function GetDotsPatternBitmap: HBitmap;
|
function GetDotsPatternBitmap: HBitmap;
|
||||||
|
|
||||||
{ event handler helper functions }
|
{ event handler helper functions }
|
||||||
|
@ -169,6 +169,14 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
// issue #26463
|
// issue #26463
|
||||||
|
if Assigned(Application) and Application.MainFormOnTaskBar
|
||||||
|
and Assigned(Application.MainForm) and Application.MainForm.HandleAllocated then
|
||||||
|
begin
|
||||||
|
HidePopups(Application.MainFormHandle);
|
||||||
|
FLastMainFormState := Application.MainForm.WindowState;
|
||||||
|
Application.MainForm.WindowState := wsMinimized;
|
||||||
|
end
|
||||||
|
else
|
||||||
if Assigned(Application) and (Application.ModalLevel > 0) then
|
if Assigned(Application) and (Application.ModalLevel > 0) then
|
||||||
begin
|
begin
|
||||||
for i := Screen.CustomFormZOrderCount - 1 downto 0 do
|
for i := Screen.CustomFormZOrderCount - 1 downto 0 do
|
||||||
@ -178,9 +186,7 @@ begin
|
|||||||
ShowWindow(AForm.Handle, SW_SHOWMINIMIZED);
|
ShowWindow(AForm.Handle, SW_SHOWMINIMIZED);
|
||||||
end;
|
end;
|
||||||
ShowWindow(Win32WidgetSet.AppHandle, SW_SHOWMINNOACTIVE);
|
ShowWindow(Win32WidgetSet.AppHandle, SW_SHOWMINNOACTIVE);
|
||||||
end else
|
end
|
||||||
if Assigned(Application) and Application.MainFormOnTaskBar then
|
|
||||||
Windows.SendMessage(Application.MainFormHandle, WM_SYSCOMMAND, SC_MINIMIZE, 0)
|
|
||||||
else
|
else
|
||||||
Windows.SendMessage(FAppHandle, WM_SYSCOMMAND, SC_MINIMIZE, 0);
|
Windows.SendMessage(FAppHandle, WM_SYSCOMMAND, SC_MINIMIZE, 0);
|
||||||
end;
|
end;
|
||||||
@ -193,11 +199,22 @@ end;
|
|||||||
Restore minimized whole application from taskbar
|
Restore minimized whole application from taskbar
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TWin32WidgetSet.AppRestore;
|
procedure TWin32WidgetSet.AppRestore;
|
||||||
|
const
|
||||||
|
SWSHOW: array[TWindowState] of Cardinal = (SW_SHOWNORMAL, SW_SHOWMINIMIZED, SW_SHOWMAXIMIZED, SW_SHOWMAXIMIZED);
|
||||||
var
|
var
|
||||||
AForm: TCustomForm;
|
AForm: TCustomForm;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
// issue #26463
|
// issue #26463
|
||||||
|
if Assigned(Application) and Application.MainFormOnTaskBar
|
||||||
|
and Assigned(Application.MainForm) and Application.MainForm.HandleAllocated then
|
||||||
|
begin
|
||||||
|
ShowWindow(Application.MainForm.Handle, SWSHOW[FLastMainFormState]);
|
||||||
|
RestorePopups;
|
||||||
|
if (Screen.ActiveControl<>nil) and Screen.ActiveControl.HandleAllocated then
|
||||||
|
SetFocus(Screen.ActiveControl.Handle);
|
||||||
|
end
|
||||||
|
else
|
||||||
if Assigned(Application) and (Application.ModalLevel > 0) then
|
if Assigned(Application) and (Application.ModalLevel > 0) then
|
||||||
begin
|
begin
|
||||||
for i := Screen.CustomFormZOrderCount - 1 downto 0 do
|
for i := Screen.CustomFormZOrderCount - 1 downto 0 do
|
||||||
@ -209,9 +226,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
ShowWindow(FAppHandle, SW_RESTORE);
|
ShowWindow(FAppHandle, SW_RESTORE);
|
||||||
end else
|
end
|
||||||
if Assigned(Application) and Application.MainFormOnTaskBar then
|
|
||||||
Windows.SendMessage(Application.MainFormHandle, WM_SYSCOMMAND, SC_RESTORE, 0)
|
|
||||||
else
|
else
|
||||||
Windows.SendMessage(FAppHandle, WM_SYSCOMMAND, SC_RESTORE, 0);
|
Windows.SendMessage(FAppHandle, WM_SYSCOMMAND, SC_RESTORE, 0);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user