mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-01 07:29:16 +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;
|
List: TStrings;
|
||||||
StayOnTopList: TFPList; // a list of windows that were normalized when showing modal
|
StayOnTopList: TFPList; // a list of windows that were normalized when showing modal
|
||||||
MaxLength: integer;
|
MaxLength: integer;
|
||||||
|
RestoreState: LongInt; // restore window state
|
||||||
MouseX, MouseY: smallint; // noticing spurious WM_MOUSEMOVE messages
|
MouseX, MouseY: smallint; // noticing spurious WM_MOUSEMOVE messages
|
||||||
DispInfoTextA: array [0..LV_DISP_INFO_COUNT-1] of AnsiString; // buffer for ListView LVN_GETDISPINFO notification
|
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
|
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)^);
|
SetMinMaxInfo(WinControl, PMINMAXINFO(LParam)^);
|
||||||
Exit(CallDefaultWindowProc(Window, Msg, WParam, LParam));
|
Exit(CallDefaultWindowProc(Window, Msg, WParam, LParam));
|
||||||
end;
|
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;
|
end;
|
||||||
Result := WindowProc(Window, Msg, WParam, LParam);
|
Result := WindowProc(Window, Msg, WParam, LParam);
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user