Fixed: normal window position saved when maximized
This commit is contained in:
parent
bbe4c1822a
commit
796b67418e
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user