Einzelnen Beitrag anzeigen

Scorpion

Registriert seit: 3. Nov 2002
Ort: Flörsheim
154 Beiträge
 
Delphi 5 Professional
 
#3
  Alt 4. Jan 2003, 20:13
Hi,

der code sollte dir helfen...

Code:
...
Iconindex, Iconpfad, Ordnerpfad, Ordner;
attributes: word;
f1,f2: textfile;
...

procedure TForm7.Iconanpassen(Directory:String);
begin
assignfile(f1,Directory +'\desktop.ini');
assignfile(f2,Directory +'\desktop.txt');
rewrite(f2);
if Fileexists(Directory +'\desktop.ini') then
  begin
   reset(f1);
   repeat
     readln(f1,zeile);
     writeln(f2,zeile);
    until (eof(f1)) or (zeile='[.ShellClassInfo]');
   if eof(f1) then
    begin
     writeln(f2,'[.ShellClassInfo]');
     writeln(f2,'');
    end
   else
    begin
     readln(f1,zeile);
     writeln(f2,zeile);
    end;
  end
else
 begin
  writeln(f2,'[.ShellClassInfo]');
  writeln(f2,'');
 end;
writeln(f2,'Iconfile='+ IconPfad);
writeln(f2,'IconIndex='+ iconindex);
if Fileexists(Directory +'\desktop.ini') then
 begin
  closefile(f1);
  DeleteFile(Directory +'\desktop.ini')
 end;
closefile(f2);
RenameFile(Directory +'\desktop.txt',Directory +'\desktop.ini');
FileSetAttr(Directory + '\desktop.ini', fahidden);
//symbol(dcb,txtlaufwerk);

end;
Gruss
Nico
  Mit Zitat antworten Zitat