shfolder.pp 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. { ---------------------------------------------------------------------
  2. shfolder.dll is distributed standard with IE5.5, so it should ship
  3. with 2000/XP or higher but is likely to be installed on NT/95/98 or
  4. ME as well. It works on all these systems.
  5. The info found here is also in the registry:
  6. HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\
  7. HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\
  8. Missing from shfolder.dll are:
  9. Desktop
  10. Favorites
  11. NetHood
  12. Printhood
  13. Recent
  14. Sendto
  15. Startup
  16. Start menu
  17. Templates
  18. These are present in the registry, though.
  19. ---------------------------------------------------------------------}
  20. Unit shfolder;
  21. Interface
  22. Uses
  23. windows;
  24. Const
  25. LibName = 'SHFolder.dll';
  26. Const
  27. CSIDL_PERSONAL = $0005; { %USERPROFILE%\My Documents }
  28. CSIDL_APPDATA = $001A; { %USERPROFILE%\Application Data (roaming) }
  29. CSIDL_LOCAL_APPDATA = $001C; { %USERPROFILE%\Local Settings\Application Data (non roaming) }
  30. CSIDL_INTERNET_CACHE = $0020; { %USERPROFILE%\Local Settings\Temporary Internet Files}
  31. CSIDL_COOKIES = $0021; { %USERPROFILE%\Cookies}
  32. CSIDL_HISTORY = $0022; { %USERPROFILE%\Local settings\History}
  33. CSIDL_COMMON_APPDATA = $0023; { %PROFILESPATH%\All Users\Application Data }
  34. CSIDL_WINDOWS = $0024; { %SYSTEMROOT% }
  35. CSIDL_SYSTEM = $0025; { %SYSTEMROOT%\SYSTEM32 (may be system on 95/98/ME) }
  36. CSIDL_PROGRAM_FILES = $0026; { %SYSTEMDRIVE%\Program Files }
  37. CSIDL_MYPICTURES = $0027; { %USERPROFILE%\My Documents\My Pictures }
  38. CSIDL_PROGRAM_FILES_COMMON = $002b; { %SYSTEMDRIVE%\Program Files\Common }
  39. CSIDL_COMMON_DOCUMENTS = $002e; { %PROFILEPATH%\All Users\Documents }
  40. CSIDL_COMMON_ADMINTOOLS = $002f; { %PROFILEPATH%\All Users\Start Menu\Programs\Administrative Tools }
  41. CSIDL_ADMINTOOLS = $0030; { %USERPROFILEPATH%\<user name>\Start Menu\Programs\Administrative Tools }
  42. CSIDL_FLAG_CREATE = $8000; { (force creation of requested folder if it doesn't exist yet) }
  43. { Original entry points }
  44. Function SHGetFolderPathA(Ahwnd: HWND; Csidl: Integer; Token: THandle; Flags: DWord; Path: PChar): HRESULT; stdcall; external LibName name 'SHGetFolderPathA';
  45. Function SHGetFolderPathW(Ahwnd: HWND; Csidl: Integer; Token: THandle; Flags: DWord; Path: PChar): HRESULT; stdcall; external LibName name 'SHGetFolderPathW';
  46. Function SHGetFolderPath (Ahwnd: HWND; Csidl: Integer; Token: THandle; Flags: DWord; Path: PChar): HRESULT; stdcall; external LibName name 'SHGetFolderPathA';
  47. { For Delphi compatibility }
  48. type
  49. PFNSHGetFolderPathA = Function(Ahwnd: HWND; Csidl: Integer; Token: THandle; Flags: DWord; Path: PChar): HRESULT; stdcall;
  50. PFNSHGetFolderPathW = Function(Ahwnd: HWND; Csidl: Integer; Token: THandle; Flags: DWord; Path: PChar): HRESULT; stdcall;
  51. PFNSHGetFolderPath = PFNSHGetFolderPathA;
  52. TSHGetFolderPathA = PFNSHGetFolderPathA;
  53. TSHGetFolderPathW = PFNSHGetFolderPathW;
  54. TSHGetFolderPath = TSHGetFolderPathA;
  55. implementation
  56. const
  57. SHFolderDll = 'SHFolder.dll';
  58. end.