2011年7月10日 星期日

如何找出 Windows 特殊資料夾位置,例如取desktop路徑

uses
  shlobj;


function GetSpecialDir: string;
var
  pidl : PItemIDList;
  InFolder : array[0..MAX_PATH] of Char;
begin
  SHGetSpecialFolderLocation(Application.Handle, CSIDL_DESKTOP, pidl);
  SHGetPathFromIDList(pidl, InFolder);
  result:=InFolder;
end;

沒有留言:

張貼留言