home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / shfolder.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  2.7 KB  |  68 lines

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