пытаюсь уничтожить форму, а она мой дух не отпускает :(
часть кода убрал
procedure TForm1.KOLForm1FormCreate(Sender: PObj);
var Mouse: TMouseEventData;
begin
LoadIni;
DFind( TV.TVInsert( TV.TVRoot, 0, ExcludeTrailingPathDelimiter(PathStalk)), PathStalk);
end;
procedure TForm1.LoadIni;
var
ini: PIniFile;
OD: POpenDirDialog;
x: integer;
begin
if FileExists(GetStartDir + 'settings.ini') Then
и т.п.
if not DirectoryExists( PathStalk + '\gamedata\sounds\')then
begin
OD := NewOpenDirDialog('', [odEditBox, odNewDialogStyle]);
OD.InitialPath := 'C:\';
Repeat
if OD.Execute Then
PathStalk := OD.Path
Else
begin
Form.Close;
end;
Until DirectoryExists( PathStalk + '\gamedata\sounds\');
OD.Free;
end;
end;
function TForm1.KOLForm1Message(var Msg: tagMSG; var Rslt: Integer): Boolean;
var
Filename: array [0..259] of char;
Count, i, n: Cardinal;
fname, STpath: string;
Mouse: TMouseEventData;
begin
if msg.message = 563 Then
begin
Result := False;
Count := DragQueryFile( msg.WParam, $FFFFFFFF, Filename, SizeOf(Filename));
for i := 0 to Count - 1 do
begin
DragQueryFile( msg.WParam, i, Filename, SizeOf(Filename));
fname := ExtractFileName(string(Filename));
if LV.LVIndexOf(fname) >= 0 Then
begin
STpath := IncludeTrailingPathDelimiter(TV.TVItemPath(TV.TVSelected, '\'));
n := 0;
While LV.LVIndexOf(fname + '.bak' + int2str(n) ) >= 0 Do
n := n + 1;
CopyMoveFiles( STpath + fname, STpath + fname + '.bak' + int2str(n), True);
CopyMoveFiles( string(Filename), STpath + fname, False);
end;
end;
DragFinish(Msg.WParam);
Result := True;
end;
end;