1
0
mirror of synced 2024-09-19 09:46:09 +00: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; procedure WriteFormPos(const AFactory: TX2SettingsFactory;
const ASection: String; const AForm: TCustomForm); const ASection: String; const AForm: TCustomForm);
var
pPlacement: TWindowPlacement;
begin begin
with AFactory[ASection] do with AFactory[ASection] do
try try
WriteBool('Maximized', (AForm.WindowState = wsMaximized)); 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('Left', Left);
WriteInteger('Top', Top); WriteInteger('Top', Top);
WriteInteger('Width', Width); WriteInteger('Width', Right - Left);
WriteInteger('Height', Height); WriteInteger('Height', Bottom - Top);
end; end;
finally finally
Free(); Free();