现在的位置: 首页 > 综合 > 正文

取得当前用户的桌面路径。

2013年09月13日 ⁄ 综合 ⁄ 共 281字 ⁄ 字号 评论关闭
function GetDesktopFolder: string;
var
  buffr: array[0..MAX_PATH] of char;
  idList: PItemIDList;
begin
  Result := 'No Desktop Folder found.';
  SHGetSpecialFolderLocation(Application.Handle, CSIDL_DESKTOP, idList);
  if (idList <> nil) then
    if (SHGetPathFromIDList(idList, buffr)) then
      Result := buffr;
end;

抱歉!评论已关闭.