procedure TForm1.SaveProgParam;
var
RIniFile: TRegIniFile;
Begin
// по умолчанию всё делается в
HKEY_CURRENT_USER
RIniFile := TRegIniFile.Create('Software');
RIniFile.OpenKey('Папка_вашей_программы',true);
if Form1.WindowState=wsNormal then
begin
RIniFile.WriteInteger('Option', 'Width', Width);
RIniFile.WriteInteger('Option', 'Heigth', Height);
RIniFile.WriteInteger('Option', 'Left', Left);
RIniFile.WriteInteger('Option', 'Top', Top);
end;
RIniFile.WriteInteger('Option', 'WinState', Integer(WindowState));
RIniFile.Free; //освобождаем переменную
end;
|