kit » 06.10.2016 08:47:23
unit AppUtils;
procedure WriteFormPlacement(Form: TForm; IniFile: TCustomInifile; const Section: string);
begin
with Form do begin
IniFile.WriteInteger(Section, siFlags, Ord(WindowState));
IniFile.WriteInteger(Section, siPixels, Screen.PixelsPerInch);
// if not(WindowState = wsNormal) then
// WritePosStr(IniFile, Section, siNormPos, Format('%d,%d,%d,%d',[Left, Top, Width, Height]))
// else
WritePosStr(IniFile, Section, siNormPos, Format('%d,%d,%d,%d',[RestoredLeft, RestoredTop, RestoredWidth, RestoredHeight]));
end;
end;
WriteFormPlacement нужно вешать на TForm.OnShow