ShFolder.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // functions to get shell special folders/
  2. // shfolder.dll supports these on all platforms including Win95, Win98, NT4 and IE4 shell
  3. // all CSIDL values refereed to here are supported natively by shfolder.dll, that is they
  4. // will work on all platforms.
  5. #ifndef _SHFOLDER_H_
  6. #define _SHFOLDER_H_
  7. #ifndef SHFOLDERAPI
  8. #if defined(_SHFOLDER_)
  9. #define SHFOLDERAPI STDAPI
  10. #else
  11. #define SHFOLDERAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  12. #endif
  13. #endif
  14. #ifndef CSIDL_PERSONAL
  15. #define CSIDL_PERSONAL 0x0005 // My Documents
  16. #endif
  17. #ifndef CSIDL_APPDATA
  18. #define CSIDL_APPDATA 0x001A // Application Data, new for NT4
  19. #endif
  20. #ifndef CSIDL_LOCAL_APPDATA
  21. #define CSIDL_LOCAL_APPDATA 0x001C // non roaming, user\Local Settings\Application Data
  22. #define CSIDL_INTERNET_CACHE 0x0020
  23. #define CSIDL_COOKIES 0x0021
  24. #define CSIDL_HISTORY 0x0022
  25. #define CSIDL_COMMON_APPDATA 0x0023 // All Users\Application Data
  26. #define CSIDL_WINDOWS 0x0024 // GetWindowsDirectory()
  27. #define CSIDL_SYSTEM 0x0025 // GetSystemDirectory()
  28. #define CSIDL_PROGRAM_FILES 0x0026 // C:\Program Files
  29. #define CSIDL_MYPICTURES 0x0027 // My Pictures, new for Win2K
  30. #define CSIDL_PROGRAM_FILES_COMMON 0x002b // C:\Program Files\Common
  31. #define CSIDL_COMMON_DOCUMENTS 0x002e // All Users\Documents
  32. #define CSIDL_FLAG_CREATE 0x8000 // new for Win2K, or this in to force creation of folder
  33. #define CSIDL_COMMON_ADMINTOOLS 0x002f // All Users\Start Menu\Programs\Administrative Tools
  34. #define CSIDL_ADMINTOOLS 0x0030 // <user name>\Start Menu\Programs\Administrative Tools
  35. #endif // CSIDL_LOCAL_APPDATA
  36. SHFOLDERAPI SHGetFolderPathA(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPSTR pszPath);
  37. SHFOLDERAPI SHGetFolderPathW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath);
  38. // protos so callers can GetProcAddress() from shfolder.dll
  39. typedef HRESULT (__stdcall * PFNSHGETFOLDERPATHA)(HWND, int, HANDLE, DWORD, LPSTR); // "SHGetFolderPathA"
  40. typedef HRESULT (__stdcall * PFNSHGETFOLDERPATHW)(HWND, int, HANDLE, DWORD, LPWSTR); // "SHGetFolderPathW"
  41. #ifdef UNICODE
  42. #define SHGetFolderPath SHGetFolderPathW
  43. #define PFNSHGETFOLDERPATH PFNSHGETFOLDERPATHW
  44. #else
  45. #define SHGetFolderPath SHGetFolderPathA
  46. #define PFNSHGETFOLDERPATH PFNSHGETFOLDERPATHA
  47. #endif
  48. #endif // _SHFOLDER_H_