// Es wird eine
Datei auf dem Desktop erzeugt. uses Shlobj, ActiveX;
function DesktopPfad: string;
var
pidl: PItemIDList;
Pfad: PChar;
Malloc: IMalloc;
begin
result := '';
SHGetMalloc(Malloc);
if Malloc = nil then exit;
if SHGetSpecialFolderLocation(0, CSIDL_DESKTOPDIRECTORY, pidl) = NOERROR
then begin
GetMem(Pfad, max_path);
if SHGetPathFromIDList(pidl, Pfad) then begin
result := Pfad;
if ansilastchar(result) <> '\' then result := result + '\';
end;
FreeMem(Pfad);
Malloc.Free(pidl);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Lines.SaveToFile(Desktoppfad + 'Test.txt');
end;
|
Zugriffe seit 6.9.2001 auf Delphi-Ecke





