PDA

View Full Version : سوال : مسیر دسکتاپ را چطور پیدا کنیم



Mah6447
سه شنبه 09 مهر 1387, 11:46 صبح
سلام دوستان
چگونه می توان مسیر دسکتاپ را پیدا کرد؟
با تشکر

s.mostafa.rahmani
سه شنبه 09 مهر 1387, 12:58 عصر
function GetDesktopFolder: string;
var
buf: array[0..MAX_PATH] of char;
pidList: PItemIDList;
begin
Result := 'No Desktop Folder found.';
SHGetSpecialFolderLocation(Application.Handle, CSIDL_DESKTOP, pidList);
if (pidList <> nil) then
if (SHGetPathFromIDList(pidList, buf)) then
Result := buf;
end;

soheil_ce
سه شنبه 09 مهر 1387, 13:29 عصر
سلام عزیزم
این رو امتحان کن
به من که جواب داده :



uses
Registry;
function get_desktop_directory : String;
var
desktop_directory : String;
temp_registry : TRegIniFile;
begin
temp_registry:=TRegIniFile.Create('Software\Micros oft\Windows\CurrentVersion\Explorer');
desktop_directory:=temp_registry.ReadString('Shell Folders','Desktop','');
result:=desktop_directory;
end;