本文整理自网络,侵删。
Uses Windows,Registry;
function GetShellFolders(strDir: string): string;const regPath = '\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders';var Reg: TRegistry; strFolders: string;begin Reg := TRegistry.Create; try Reg.RootKey := HKEY_CURRENT_USER; if Reg.OpenKey(regPath, false) then begin strFolders := Reg.ReadString(strDir); end; finally Reg.Free; end; result := strFolders;end; {获取桌面} function GetDeskeptPath: string;begin Result := GetShellFolders('Desktop'); //是取得桌面文件夹的路径end; {获取我的文档} function GetMyDoumentpath: string;begin Result := GetShellFolders('Personal'); //我的文档end;
相关阅读 >>
Delphi vcl 的 tpagecontrol 控件,实现对页签的拖动
Delphi 利用unigui中的tunipagecontrol实现多页面
Delphi 用updateresource修改exe文件图标(已修正)
更多相关阅读请进入《Delphi》频道 >>