procedure TForm1.FormCreate(Sender: TObject);
var
Status: Integer;
TipusNev : string; //fájltípus kiterjeszése
TipusDarab: integer; //fájltípusok száma
i : Integer;
begin
//fájlnév azonos a program nevével
IniFile := TIniFile.Create(ChangeFileExt(Application.ExeName, '.ini'));
{elmentett ablak-státusz beolvasása}
Status := IniFile.ReadInteger ('MainForm', 'Status', 0);
if Status <> 0 then
begin
{elmentett ablak-poziciók és méretek beolvasása és beállítása}
Top := IniFile.ReadInteger ('MainForm', 'Top', Top);
Left := IniFile.ReadInteger ('MainForm', 'Left', Left);
Width := IniFile.ReadInteger ('MainForm', 'Width', Width);
Height := IniFile.ReadInteger ('MainForm', 'Height', Height);
TipusDarab := IniFile.ReadInteger ('MainForm', 'TipusDarab', TipusDarab);
{ablak-státusz beállítása}
case Status of
1: WindowState := wsNormal; //ez az alapértelmezett
2: WindowState := wsMinimized;
3: WindowState := wsMaximized;
end;
end;
//saját paraméterek kezelése pl: bemeneti fájltípus TComboBox-komponensben
InFileTipusComboBox.Clear;
for i:=0 to TipusDarab-1 do
begin
//elmentett típusok beolvasása és beállítása
TipusNev := IniFile.ReadString ('Tipusok',('Tipus'+IntToStr(i)), TipusNev);
InFileTipusComboBox.Items.Add(TipusNev);
end;
if InFileTipusComboBox.Items.Count=0 then
InFileTipusComboBox.Items.Add('bmp');
InFileTipusComboBox.ItemIndex:=0;
end;