1
0
mirror of synced 2024-12-22 01:03:07 +01:00

Fixed: normal window position saved when maximized

This commit is contained in:
Mark van Renswoude 2005-11-29 14:00:54 +00:00
parent bbe4c1822a
commit 796b67418e

View File

@ -60,16 +60,22 @@ end;
procedure WriteFormPos(const AFactory: TX2SettingsFactory;
const ASection: String; const AForm: TCustomForm);
var
pPlacement: TWindowPlacement;
begin
with AFactory[ASection] do
try
WriteBool('Maximized', (AForm.WindowState = wsMaximized));
if AForm.WindowState <> wsMaximized then
with THackCustomForm(AForm) do begin
pPlacement.length := SizeOf(TWindowPlacement);
if GetWindowPlacement(AForm.Handle, @pPlacement) <> 0 then
with pPlacement.rcNormalPosition do
begin
WriteInteger('Left', Left);
WriteInteger('Top', Top);
WriteInteger('Width', Width);
WriteInteger('Height', Height);
WriteInteger('Width', Right - Left);
WriteInteger('Height', Bottom - Top);
end;
finally
Free();