win32: don't set minimized window size using SetWindowPos - we need to set the normal window position using SetWindowPlacement

git-svn-id: trunk@29755 -
This commit is contained in:
paul 2011-03-09 03:23:07 +00:00
parent 0f516fc6ef
commit 66766609c8

View File

@ -469,9 +469,13 @@ class procedure TWin32WSWinControl.SetBounds(const AWinControl: TWinControl;
var
IntfLeft, IntfTop, IntfWidth, IntfHeight: integer;
suppressMove: boolean;
Handle: HWND;
WindowPlacement: TWINDOWPLACEMENT;
begin
IntfLeft := ALeft; IntfTop := ATop;
IntfWidth := AWidth; IntfHeight := AHeight;
IntfLeft := ALeft;
IntfTop := ATop;
IntfWidth := AWidth;
IntfHeight := AHeight;
LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight);
{$IFDEF VerboseSizeMsg}
DebugLn('TWin32WSWinControl.ResizeWindow A ', dbgsName(AWinControl),
@ -479,11 +483,20 @@ begin
' Win32=',Format('%d, %d, %d, %d', [IntfLeft,IntfTop,IntfWidth,IntfHeight])
);
{$ENDIF}
suppressMove := false;
suppressMove := False;
AdaptBounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight, suppressMove);
if not suppressMove then
Windows.SetWindowPos(AWinControl.Handle, 0, IntfLeft, IntfTop, IntfWidth, IntfHeight,
SWP_NOZORDER or SWP_NOACTIVATE);
begin
Handle := AWinControl.Handle;
WindowPlacement.length := SizeOf(WindowPlacement);
if IsIconic(Handle) and GetWindowPlacement(Handle, @WindowPlacement) then
begin
WindowPlacement.rcNormalPosition := Bounds(IntfLeft, IntfTop, IntfWidth, IntfHeight);
SetWindowPlacement(Handle, @WindowPlacement);
end
else
Windows.SetWindowPos(Handle, 0, IntfLeft, IntfTop, IntfWidth, IntfHeight, SWP_NOZORDER or SWP_NOACTIVATE);
end;
LCLControlSizeNeedsUpdate(AWinControl, True);
end;