mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-20 08:59:38 +01:00
win32: save/restore child windows state on minimze/restore (issue #0024055)
git-svn-id: trunk@42127 -
This commit is contained in:
parent
987e73434f
commit
0a3953816b
@ -48,6 +48,7 @@ Type
|
||||
List: TStrings;
|
||||
StayOnTopList: TFPList; // a list of windows that were normalized when showing modal
|
||||
MaxLength: integer;
|
||||
RestoreState: LongInt; // restore window state
|
||||
MouseX, MouseY: smallint; // noticing spurious WM_MOUSEMOVE messages
|
||||
DispInfoTextA: array [0..LV_DISP_INFO_COUNT-1] of AnsiString; // buffer for ListView LVN_GETDISPINFO notification
|
||||
DispInfoTextW: array [0..LV_DISP_INFO_COUNT-1] of WideString; // it's recommended to keep buffer unchanged
|
||||
|
||||
@ -365,6 +365,32 @@ begin
|
||||
SetMinMaxInfo(WinControl, PMINMAXINFO(LParam)^);
|
||||
Exit(CallDefaultWindowProc(Window, Msg, WParam, LParam));
|
||||
end;
|
||||
WM_SHOWWINDOW:
|
||||
begin
|
||||
// this happens when parent window is being minized/restored
|
||||
// an example of parent window can be an Application.Handle window if MainFormOnTaskBar = False
|
||||
case LParam of
|
||||
SW_PARENTCLOSING:
|
||||
begin
|
||||
if IsIconic(Window) then
|
||||
Info^.RestoreState := SW_SHOWMINNOACTIVE
|
||||
else
|
||||
if IsZoomed(Window) then
|
||||
Info^.RestoreState := SW_SHOWMAXIMIZED
|
||||
else
|
||||
Info^.RestoreState := SW_SHOWNOACTIVATE;
|
||||
end;
|
||||
SW_PARENTOPENING:
|
||||
begin
|
||||
if Info^.RestoreState <> 0 then
|
||||
begin
|
||||
Windows.ShowWindow(Window, Info^.RestoreState);
|
||||
Info^.RestoreState := 0;
|
||||
Exit(CallDefaultWindowProc(Window, Msg, WParam, LParam));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Result := WindowProc(Window, Msg, WParam, LParam);
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user