Registriert seit: 17. Okt 2007
154 Beiträge
|
Erklären
19. Jan 2008, 23:33
Kann mir bitte irgend jemand diesen Quellcode mit kommentaren in den zeilen ausfüllen kapiere ihn nicht im geringsten und es nützt mir nichts ihn einfach abzuschreiben.
Delphi-Quellcode:
var
frmConfig: TfrmConfig;
implementation
{$R *.dfm}
uses
IniFiles, uHelper, ShlObj;
procedure TfrmConfig.btnCancelClick(Sender: TObject);
begin
Application.Terminate;
end;
procedure TfrmConfig.btnSaveClick(Sender: TObject);
var
fn: string;
ini: TIniFile;
begin
fn := GetShellFolder(CSIDL_APPDATA) + '\CKAnts\';
ForceDirectories(fn);
fn := fn + 'config.xml';
ini := TIniFile.Create(fn);
ini.WriteInteger('main', 'fillmode', cbxMode.ItemIndex);
ini.WriteInteger('main', 'bgcol', cbxBG.Selected);
ini.WriteInteger('main', 'antcol', cbxAnts.Selected);
ini.WriteBool('main', 'antrnd', cbRndAnt.Checked);
ini.WriteBool('main', 'usescreen', cbScreenshot.Checked);
ini.WriteBool('main', 'extonmouse', cbExitOnMouse.Checked);
ini.Free;
Application.Terminate;
end;
procedure TfrmConfig.cbRndAntClick(Sender: TObject);
begin
cbxAnts.Enabled := not cbRndAnt.Checked;
end;
procedure TfrmConfig.cbScreenshotClick(Sender: TObject);
begin
//cbxBG.Enabled := not cbScreenshot.Checked;
end;
procedure TfrmConfig.FormCreate(Sender: TObject);
var
fn: string;
ini: TIniFile;
begin
ShowWindow( Application.Handle, SW_HIDE );
SetWindowLong( Application.Handle, GWL_EXSTYLE,
GetWindowLong(Application.Handle, GWL_EXSTYLE) or
WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
ShowWindow( Application.Handle, SW_SHOW );
fn := GetShellFolder(CSIDL_APPDATA) + '\CKAnts\';
ForceDirectories(fn);
fn := fn + 'config.xml';
ini := TIniFile.Create(fn);
cbxMode.ItemIndex := ini.ReadInteger('main', 'fillmode', 1);
cbxBG.Selected := ini.ReadInteger('main', 'bgcol', clblack);
cbxAnts.Selected := ini.ReadInteger('main', 'antcol', clred);
cbRndAnt.Checked := ini.ReadBool('main', 'antrnd', False);
cbScreenshot.Checked := ini.ReadBool('main', 'usescreen', True);
cbExitOnMouse.Checked := ini.ReadBool('main', 'extonmouse', True);
ini.Free;
end;
end.
|
|
Zitat
|