Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

296 lines
9.4 KiB

  1. //***************************************************************************
  2. // --- SHELLAPI.W SHSEMIP.H SHLOBJ.W SHOBJIDL.IDL SHLDISP.IDL SHPRIV.IDL ---
  3. // Which header is best for my new API?
  4. //
  5. // SHSEMIP - *AVOID _ALL_ USAGE*, NO EXPORTS, SUPER PRIVATE
  6. // used for very private shell defines.
  7. //
  8. // SHELLAPI - ALL NEW SHELL32 EXPORTS public and private
  9. // used for both public and private exports from shell32
  10. //
  11. // SHLOBJ - *AVOID NEW USAGE*, PREFER OTHER HEADERS
  12. // used primarily for legacy compatibility
  13. //
  14. // SHOBJIDL - ALL NEW SHELL PUBLIC INTERFACES
  15. // primary file for public shell (shell32+) interfaces
  16. //
  17. // SHLDISP - ALL NEW SHELL AUTOMATION INTERFACES
  18. // automation interfaces are always public
  19. //
  20. // SHPRIV - ALL NEW SHELL PRIVATE INTERFACES
  21. // private interfaces used anywhere in the shell
  22. //
  23. //***************************************************************************
  24. #ifndef _SHSEMIP_H_
  25. #define _SHSEMIP_H_
  26. #ifndef LPNTSTR_DEFINED
  27. #define LPNTSTR_DEFINED
  28. typedef UNALIGNED const WCHAR * LPNCWSTR;
  29. typedef UNALIGNED WCHAR * LPNWSTR;
  30. #ifdef UNICODE
  31. #define LPNCTSTR LPNCWSTR
  32. #define LPNTSTR LPNWSTR
  33. #else
  34. #define LPNCTSTR LPCSTR
  35. #define LPNTSTR LPSTR
  36. #endif
  37. #endif // LPNTSTR_DEFINED
  38. #ifndef DONT_WANT_SHELLDEBUG
  39. #ifndef DebugMsg /* ;Internal */
  40. #define DM_TRACE 0x0001 // Trace messages /* ;Internal */
  41. #define DM_WARNING 0x0002 // Warning /* ;Internal */
  42. #define DM_ERROR 0x0004 // Error /* ;Internal */
  43. #define DM_ASSERT 0x0008 // Assertions /* ;Internal */
  44. #define Assert(f) /* ;Internal */
  45. #define AssertE(f) (f) /* ;Internal */
  46. #define AssertMsg 1 ? (void)0 : (void) /* ;Internal */
  47. #define DebugMsg 1 ? (void)0 : (void) /* ;Internal */
  48. #endif /* ;Internal */
  49. /* ;Internal */
  50. #endif
  51. //
  52. // Define API decoration for direct importing of DLL references.
  53. //
  54. #ifndef WINSHELLAPI
  55. #if !defined(_SHELL32_)
  56. #define WINSHELLAPI DECLSPEC_IMPORT
  57. #else
  58. #define WINSHELLAPI
  59. #endif
  60. #endif // WINSHELLAPI
  61. #ifndef NOPRAGMAS
  62. #ifndef RC_INVOKED
  63. #pragma pack(1) /* Assume byte packing throughout */
  64. #endif /* !RC_INVOKED */
  65. #endif
  66. #ifdef __cplusplus
  67. extern "C" { /* Assume C declarations for C++ */
  68. #endif /* __cplusplus */
  69. //====== Ranges for WM_NOTIFY codes ==================================
  70. // If a new set of codes is defined, make sure the range goes /* ;Internal */
  71. // here so that we can keep them distinct /* ;Internal */
  72. // Note that these are defined to be unsigned to avoid compiler warnings
  73. // since NMHDR.code is declared as UINT.
  74. //
  75. // NM_FIRST - NM_LAST defined in commctrl.h (0U-0U) - (OU-99U)
  76. //
  77. // LVN_FIRST - LVN_LAST defined in commctrl.h (0U-100U) - (OU-199U)
  78. //
  79. // PSN_FIRST - PSN_LAST defined in prsht.h (0U-200U) - (0U-299U)
  80. //
  81. // HDN_FIRST - HDN_LAST defined in commctrl.h (0U-300U) - (OU-399U)
  82. //
  83. // TVN_FIRST - TVN_LAST defined in commctrl.h (0U-400U) - (OU-499U)
  84. // TTN_FIRST - TTN_LAST defined in commctrl.h (0U-520U) - (OU-549U)
  85. #define SEN_FIRST (0U-550U) // ;Internal
  86. #define SEN_LAST (0U-559U) // ;Internal
  87. #ifndef UNIX
  88. #define MAXPATHLEN MAX_PATH // ;Internal
  89. #endif
  90. #ifdef UNICODE
  91. #define OTHER_TCHAR_NAME(sz) sz##A
  92. #else // !UNICODE
  93. #define OTHER_TCHAR_NAME(sz) sz##W
  94. #endif
  95. //===========================================================================
  96. // ITEMIDLIST
  97. //===========================================================================
  98. // unsafe macros
  99. #define _ILSkip(pidl, cb) ((LPITEMIDLIST)(((BYTE*)(pidl))+cb))
  100. #define _ILNext(pidl) _ILSkip(pidl, (pidl)->mkid.cb)
  101. //===================================================================
  102. // Smart tiling API's
  103. WINSHELLAPI WORD WINAPI ArrangeWindows(HWND hwndParent, WORD flags, LPCRECT lpRect, WORD chwnd, const HWND *ahwnd);
  104. /* Avoid multiple typedefs C warnings. Defined in shlapip.h as well. */
  105. #ifndef RUNDLLPROC
  106. typedef void (WINAPI *RUNDLLPROCA)(HWND hwndStub, HINSTANCE hAppInstance, LPSTR lpszCmdLine, int nCmdShow);
  107. typedef void (WINAPI * RUNDLLPROCW)(HWND hwndStub, HINSTANCE hAppInstance, LPWSTR lpszCmdLine, int nCmdShow);
  108. #ifdef UNICODE
  109. #define RUNDLLPROC RUNDLLPROCW
  110. #else
  111. #define RUNDLLPROC RUNDLLPROCA
  112. #endif
  113. #endif
  114. // Maximum length of a path string
  115. #define CCHPATHMAX MAX_PATH
  116. #define MAXSPECLEN MAX_PATH
  117. #define MAX_PATH_URL INTERNET_MAX_URL_LENGTH
  118. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  119. #ifndef SIZEOF
  120. #define SIZEOF(a) sizeof(a)
  121. #endif
  122. #define PathRemoveBlanksORD 33
  123. #define PathFindFileNameORD 34
  124. #define PathFindExtensionORD 31
  125. #ifdef OVERRIDE_SHLWAPI_PATH_FUNCTIONS
  126. // SHLWAPI provides the majority of the Path functions. There are
  127. // some cases where the shell code (shell32 and explorer) need to
  128. // call a different variation of these calls. Because of this, we
  129. // have OVERRIDE_SHLWAPI_PATH_FUNCTIONS. Components such as shdocvw
  130. // should strive to *not* have this defined.
  131. //
  132. // Some reasons why something like shell32 would need this:
  133. // 1) Shell32 calls some WNet APIs due to the NT merge. Shlwapi
  134. // cannot take these.
  135. // 2) Shell32 needs the unaligned version PathBuildRoot,
  136. // PathCombine, etc.
  137. //
  138. #undef PathIsDirectory
  139. #undef PathMakePretty
  140. WINSHELLAPI BOOL WINAPI PathIsDirectory(LPCTSTR lpszPath);
  141. WINSHELLAPI BOOL WINAPI PathMakePretty(LPTSTR lpszPath);
  142. #endif // OVERRIDE_SHLWAPI_PATH_FUNCTIONS
  143. WINSHELLAPI void WINAPI ExitWindowsDialog(HWND hwnd);
  144. WINSHELLAPI void WINAPI LogoffWindowsDialog(HWND hwnd);
  145. WINSHELLAPI void WINAPI DisconnectWindowsDialog(HWND hwnd);
  146. WINSHELLAPI BOOL WINAPI IsSuspendAllowed(void);
  147. WINSHELLAPI void WINAPI SHRefreshSettings(void);
  148. EXTERN_C WINSHELLAPI HRESULT STDAPICALLTYPE SHCopyMonikerToTemp(IMoniker *pmk, LPCWSTR pszIn, LPWSTR pszOut, int cchOut);
  149. WINSHELLAPI BOOL WINAPI IsVolumeNTFS(LPCTSTR pszRootPath);
  150. #ifdef WINNT
  151. WINSHELLAPI LPWSTR WINAPI GetDownlevelCopyDataLossText(LPCWSTR pszSrcFile, LPCWSTR pszDestDir, BOOL bIsADir, BOOL * pbLossPossibleThisDir);
  152. #endif
  153. //-------- file engine stuff ----------
  154. // "current directory" management routines. used to set parameters
  155. // that paths are qualfied against in MoveCopyDeleteRename()
  156. WINSHELLAPI int WINAPI GetDefaultDrive();
  157. WINSHELLAPI int WINAPI SetDefaultDrive(int iDrive);
  158. WINSHELLAPI int WINAPI SetDefaultDirectory(LPCTSTR lpPath);
  159. WINSHELLAPI void WINAPI GetDefaultDirectory(int iDrive, LPSTR lpPath);
  160. //
  161. // NOTES: No reason to have this one here, but I don't want to break the build.
  162. //
  163. #ifndef WINCOMMCTRLAPI
  164. int WINAPI StrToInt(LPCTSTR lpSrc); // atoi()
  165. #endif
  166. #define POSINVALID 32767 // values for invalid position
  167. #define IDCMD_SYSTEMFIRST 0x8000
  168. #define IDCMD_SYSTEMLAST 0xbfff
  169. #define IDCMD_CANCELED 0xbfff
  170. #define IDCMD_PROCESSED 0xbffe
  171. #define IDCMD_DEFAULT 0xbffe
  172. /* timedate.c */
  173. // **********************************************************************
  174. // DATE is a structure with a date packed into a WORD size value. It
  175. // is compatible with a file date in a directory entry structure.
  176. // **********************************************************************
  177. #ifndef DATE_DEFINED
  178. typedef struct
  179. {
  180. WORD Day :5; // Day number 1 - 31
  181. WORD Month :4; // Month number 1 - 12
  182. WORD Year :7; // Year subtracted from 1980, 0-127
  183. } WORD_DATE;
  184. typedef union
  185. {
  186. WORD wDate;
  187. WORD_DATE sDate;
  188. } WDATE;
  189. #define DATE_DEFINED
  190. #endif
  191. // **********************************************************************
  192. // TIME is a structure with a 24 hour time packed into a WORD size value.
  193. // It is compatible with a file time in a directory entry structure.
  194. // **********************************************************************
  195. #ifndef TIME_DEFINED
  196. typedef struct
  197. {
  198. WORD Sec :5; // Seconds divided by 2 (0 - 29).
  199. WORD Min :6; // Minutes 0 - 59
  200. WORD Hour :5; // Hours 0 - 24
  201. } WORD_TIME;
  202. typedef union
  203. {
  204. WORD wTime;
  205. WORD_TIME sTime;
  206. } WTIME;
  207. #define TIME_DEFINED
  208. #endif
  209. WINSHELLAPI WORD WINAPI Shell_GetCurrentDate(void);
  210. WINSHELLAPI WORD WINAPI Shell_GetCurrentTime(void);
  211. //====== SEMI-PRIVATE API ===============================
  212. #ifndef HPSXA_DEFINED
  213. #define HPSXA_DEFINED
  214. DECLARE_HANDLE( HPSXA );
  215. #endif // HPSXA_DEFINED
  216. //====== SEMI-PRIVATE API ORDINALS ===============================
  217. // This is the list of semi-private ordinals we semi-publish.
  218. #define SHObjectPropertiesORD 178
  219. #define SHCreateDefClassObjectORD 70
  220. #define SHGetNetResourceORD 69
  221. #define SHEXP_SHCREATEDEFCLASSOBJECT MAKEINTRESOURCE(SHCreateDefClassObjectORD)
  222. #define SHEXP_SHGETNETRESOURCE MAKEINTRESOURCE(SHGetNetResourceORD)
  223. #ifdef __cplusplus
  224. }
  225. #endif /* __cplusplus */
  226. #ifndef RC_INVOKED
  227. #ifndef NOPRAGMAS
  228. #pragma pack()
  229. #endif /* NOPRAGMAS */
  230. #endif /* !RC_INVOKED */
  231. #endif // _SHSEMIP_H_