Leaked source code of windows server 2003
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.

520 lines
24 KiB

  1. #include <shlobj.h> // ;Internal
  2. #include <shellapi.h> // ;Internal
  3. /* ;Internal */
  4. #ifndef _SHSEMIP_H_
  5. #define _SHSEMIP_H_
  6. //
  7. // Define API decoration for direct importing of DLL references.
  8. //
  9. #ifndef WINSHELLAPI
  10. #if !defined(_SHELL32_)
  11. #define WINSHELLAPI DECLSPEC_IMPORT
  12. #else
  13. #define WINSHELLAPI
  14. #endif
  15. #endif // WINSHELLAPI
  16. #ifndef RC_INVOKED
  17. #pragma pack(1) /* Assume byte packing throughout */
  18. #endif /* !RC_INVOKED */
  19. #ifdef __cplusplus
  20. extern "C" { /* Assume C declarations for C++ */
  21. #endif /* __cplusplus */
  22. #ifndef DONT_WANT_SHELLDEBUG
  23. #ifndef DebugMsg /* ;Internal */
  24. #define DM_TRACE 0x0001 // Trace messages /* ;Internal */
  25. #define DM_WARNING 0x0002 // Warning /* ;Internal */
  26. #define DM_ERROR 0x0004 // Error /* ;Internal */
  27. #define DM_ASSERT 0x0008 // Assertions /* ;Internal */
  28. #define Assert(f) /* ;Internal */
  29. #define AssertE(f) (f) /* ;Internal */
  30. #define AssertMsg 1 ? (void)0 : (void) /* ;Internal */
  31. #define DebugMsg 1 ? (void)0 : (void) /* ;Internal */
  32. #endif /* ;Internal */
  33. /* ;Internal */
  34. #endif
  35. //====== Ranges for WM_NOTIFY codes ==================================
  36. // If a new set of codes is defined, make sure the range goes /* ;Internal */
  37. // here so that we can keep them distinct /* ;Internal */
  38. // Note that these are defined to be unsigned to avoid compiler warnings
  39. // since NMHDR.code is declared as UINT.
  40. //
  41. // NM_FIRST - NM_LAST defined in commctrl.h (0U-0U) - (OU-99U)
  42. //
  43. // LVN_FIRST - LVN_LAST defined in commctrl.h (0U-100U) - (OU-199U)
  44. //
  45. // PSN_FIRST - PSN_LAST defined in prsht.h (0U-200U) - (0U-299U)
  46. //
  47. // HDN_FIRST - HDN_LAST defined in commctrl.h (0U-300U) - (OU-399U)
  48. //
  49. // TVN_FIRST - TVN_LAST defined in commctrl.h (0U-400U) - (OU-499U)
  50. // TTN_FIRST - TTN_LAST defined in commctrl.h (0U-520U) - (OU-549U)
  51. #define RFN_FIRST (0U-510U) // run file dialog notify
  52. #define RFN_LAST (0U-519U)
  53. #define SEN_FIRST (0U-550U) // ;Internal
  54. #define SEN_LAST (0U-559U) // ;Internal
  55. #define MAXPATHLEN MAX_PATH // ;Internal
  56. //===========================================================================
  57. // ITEMIDLIST
  58. //===========================================================================
  59. WINSHELLAPI LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl);
  60. WINSHELLAPI UINT WINAPI ILGetSize(LPCITEMIDLIST pidl);
  61. WINSHELLAPI LPITEMIDLIST WINAPI ILCreate(void);
  62. WINSHELLAPI LPITEMIDLIST WINAPI ILAppendID(LPITEMIDLIST pidl, LPCSHITEMID pmkid, BOOL fAppend);
  63. WINSHELLAPI void WINAPI ILFree(LPITEMIDLIST pidl);
  64. WINSHELLAPI void WINAPI ILGlobalFree(LPITEMIDLIST pidl);
  65. WINSHELLAPI LPITEMIDLIST WINAPI ILCreateFromPath(LPCSTR szPath);
  66. WINSHELLAPI BOOL WINAPI ILGetDisplayName(LPCITEMIDLIST pidl, LPSTR pszName);
  67. WINSHELLAPI LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl);
  68. WINSHELLAPI BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl);
  69. WINSHELLAPI LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl);
  70. WINSHELLAPI LPITEMIDLIST WINAPI ILCloneFirst(LPCITEMIDLIST pidl);
  71. WINSHELLAPI LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl);
  72. WINSHELLAPI BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  73. WINSHELLAPI BOOL WINAPI ILIsEqualItemID(LPCSHITEMID pmkid1, LPCSHITEMID pmkid2);
  74. WINSHELLAPI BOOL WINAPI ILIsParent(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, BOOL fImmediate);
  75. WINSHELLAPI LPITEMIDLIST WINAPI ILFindChild(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild);
  76. WINSHELLAPI LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  77. WINSHELLAPI HRESULT WINAPI ILLoadFromStream(LPSTREAM pstm, LPITEMIDLIST *pidl);
  78. WINSHELLAPI HRESULT WINAPI ILSaveToStream(LPSTREAM pstm, LPCITEMIDLIST pidl);
  79. WINSHELLAPI HRESULT WINAPI ILLoadFromFile(HFILE hfile, LPITEMIDLIST *pidl);
  80. WINSHELLAPI HRESULT WINAPI ILSaveToFile(HFILE hfile, LPCITEMIDLIST pidl);
  81. WINSHELLAPI LPITEMIDLIST WINAPI _ILCreate(UINT cbSize);
  82. WINSHELLAPI HRESULT WINAPI SHILCreateFromPath(LPCSTR szPath, LPITEMIDLIST *ppidl, DWORD *rgfInOut);
  83. // helper macros
  84. #define ILIsEmpty(pidl) ((pidl)->mkid.cb==0)
  85. #define IsEqualItemID(pmkid1, pmkid2) (memcmp(pmkid1, pmkid2, (pmkid1)->cb)==0)
  86. #define ILCreateFromID(pmkid) ILAppendID(NULL, pmkid, TRUE)
  87. // unsafe macros
  88. #define _ILSkip(pidl, cb) ((LPITEMIDLIST)(((BYTE*)(pidl))+cb))
  89. #define _ILNext(pidl) _ILSkip(pidl, (pidl)->mkid.cb)
  90. /*
  91. * The SHObjectProperties API provides an easy way to invoke
  92. * the Properties context menu command on shell objects.
  93. *
  94. * PARAMETERS
  95. *
  96. * hwndOwner The window handle of the window which will own the dialog
  97. * dwType A SHOP_ value as defined below
  98. * lpObject Name of the object, see SHOP_ values below
  99. * lpPage The name of the property sheet page to open to or NULL.
  100. *
  101. * RETURN
  102. *
  103. * TRUE if the Properties command was invoked
  104. */
  105. WINSHELLAPI BOOL WINAPI SHObjectProperties(HWND hwndOwner, DWORD dwType, LPCSTR lpObject, LPCSTR lpPage);
  106. #define SHOP_PRINTERNAME 1 // lpObject points to a printer friendly name
  107. #define SHOP_FILEPATH 2 // lpObject points to a fully qualified path+file name
  108. #define SHOP_TYPEMASK 0x00000003
  109. #define SHOP_MODAL 0x80000000
  110. //====== ShellMessageBox ================================================
  111. // If lpcTitle is NULL, the title is taken from hWnd
  112. // If lpcText is NULL, this is assumed to be an Out Of Memory message
  113. // If the selector of lpcTitle or lpcText is NULL, the offset should be a
  114. // string resource ID
  115. // The variable arguments must all be 32-bit values (even if fewer bits
  116. // are actually used)
  117. // lpcText (or whatever string resource it causes to be loaded) should
  118. // be a formatting string similar to wsprintf except that only the
  119. // following formats are available:
  120. // %% formats to a single '%'
  121. // %nn%s the nn-th arg is a string which is inserted
  122. // %nn%ld the nn-th arg is a DWORD, and formatted decimal
  123. // %nn%lx the nn-th arg is a DWORD, and formatted hex
  124. // note that lengths are allowed on the %s, %ld, and %lx, just
  125. // like wsprintf /* ;Internal */
  126. //
  127. int _cdecl ShellMessageBox(HINSTANCE hAppInst, HWND hWnd, LPCSTR
  128. lpcText, LPCSTR lpcTitle, UINT fuStyle, ...);
  129. //===================================================================
  130. // Smart tiling API's
  131. WINSHELLAPI WORD WINAPI ArrangeWindows(HWND hwndParent, WORD flags, LPCRECT lpRect, WORD chwnd, const HWND *ahwnd);
  132. //
  133. // Flags for SHGetSetSettings
  134. //
  135. typedef struct {
  136. BOOL fShowAllObjects : 1;
  137. BOOL fShowExtensions : 1;
  138. BOOL fNoConfirmRecycle : 1;
  139. UINT fRestFlags : 13;
  140. LPSTR pszHiddenFileExts;
  141. UINT cbHiddenFileExts;
  142. } SHELLSTATE, *LPSHELLSTATE;
  143. #define SSF_SHOWALLOBJECTS 0x0001
  144. #define SSF_SHOWEXTENSIONS 0x0002
  145. #define SSF_HIDDENFILEEXTS 0x0004
  146. #define SSF_NOCONFIRMRECYCLE 0x8000
  147. //
  148. // for SHGetNetResource
  149. //
  150. typedef HANDLE HNRES;
  151. //
  152. // For SHCreateDefClassObject
  153. //
  154. typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject);
  155. typedef void (WINAPI FAR* RUNDLLPROC)(HWND hwndStub,
  156. HINSTANCE hAppInstance,
  157. LPSTR lpszCmdLine, int nCmdShow);
  158. //=======================================================================
  159. // String constants for
  160. // 1. Registration database keywords (prefix STRREG_)
  161. // 2. Exported functions from handler dlls (prefix STREXP_)
  162. // 3. .INI file keywords (prefix STRINI_)
  163. // 4. Others (prefix STR_)
  164. //=======================================================================
  165. #define STRREG_SHELLUI "ShellUIHandler"
  166. #define STRREG_SHELL "Shell"
  167. #define STRREG_DEFICON "DefaultIcon"
  168. #define STRREG_SHEX "shellex"
  169. #define STRREG_SHEX_PROPSHEET STRREG_SHEX "\\PropertySheetHandlers"
  170. #define STRREG_SHEX_DDHANDLER STRREG_SHEX "\\DragDropHandlers"
  171. #define STRREG_SHEX_MENUHANDLER STRREG_SHEX "\\ContextMenuHandlers"
  172. #define STRREG_SHEX_COPYHOOK "Directory\\" STRREG_SHEX "\\CopyHookHandlers"
  173. #define STRREG_SHEX_PRNCOPYHOOK "Printers\\" STRREG_SHEX "\\CopyHookHandlers"
  174. #define STREXP_CANUNLOAD "DllCanUnloadNow" // From OLE 2.0
  175. #define STRINI_CLASSINFO ".ShellClassInfo" // secton name
  176. #define STRINI_SHELLUI "ShellUIHandler"
  177. #define STRINI_OPENDIRICON "OpenDirIcon"
  178. #define STRINI_DIRICON "DirIcon"
  179. #define STR_DESKTOPINI "desktop.ini"
  180. // Maximum length of a path string
  181. #define CCHPATHMAX MAX_PATH
  182. #define MAXSPECLEN MAX_PATH
  183. #define DRIVEID(path) ((path[0] - 'A') & 31)
  184. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  185. #define PATH_CCH_EXT 64
  186. // PathResolve flags
  187. #define PRF_VERIFYEXISTS 0x0001
  188. #define PRF_TRYPROGRAMEXTENSIONS (0x0002 | PRF_VERIFYEXISTS)
  189. #define PRF_FIRSTDIRDEF 0x0004
  190. #define PRF_DONTFINDLNK 0x0008 // if PRF_TRYPROGRAMEXTENSIONS is specified
  191. //
  192. // For CallCPLEntry16
  193. //
  194. DECLARE_HANDLE(FARPROC16);
  195. // Needed for RunFileDlg
  196. #define RFD_NOBROWSE 0x00000001
  197. #define RFD_NODEFFILE 0x00000002
  198. #define RFD_USEFULLPATHDIR 0x00000004
  199. #define RFD_NOSHOWOPEN 0x00000008
  200. #ifdef RFN_FIRST
  201. #define RFN_EXECUTE (RFN_FIRST - 0)
  202. typedef struct {
  203. NMHDR hdr;
  204. LPCSTR lpszCmd;
  205. LPCSTR lpszWorkingDir;
  206. int nShowCmd;
  207. } NMRUNFILE, *LPNMRUNFILE;
  208. #endif
  209. // RUN FILE RETURN values from notify message
  210. #define RFR_NOTHANDLED 0
  211. #define RFR_SUCCESS 1
  212. #define RFR_FAILURE 2
  213. #define PathRemoveBlanksORD 33
  214. #define PathFindFileNameORD 34
  215. #define PathGetExtensionORD 158
  216. #define PathFindExtensionORD 31
  217. WINSHELLAPI LPSTR WINAPI PathAddBackslash(LPSTR lpszPath);
  218. WINSHELLAPI LPSTR WINAPI PathRemoveBackslash(LPSTR lpszPath);
  219. WINSHELLAPI void WINAPI PathRemoveBlanks(LPSTR lpszString);
  220. WINSHELLAPI BOOL WINAPI PathRemoveFileSpec(LPSTR lpszPath);
  221. WINSHELLAPI LPSTR WINAPI PathFindFileName(LPCSTR pPath);
  222. WINSHELLAPI BOOL WINAPI PathIsRoot(LPCSTR lpszPath);
  223. WINSHELLAPI BOOL WINAPI PathIsRelative(LPCSTR lpszPath);
  224. WINSHELLAPI BOOL WINAPI PathIsUNC(LPCSTR lpsz);
  225. WINSHELLAPI BOOL WINAPI PathIsDirectory(LPCSTR lpszPath);
  226. WINSHELLAPI BOOL WINAPI PathIsExe(LPCSTR lpszPath);
  227. WINSHELLAPI int WINAPI PathGetDriveNumber(LPCSTR lpszPath);
  228. WINSHELLAPI LPSTR WINAPI PathCombine(LPSTR szDest, LPCSTR lpszDir, LPCSTR lpszFile);
  229. WINSHELLAPI BOOL WINAPI PathAppend(LPSTR pPath, LPCSTR pMore);
  230. WINSHELLAPI LPSTR WINAPI PathBuildRoot(LPSTR szRoot, int iDrive);
  231. WINSHELLAPI int WINAPI PathCommonPrefix(LPCSTR pszFile1, LPCSTR pszFile2, LPSTR achPath);
  232. WINSHELLAPI LPSTR WINAPI PathGetExtension(LPCSTR lpszPath, LPSTR lpszExtension, int cchExt);
  233. WINSHELLAPI LPSTR WINAPI PathFindExtension(LPCSTR pszPath);
  234. WINSHELLAPI BOOL WINAPI PathCompactPath(HDC hDC, LPSTR lpszPath, UINT dx);
  235. WINSHELLAPI BOOL WINAPI PathFileExists(LPCSTR lpszPath);
  236. WINSHELLAPI BOOL WINAPI PathMatchSpec(LPCSTR pszFile, LPCSTR pszSpec);
  237. WINSHELLAPI BOOL WINAPI PathMakeUniqueName(LPSTR pszUniqueName, UINT cchMax, LPCSTR pszTemplate, LPCSTR pszLongPlate, LPCSTR pszDir);
  238. WINSHELLAPI LPSTR WINAPI PathGetArgs(LPCSTR pszPath);
  239. WINSHELLAPI BOOL WINAPI PathGetShortName(LPCSTR lpszLongName, LPSTR lpszShortName, UINT cbShortName);
  240. WINSHELLAPI BOOL WINAPI PathGetLongName(LPCSTR lpszShortName, LPSTR lpszLongName, UINT cbLongName);
  241. WINSHELLAPI void WINAPI PathQuoteSpaces(LPSTR lpsz);
  242. WINSHELLAPI void WINAPI PathUnquoteSpaces(LPSTR lpsz);
  243. WINSHELLAPI BOOL WINAPI PathDirectoryExists(LPCSTR lpszDir);
  244. WINSHELLAPI void WINAPI PathQualify(LPSTR lpsz);
  245. WINSHELLAPI int WINAPI PathResolve(LPSTR lpszPath, LPCSTR dirs[], UINT fFlags);
  246. WINSHELLAPI LPSTR WINAPI PathGetNextComponent(LPCSTR lpszPath, LPSTR lpszComponent);
  247. WINSHELLAPI LPSTR WINAPI PathFindNextComponent(LPCSTR lpszPath);
  248. WINSHELLAPI BOOL WINAPI PathIsSameRoot(LPCSTR pszPath1, LPCSTR pszPath2);
  249. WINSHELLAPI void WINAPI PathSetDlgItemPath(HWND hDlg, int id, LPCSTR pszPath);
  250. WINSHELLAPI BOOL WINAPI ParseField(LPCSTR szData, int n, LPSTR szBuf, int iBufLen);
  251. int WINAPI PathCleanupSpec(LPCSTR pszDir, LPSTR pszSpec);
  252. //
  253. // Return codes from PathCleanupSpec. Negative return values are
  254. // unrecoverable errors
  255. //
  256. #define PCS_FATAL 0x80000000
  257. #define PCS_REPLACEDCHAR 0x00000001
  258. #define PCS_REMOVEDCHAR 0x00000002
  259. #define PCS_TRUNCATED 0x00000004
  260. #define PCS_PATHTOOLONG 0x00000008 // Always combined with FATAL
  261. WINSHELLAPI int WINAPI RestartDialog(HWND hwnd, LPCSTR lpPrompt, DWORD dwReturn);
  262. WINSHELLAPI void WINAPI ExitWindowsDialog(HWND hwnd);
  263. WINSHELLAPI int WINAPI RunFileDlg(HWND hwndParent, HICON hIcon, LPCSTR lpszWorkingDir, LPCSTR lpszTitle,
  264. LPCSTR lpszPrompt, DWORD dwFlags);
  265. WINSHELLAPI int WINAPI PickIconDlg(HWND hwnd, LPSTR pszIconPath, UINT cbIconPath, int *piIconIndex);
  266. WINSHELLAPI BOOL WINAPI GetFileNameFromBrowse(HWND hwnd, LPSTR szFilePath, UINT cbFilePath, LPCSTR szWorkingDir, LPCSTR szDefExt, LPCSTR szFilters, LPCSTR szTitle);
  267. WINSHELLAPI int WINAPI DriveType(int iDrive);
  268. WINSHELLAPI void WINAPI InvalidateDriveType(int iDrive);
  269. WINSHELLAPI int WINAPI IsNetDrive(int iDrive);
  270. WINSHELLAPI UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags);
  271. WINSHELLAPI void WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet);
  272. WINSHELLAPI LRESULT WINAPI SHRenameFile(HWND hwndParent, LPCSTR pszDir, LPCSTR pszOldName, LPCSTR pszNewName, BOOL bRetainExtension);
  273. WINSHELLAPI UINT WINAPI SHGetNetResource(HNRES hnres, UINT iItem, LPNETRESOURCE pnres, UINT cbMax);
  274. WINSHELLAPI STDAPI SHCreateDefClassObject(REFIID riid, LPVOID * ppv, LPFNCREATEINSTANCE lpfn, UINT *pcRefDll, REFIID riidInstance);
  275. WINSHELLAPI LRESULT WINAPI CallCPLEntry16(HINSTANCE hinst, FARPROC16 lpfnEntry, HWND hwndCPL, UINT msg, DWORD lParam1, DWORD lParam2);
  276. WINSHELLAPI BOOL WINAPI SHRunControlPanel(LPCSTR lpcszCmdLine, HWND hwndMsgParent);
  277. WINSHELLAPI STDAPI SHCLSIDFromString(LPCSTR lpsz, LPCLSID lpclsid);
  278. #define SHObjectPropertiesORD 178
  279. WINSHELLAPI BOOL WINAPI SHObjectProperties(HWND hwndOwner, DWORD dwType, LPCSTR lpObject, LPCSTR lpPage);
  280. WINSHELLAPI int WINAPI DriveType(int iDrive);
  281. WINSHELLAPI int WINAPI RestartDialog(HWND hwnd, LPCSTR lpPrompt, DWORD dwReturn);
  282. WINSHELLAPI int WINAPI PickIconDlg(HWND hwnd, LPSTR pszIconPath, UINT cbIconPath, int *piIconIndex);
  283. //===================================================================
  284. // Shell_MergeMenu parameter
  285. //
  286. #define MM_ADDSEPARATOR 0x00000001L
  287. #define MM_SUBMENUSHAVEIDS 0x00000002L
  288. //-------- drive type identification --------------
  289. // iDrive drive index (0=A, 1=B, ...)
  290. //
  291. #define DRIVE_CDROM 5 // extended DriveType() types
  292. #define DRIVE_RAMDRIVE 6
  293. #define DRIVE_TYPE 0x000F // type masek
  294. #define DRIVE_SLOW 0x0010 // drive is on a slow link
  295. #define DRIVE_LFN 0x0020 // drive supports LFNs
  296. #define DRIVE_AUTORUN 0x0040 // drive has AutoRun.inf in root.
  297. #define DRIVE_AUDIOCD 0x0080 // drive is a AudioCD
  298. #define DRIVE_AUTOOPEN 0x0100 // should *always* auto open on insert
  299. #define DRIVE_NETUNAVAIL 0x0200 // Network drive that is not available
  300. #define DRIVE_SHELLOPEN 0x0400 // should auto open on insert, if shell has focus
  301. #define DriveTypeFlags(iDrive) DriveType('A' + (iDrive))
  302. #define DriveIsSlow(iDrive) (DriveTypeFlags(iDrive) & DRIVE_SLOW)
  303. #define DriveIsLFN(iDrive) (DriveTypeFlags(iDrive) & DRIVE_LFN)
  304. #define DriveIsAutoRun(iDrive) (DriveTypeFlags(iDrive) & DRIVE_AUTORUN)
  305. #define DriveIsAutoOpen(iDrive) (DriveTypeFlags(iDrive) & DRIVE_AUTOOPEN)
  306. #define DriveIsShellOpen(iDrive) (DriveTypeFlags(iDrive) & DRIVE_SHELLOPEN)
  307. #define DriveIsAudioCD(iDrive) (DriveTypeFlags(iDrive) & DRIVE_AUDIOCD)
  308. #define DriveIsNetUnAvail(iDrive) (DriveTypeFlags(iDrive) & DRIVE_NETUNAVAIL)
  309. #define IsCDRomDrive(iDrive) (DriveType(iDrive) == DRIVE_CDROM)
  310. #define IsRamDrive(iDrive) (DriveType(iDrive) == DRIVE_RAMDRIVE)
  311. #define IsRemovableDrive(iDrive) (DriveType(iDrive) == DRIVE_REMOVABLE)
  312. #define IsRemoteDrive(iDrive) (DriveType(iDrive) == DRIVE_REMOTE)
  313. // should be moved to shell32s private include files
  314. WINSHELLAPI int WINAPI GetDefaultDrive();
  315. WINSHELLAPI int WINAPI SetDefaultDrive(int iDrive);
  316. WINSHELLAPI int WINAPI SetDefaultDirectory(LPCSTR lpPath);
  317. WINSHELLAPI void WINAPI GetDefaultDirectory(int iDrive, LPSTR lpPath);
  318. #define POSINVALID 32767 // values for invalid position
  319. #define IDCMD_SYSTEMFIRST 0x8000
  320. #define IDCMD_SYSTEMLAST 0xbfff
  321. #define IDCMD_CANCELED 0xbfff
  322. #define IDCMD_PROCESSED 0xbffe
  323. #define IDCMD_DEFAULT 0xbffe
  324. //====== SEMI-PRIVATE API ===============================
  325. DECLARE_HANDLE( HPSXA );
  326. WINSHELLAPI HPSXA SHCreatePropSheetExtArray( HKEY hKey, PCSTR pszSubKey, UINT max_iface );
  327. WINSHELLAPI void SHDestroyPropSheetExtArray( HPSXA hpsxa );
  328. WINSHELLAPI UINT SHAddFromPropSheetExtArray( HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam );
  329. WINSHELLAPI UINT SHReplaceFromPropSheetExtArray( HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam );
  330. //====== SEMI-PRIVATE API ORDINALS ===============================
  331. // This is the list of semi-private ordinals we semi-publish.
  332. #define SHAddFromPropSheetExtArrayORD 167
  333. #define SHCreatePropSheetExtArrayORD 168
  334. #define SHDestroyPropSheetExtArrayORD 169
  335. #define SHReplaceFromPropSheetExtArrayORD 170
  336. #define SHCreateDefClassObjectORD 70
  337. #define SHGetNetResourceORD 69
  338. #define SHEXP_SHADDFROMPROPSHEETEXTARRAY MAKEINTRESOURCE(SHAddFromPropSheetExtArrayORD)
  339. #define SHEXP_SHCREATEPROPSHEETEXTARRAY MAKEINTRESOURCE(SHCreatePropSheetExtArrayORD)
  340. #define SHEXP_SHDESTROYPROPSHEETEXTARRAY MAKEINTRESOURCE(SHDestroyPropSheetExtArrayORD)
  341. #define SHEXP_SHREPLACEFROMPROPSHEETEXTARRAY MAKEINTRESOURCE(SHReplaceFromPropSheetExtArrayORD)
  342. #define SHEXP_SHCREATEDEFCLASSOBJECT MAKEINTRESOURCE(SHCreateDefClassObjectORD)
  343. #define SHEXP_SHGETNETRESOURCE MAKEINTRESOURCE(SHGetNetResourceORD)
  344. /*
  345. * The SHFormatDrive API provides access to the Shell
  346. * format dialog. This allows apps which want to format disks
  347. * to bring up the same dialog that the Shell does to do it.
  348. *
  349. * This dialog is not sub-classable. You cannot put custom
  350. * controls in it. If you want this ability, you will have
  351. * to write your own front end for the DMaint_FormatDrive
  352. * engine.
  353. *
  354. * NOTE that the user can format as many diskettes in the specified
  355. * drive, or as many times, as he/she wishes to. There is no way to
  356. * force any specififc number of disks to format. If you want this
  357. * ability, you will have to write your own front end for the
  358. * DMaint_FormatDrive engine.
  359. *
  360. * NOTE also that the format will not start till the user pushes the
  361. * start button in the dialog. There is no way to do auto start. If
  362. * you want this ability, you will have to write your own front end
  363. * for the DMaint_FormatDrive engine.
  364. *
  365. * PARAMETERS
  366. *
  367. * hwnd = The window handle of the window which will own the dialog
  368. * NOTE that unlike SHCheckDrive, hwnd == NULL does not cause
  369. * this dialog to come up as a "top level application" window.
  370. * This parameter should always be non-null, this dialog is
  371. * only designed to be the child of another window, not a
  372. * stand-alone application.
  373. * drive = The 0 based (A: == 0) drive number of the drive to format
  374. * fmtID = The ID of the physical format to format the disk with
  375. * NOTE: The special value SHFMT_ID_DEFAULT means "use the
  376. * default format specified by the DMaint_FormatDrive
  377. * engine". If you want to FORCE a particular format
  378. * ID "up front" you will have to call
  379. * DMaint_GetFormatOptions yourself before calling
  380. * this to obtain the valid list of phys format IDs
  381. * (contents of the PhysFmtIDList array in the
  382. * FMTINFOSTRUCT).
  383. * options = There is currently only two option bits defined
  384. *
  385. * SHFMT_OPT_FULL
  386. * SHFMT_OPT_SYSONLY
  387. *
  388. * The normal defualt in the Shell format dialog is
  389. * "Quick Format", setting this option bit indicates that
  390. * the caller wants to start with FULL format selected
  391. * (this is useful for folks detecting "unformatted" disks
  392. * and wanting to bring up the format dialog).
  393. *
  394. * The SHFMT_OPT_SYSONLY initializes the dialog to
  395. * default to just sys the disk.
  396. *
  397. * All other bits are reserved for future expansion and
  398. * must be 0.
  399. *
  400. * Please note that this is a bit field and not a value
  401. * and treat it accordingly.
  402. *
  403. * RETURN
  404. * The return is either one of the SHFMT_* values, or if the
  405. * returned DWORD value is not == to one of these values, then
  406. * the return is the physical format ID of the last succesful
  407. * format. The LOWORD of this value can be passed on subsequent
  408. * calls as the fmtID parameter to "format the same type you did
  409. * last time".
  410. *
  411. */
  412. DWORD WINAPI SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options);
  413. //
  414. // Special value of fmtID which means "use the default format"
  415. //
  416. #define SHFMT_ID_DEFAULT 0xFFFF
  417. //
  418. // Option bits for options parameter
  419. //
  420. #define SHFMT_OPT_FULL 0x0001
  421. #define SHFMT_OPT_SYSONLY 0x0002
  422. //
  423. // Special return values. PLEASE NOTE that these are DWORD values.
  424. //
  425. #define SHFMT_ERROR 0xFFFFFFFFL // Error on last format, drive may be formatable
  426. #define SHFMT_CANCEL 0xFFFFFFFEL // Last format was canceled
  427. #define SHFMT_NOFORMAT 0xFFFFFFFDL // Drive is not formatable
  428. #ifdef __cplusplus
  429. }
  430. #endif /* __cplusplus */
  431. #ifndef RC_INVOKED
  432. #pragma pack()
  433. #endif /* !RC_INVOKED */
  434. #endif // _SHSEMIP_H_