win32: set WindowPlacement.Length before the call of GetWindowPlacement

git-svn-id: trunk@29754 -
This commit is contained in:
paul 2011-03-09 03:20:36 +00:00
parent 74952c9d65
commit 0f516fc6ef
2 changed files with 4 additions and 1 deletions

View File

@ -2266,6 +2266,7 @@ begin
MoveType := Move_SourceIsInterface;
if (lWinControl is TCustomForm) and (TCustomForm(lWinControl).Parent = nil) then
begin
WindowPlacement.length := SizeOf(WindowPlacement);
if IsIconic(Window) and GetWindowPlacement(Window, @WindowPlacement) then
begin
with WindowPlacement.rcNormalPosition do
@ -2317,6 +2318,7 @@ begin
Window := Application.MainFormHandle;
end;
end;
WindowPlacement.length := SizeOf(WindowPlacement);
if IsIconic(Window) and GetWindowPlacement(Window, @WindowPlacement) then
begin
with WindowPlacement.rcNormalPosition do
@ -2329,7 +2331,7 @@ begin
GetWindowSize(Window, NewWidth, NewHeight);
Width := NewWidth;
Height := NewHeight;
if lWinControl <> nil then
if Assigned(lWinControl) then
begin
{$IFDEF VerboseSizeMsg}
GetClientRect(Window,R);

View File

@ -2191,6 +2191,7 @@ var
begin
Result := False;
WindowPlacement.length := SizeOf(WindowPlacement);
if IsIconic(Handle) and GetWindowPlacement(Handle, @WindowPlacement) then
R := WindowPlacement.rcNormalPosition
else