Windows NT 4.0 source code leak
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.

916 lines
37 KiB

4 years ago
  1. #ifndef _SHSEMIP_H_
  2. #define _SHSEMIP_H_
  3. #if (defined(UNICODE) && (defined(_MIPS_) || defined(_ALPHA_) || defined(_PPC_)))
  4. #define ALIGNMENT_SCENARIO
  5. #endif
  6. typedef UNALIGNED const WCHAR * LPNCWSTR;
  7. typedef UNALIGNED WCHAR * LPNWSTR;
  8. #ifdef UNICODE
  9. #define LPNCTSTR LPNCWSTR
  10. #define LPNTSTR LPNWSTR
  11. #else
  12. #define LPNCTSTR LPCSTR
  13. #define LPNTSTR LPSTR
  14. #endif
  15. //
  16. // Define API decoration for direct importing of DLL references.
  17. //
  18. #ifndef WINSHELLAPI
  19. #if !defined(_SHELL32_) && defined(_WIN32)
  20. #define WINSHELLAPI DECLSPEC_IMPORT
  21. #else
  22. #define WINSHELLAPI
  23. #endif
  24. #endif // WINSHELLAPI
  25. #ifndef RC_INVOKED
  26. #pragma pack(1) /* Assume byte packing throughout */
  27. #endif /* !RC_INVOKED */
  28. #ifdef __cplusplus
  29. extern "C" { /* Assume C declarations for C++ */
  30. #endif /* __cplusplus */
  31. #ifndef DONT_WANT_SHELLDEBUG
  32. #ifndef DebugMsg /* ;Internal */
  33. #define DM_TRACE 0x0001 // Trace messages /* ;Internal */
  34. #define DM_WARNING 0x0002 // Warning /* ;Internal */
  35. #define DM_ERROR 0x0004 // Error /* ;Internal */
  36. #define DM_ASSERT 0x0008 // Assertions /* ;Internal */
  37. #define Assert(f) /* ;Internal */
  38. #define AssertE(f) (f) /* ;Internal */
  39. #define AssertMsg 1 ? (void)0 : (void) /* ;Internal */
  40. #define DebugMsg 1 ? (void)0 : (void) /* ;Internal */
  41. #endif /* ;Internal */
  42. /* ;Internal */
  43. #endif
  44. #ifdef _WIN32
  45. //====== Ranges for WM_NOTIFY codes ==================================
  46. // If a new set of codes is defined, make sure the range goes /* ;Internal */
  47. // here so that we can keep them distinct /* ;Internal */
  48. // Note that these are defined to be unsigned to avoid compiler warnings
  49. // since NMHDR.code is declared as UINT.
  50. //
  51. // NM_FIRST - NM_LAST defined in commctrl.h (0U-0U) - (OU-99U)
  52. //
  53. // LVN_FIRST - LVN_LAST defined in commctrl.h (0U-100U) - (OU-199U)
  54. //
  55. // PSN_FIRST - PSN_LAST defined in prsht.h (0U-200U) - (0U-299U)
  56. //
  57. // HDN_FIRST - HDN_LAST defined in commctrl.h (0U-300U) - (OU-399U)
  58. //
  59. // TVN_FIRST - TVN_LAST defined in commctrl.h (0U-400U) - (OU-499U)
  60. // TTN_FIRST - TTN_LAST defined in commctrl.h (0U-520U) - (OU-549U)
  61. #define RFN_FIRST (0U-510U) // run file dialog notify
  62. #define RFN_LAST (0U-519U)
  63. #define SEN_FIRST (0U-550U) // ;Internal
  64. #define SEN_LAST (0U-559U) // ;Internal
  65. #define MAXPATHLEN MAX_PATH // ;Internal
  66. //===========================================================================
  67. // ITEMIDLIST
  68. //===========================================================================
  69. WINSHELLAPI LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl);
  70. WINSHELLAPI UINT WINAPI ILGetSize(LPCITEMIDLIST pidl);
  71. WINSHELLAPI LPITEMIDLIST WINAPI ILCreate(void);
  72. WINSHELLAPI LPITEMIDLIST WINAPI ILAppendID(LPITEMIDLIST pidl, LPCSHITEMID pmkid, BOOL fAppend);
  73. WINSHELLAPI void WINAPI ILFree(LPITEMIDLIST pidl);
  74. WINSHELLAPI void WINAPI ILGlobalFree(LPITEMIDLIST pidl);
  75. WINSHELLAPI LPITEMIDLIST WINAPI ILCreateFromPath(LPCTSTR szPath);
  76. WINSHELLAPI BOOL WINAPI ILGetDisplayName(LPCITEMIDLIST pidl, LPTSTR pszName);
  77. WINSHELLAPI LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl);
  78. WINSHELLAPI BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl);
  79. WINSHELLAPI LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl);
  80. WINSHELLAPI LPITEMIDLIST WINAPI ILCloneFirst(LPCITEMIDLIST pidl);
  81. WINSHELLAPI LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl);
  82. WINSHELLAPI BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  83. WINSHELLAPI BOOL WINAPI ILIsEqualItemID(LPCSHITEMID pmkid1, LPCSHITEMID pmkid2);
  84. WINSHELLAPI BOOL WINAPI ILIsParent(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, BOOL fImmediate);
  85. WINSHELLAPI LPITEMIDLIST WINAPI ILFindChild(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild);
  86. WINSHELLAPI LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  87. WINSHELLAPI HRESULT WINAPI ILLoadFromStream(LPSTREAM pstm, LPITEMIDLIST *pidl);
  88. WINSHELLAPI HRESULT WINAPI ILSaveToStream(LPSTREAM pstm, LPCITEMIDLIST pidl);
  89. WINSHELLAPI HRESULT WINAPI ILLoadFromFile(HFILE hfile, LPITEMIDLIST *pidl);
  90. WINSHELLAPI HRESULT WINAPI ILSaveToFile(HFILE hfile, LPCITEMIDLIST pidl);
  91. WINSHELLAPI LPITEMIDLIST WINAPI _ILCreate(UINT cbSize);
  92. WINSHELLAPI HRESULT WINAPI SHILCreateFromPath(LPCTSTR szPath, LPITEMIDLIST *ppidl, DWORD *rgfInOut);
  93. // helper macros
  94. #define ILIsEmpty(pidl) ((pidl)->mkid.cb==0)
  95. #define IsEqualItemID(pmkid1, pmkid2) (memcmp(pmkid1, pmkid2, (pmkid1)->cb)==0)
  96. #define ILCreateFromID(pmkid) ILAppendID(NULL, pmkid, TRUE)
  97. // unsafe macros
  98. #define _ILSkip(pidl, cb) ((LPITEMIDLIST)(((BYTE*)(pidl))+cb))
  99. #define _ILNext(pidl) _ILSkip(pidl, (pidl)->mkid.cb)
  100. /*
  101. * The SHObjectProperties API provides an easy way to invoke
  102. * the Properties context menu command on shell objects.
  103. *
  104. * PARAMETERS
  105. *
  106. * hwndOwner The window handle of the window which will own the dialog
  107. * dwType A SHOP_ value as defined below
  108. * lpObject Name of the object, see SHOP_ values below
  109. * lpPage The name of the property sheet page to open to or NULL.
  110. *
  111. * RETURN
  112. *
  113. * TRUE if the Properties command was invoked
  114. */
  115. WINSHELLAPI BOOL WINAPI SHObjectProperties(HWND hwndOwner, DWORD dwType, LPCTSTR lpObject, LPCTSTR lpPage);
  116. #define SHOP_PRINTERNAME 1 // lpObject points to a printer friendly name
  117. #define SHOP_FILEPATH 2 // lpObject points to a fully qualified path+file name
  118. #define SHOP_TYPEMASK 0x00000003
  119. #define SHOP_MODAL 0x80000000
  120. //====== ShellMessageBox ================================================
  121. // If lpcTitle is NULL, the title is taken from hWnd
  122. // If lpcText is NULL, this is assumed to be an Out Of Memory message
  123. // If the selector of lpcTitle or lpcText is NULL, the offset should be a
  124. // string resource ID
  125. // The variable arguments must all be 32-bit values (even if fewer bits
  126. // are actually used)
  127. // lpcText (or whatever string resource it causes to be loaded) should
  128. // be a formatting string similar to wsprintf except that only the
  129. // following formats are available:
  130. // %% formats to a single '%'
  131. // %nn%s the nn-th arg is a string which is inserted
  132. // %nn%ld the nn-th arg is a DWORD, and formatted decimal
  133. // %nn%lx the nn-th arg is a DWORD, and formatted hex
  134. // note that lengths are allowed on the %s, %ld, and %lx, just
  135. // like wsprintf /* ;Internal */
  136. //
  137. int FAR _cdecl ShellMessageBoxA(HINSTANCE hAppInst, HWND hWnd, LPCSTR
  138. lpcText, LPCSTR lpcTitle, UINT fuStyle, ...);
  139. int FAR _cdecl ShellMessageBoxW(HINSTANCE hAppInst, HWND hWnd, LPCWSTR
  140. lpcText, LPCWSTR lpcTitle, UINT fuStyle, ...);
  141. #ifdef UNICODE
  142. #define ShellMessageBox ShellMessageBoxW
  143. #else
  144. #define ShellMessageBox ShellMessageBoxA
  145. #endif
  146. //===================================================================
  147. // Smart tiling API's
  148. WINSHELLAPI WORD WINAPI ArrangeWindows(HWND hwndParent, WORD flags, LPCRECT lpRect, WORD chwnd, const HWND FAR *ahwnd);
  149. //
  150. // Flags for SHGetSetSettings
  151. //
  152. typedef struct {
  153. BOOL fShowAllObjects : 1;
  154. BOOL fShowExtensions : 1;
  155. BOOL fNoConfirmRecycle : 1;
  156. BOOL fShowCompColor : 1;
  157. UINT fRestFlags : 13;
  158. LPSTR pszHiddenFileExts;
  159. UINT cbHiddenFileExts;
  160. } SHELLSTATEA, * LPSHELLSTATEA;
  161. typedef struct {
  162. BOOL fShowAllObjects : 1;
  163. BOOL fShowExtensions : 1;
  164. BOOL fNoConfirmRecycle : 1;
  165. BOOL fShowCompColor : 1;
  166. UINT fRestFlags : 13;
  167. LPWSTR pszHiddenFileExts;
  168. UINT cbHiddenFileExts;
  169. } SHELLSTATEW, * LPSHELLSTATEW;
  170. #ifdef UNICODE
  171. #define SHELLSTATE SHELLSTATEW
  172. #define LPSHELLSTATE LPSHELLSTATEW
  173. #else
  174. #define SHELLSTATE SHELLSTATEA
  175. #define LPSHELLSTATE LPSHELLSTATEA
  176. #endif
  177. #define SSF_SHOWALLOBJECTS 0x0001
  178. #define SSF_SHOWEXTENSIONS 0x0002
  179. #define SSF_HIDDENFILEEXTS 0x0004
  180. #define SSF_SHOWCOMPCOLOR 0x0008
  181. #define SSF_NOCONFIRMRECYCLE 0x8000
  182. //
  183. // for SHGetNetResource
  184. //
  185. typedef HANDLE HNRES;
  186. //
  187. // For SHCreateDefClassObject
  188. //
  189. typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject);
  190. #endif // _WIN32
  191. typedef void (WINAPI FAR* RUNDLLPROCA)(HWND hwndStub,
  192. HINSTANCE hAppInstance,
  193. LPSTR lpszCmdLine, int nCmdShow);
  194. typedef void (WINAPI FAR* RUNDLLPROCW)(HWND hwndStub,
  195. HINSTANCE hAppInstance,
  196. LPWSTR lpszCmdLine, int nCmdShow);
  197. #ifdef UNICODE
  198. #define RUNDLLPROC RUNDLLPROCW
  199. #else
  200. #define RUNDLLPROC RUNDLLPROCA
  201. #endif
  202. //=======================================================================
  203. // String constants for
  204. // 1. Registration database keywords (prefix STRREG_)
  205. // 2. Exported functions from handler dlls (prefix STREXP_)
  206. // 3. .INI file keywords (prefix STRINI_)
  207. // 4. Others (prefix STR_)
  208. //=======================================================================
  209. #define STRREG_SHELLUI TEXT("ShellUIHandler")
  210. #define STRREG_SHELL TEXT("Shell")
  211. #define STRREG_DEFICON TEXT("DefaultIcon")
  212. #define STRREG_SHEX TEXT("shellex")
  213. #define STRREG_SHEX_PROPSHEET STRREG_SHEX TEXT("\\PropertySheetHandlers")
  214. #define STRREG_SHEX_DDHANDLER STRREG_SHEX TEXT("\\DragDropHandlers")
  215. #define STRREG_SHEX_MENUHANDLER STRREG_SHEX TEXT("\\ContextMenuHandlers")
  216. #define STRREG_SHEX_COPYHOOK TEXT("Directory\\") STRREG_SHEX TEXT("\\CopyHookHandlers")
  217. #define STRREG_SHEX_PRNCOPYHOOK TEXT("Printers\\") STRREG_SHEX TEXT("\\CopyHookHandlers")
  218. #define STREXP_CANUNLOAD "DllCanUnloadNow" // From OLE 2.0
  219. #define STRINI_CLASSINFO TEXT(".ShellClassInfo") // secton name
  220. #define STRINI_SHELLUI TEXT("ShellUIHandler")
  221. #define STRINI_OPENDIRICON TEXT("OpenDirIcon")
  222. #define STRINI_DIRICON TEXT("DirIcon")
  223. #define STR_DESKTOPINI TEXT("desktop.ini")
  224. #define STR_DESKTOPINIA "desktop.ini"
  225. // Maximum length of a path string
  226. #define CCHPATHMAX MAX_PATH
  227. #define MAXSPECLEN MAX_PATH
  228. #define DRIVEID(path) ((path[0] - 'A') & 31)
  229. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  230. #define SIZEOF(a) sizeof(a)
  231. #define PATH_CCH_EXT 64
  232. // PathResolve flags
  233. #define PRF_VERIFYEXISTS 0x0001
  234. #define PRF_TRYPROGRAMEXTENSIONS (0x0002 | PRF_VERIFYEXISTS)
  235. #define PRF_FIRSTDIRDEF 0x0004
  236. #define PRF_DONTFINDLNK 0x0008 // if PRF_TRYPROGRAMEXTENSIONS is specified
  237. // General flag macros
  238. #define SetFlag(obj, f) do {obj |= (f);} while (0)
  239. #define ToggleFlag(obj, f) do {obj ^= (f);} while (0)
  240. #define ClearFlag(obj, f) do {obj &= ~(f);} while (0)
  241. #define IsFlagSet(obj, f) (BOOL)(((obj) & (f)) == (f))
  242. #define IsFlagClear(obj, f) (BOOL)(((obj) & (f)) != (f))
  243. //
  244. // For CallCPLEntry16
  245. //
  246. DECLARE_HANDLE(FARPROC16);
  247. // Needed for RunFileDlg
  248. #define RFD_NOBROWSE 0x00000001
  249. #define RFD_NODEFFILE 0x00000002
  250. #define RFD_USEFULLPATHDIR 0x00000004
  251. #define RFD_NOSHOWOPEN 0x00000008
  252. #define RFD_WOW_APP 0x00000010
  253. #define RFD_NOSEPMEMORY_BOX 0x00000020
  254. #ifdef RFN_FIRST
  255. #define RFN_EXECUTE (RFN_FIRST - 0)
  256. typedef struct {
  257. NMHDR hdr;
  258. LPCTSTR lpszCmd;
  259. LPCTSTR lpszWorkingDir;
  260. int nShowCmd;
  261. } NMRUNFILEA, FAR *LPNMRUNFILEA;
  262. typedef struct {
  263. NMHDR hdr;
  264. LPCWSTR lpszCmd;
  265. LPCWSTR lpszWorkingDir;
  266. int nShowCmd;
  267. } NMRUNFILEW, FAR *LPNMRUNFILEW;
  268. #ifdef UNICODE
  269. #define NMRUNFILE NMRUNFILEW
  270. #define LPNMRUNFILE LPNMRUNFILEW
  271. #else
  272. #define NMRUNFILE NMRUNFILEA
  273. #define LPNMRUNFILE LPNMRUNFILEA
  274. #endif
  275. #endif
  276. typedef struct _DRAGINFOA {
  277. UINT uSize; /* init with sizeof(DRAGINFO) */
  278. POINT pt;
  279. BOOL fNC;
  280. LPSTR lpFileList;
  281. DWORD grfKeyState;
  282. } DRAGINFOA, FAR* LPDRAGINFOA;
  283. typedef struct _DRAGINFOW {
  284. UINT uSize; /* init with sizeof(DRAGINFO) */
  285. POINT pt;
  286. BOOL fNC;
  287. LPWSTR lpFileList;
  288. DWORD grfKeyState;
  289. } DRAGINFOW, FAR* LPDRAGINFOW;
  290. #ifdef UNICODE
  291. typedef DRAGINFOW DRAGINFO;
  292. typedef LPDRAGINFOW LPDRAGINFO;
  293. #else
  294. typedef DRAGINFOA DRAGINFO;
  295. typedef LPDRAGINFOA LPDRAGINFO;
  296. #endif // UNICODE
  297. // RUN FILE RETURN values from notify message
  298. #define RFR_NOTHANDLED 0
  299. #define RFR_SUCCESS 1
  300. #define RFR_FAILURE 2
  301. #ifdef _WIN32
  302. #define PathRemoveBlanksORD 33
  303. #define PathFindFileNameORD 34
  304. #define PathGetExtensionORD 158
  305. #define PathFindExtensionORD 31
  306. WINSHELLAPI LPTSTR WINAPI PathAddBackslash(LPTSTR lpszPath);
  307. WINSHELLAPI void WINAPI PathRemoveBlanks(LPTSTR lpszString);
  308. WINSHELLAPI BOOL WINAPI PathRemoveFileSpec(LPTSTR lpszPath);
  309. WINSHELLAPI LPTSTR WINAPI PathFindFileName(LPCTSTR pPath);
  310. WINSHELLAPI LPNTSTR WINAPI uaPathFindFileName(LPNCTSTR pPath);
  311. WINSHELLAPI BOOL WINAPI PathIsRoot(LPCTSTR lpszPath);
  312. WINSHELLAPI BOOL WINAPI PathIsRelative(LPNCTSTR lpszPath);
  313. WINSHELLAPI BOOL WINAPI PathIsUNC(LPNCTSTR lpsz);
  314. WINSHELLAPI BOOL WINAPI PathIsDirectory(LPCTSTR lpszPath);
  315. WINSHELLAPI BOOL WINAPI PathIsExe(LPCTSTR lpszPath);
  316. WINSHELLAPI int WINAPI PathGetDriveNumber(LPNCTSTR lpszPath);
  317. WINSHELLAPI LPTSTR WINAPI PathCombine(LPTSTR szDest, LPCTSTR lpszDir, LPNCTSTR lpszFile);
  318. WINSHELLAPI BOOL WINAPI PathAppend(LPTSTR pPath, LPNCTSTR pMore);
  319. WINSHELLAPI LPNTSTR WINAPI PathBuildRoot(LPNTSTR szRoot, int iDrive);
  320. WINSHELLAPI int WINAPI PathCommonPrefix(LPCTSTR pszFile1, LPCTSTR pszFile2, LPTSTR achPath);
  321. WINSHELLAPI LPTSTR WINAPI PathGetExtension(LPCTSTR lpszPath, LPTSTR lpszExtension, int cchExt);
  322. WINSHELLAPI BOOL PathStripToRoot(LPTSTR szRoot);
  323. WINSHELLAPI void PathStripPath(LPTSTR lpszPath);
  324. WINSHELLAPI int PathParseIconLocation(LPTSTR lpszPath);
  325. //
  326. //BUGBUG Need the 'A' version of this exported for AppWiz until it runs Unicode
  327. //
  328. WINSHELLAPI LPTSTR WINAPI PathFindExtension(LPCTSTR pszPath);
  329. WINSHELLAPI BOOL WINAPI PathCompactPath(HDC hDC, LPTSTR lpszPath, UINT dx);
  330. WINSHELLAPI BOOL WINAPI PathFileExists(LPCTSTR lpszPath);
  331. WINSHELLAPI BOOL WINAPI PathMatchSpec(LPCTSTR pszFile, LPCTSTR pszSpec);
  332. WINSHELLAPI BOOL WINAPI PathMakeUniqueName(LPTSTR pszUniqueName, UINT cchMax, LPCTSTR pszTemplate, LPCTSTR pszLongPlate, LPCTSTR pszDir);
  333. WINSHELLAPI LPTSTR WINAPI PathGetArgs(LPCTSTR pszPath);
  334. WINSHELLAPI BOOL WINAPI PathGetShortName(LPCTSTR lpszLongName, LPTSTR lpszShortName, UINT cbShortName);
  335. WINSHELLAPI BOOL WINAPI PathGetLongName(LPCTSTR lpszShortName, LPTSTR lpszLongName, UINT cbLongName);
  336. WINSHELLAPI void WINAPI PathQuoteSpaces(LPTSTR lpsz);
  337. WINSHELLAPI void WINAPI PathUnquoteSpaces(LPTSTR lpsz);
  338. WINSHELLAPI BOOL WINAPI PathDirectoryExists(LPCTSTR lpszDir);
  339. WINSHELLAPI void WINAPI PathQualify(LPTSTR lpsz);
  340. WINSHELLAPI int WINAPI PathResolve(LPTSTR lpszPath, LPCTSTR FAR dirs[], UINT fFlags);
  341. WINSHELLAPI LPTSTR WINAPI PathGetNextComponent(LPCTSTR lpszPath, LPTSTR lpszComponent);
  342. WINSHELLAPI LPTSTR WINAPI PathFindNextComponent(LPCTSTR lpszPath);
  343. WINSHELLAPI BOOL WINAPI PathIsSameRoot(LPCTSTR pszPath1, LPCTSTR pszPath2);
  344. WINSHELLAPI void WINAPI PathSetDlgItemPath(HWND hDlg, int id, LPCTSTR pszPath);
  345. WINSHELLAPI BOOL WINAPI ParseField(LPCTSTR szData, int n, LPTSTR szBuf, int iBufLen);
  346. int WINAPI PathCleanupSpec(LPCTSTR pszDir, LPTSTR pszSpec);
  347. //
  348. // Return codes from PathCleanupSpec. Negative return values are
  349. // unrecoverable errors
  350. //
  351. #define PCS_FATAL 0x80000000
  352. #define PCS_REPLACEDCHAR 0x00000001
  353. #define PCS_REMOVEDCHAR 0x00000002
  354. #define PCS_TRUNCATED 0x00000004
  355. #define PCS_PATHTOOLONG 0x00000008 // Always combined with FATAL
  356. WINSHELLAPI int WINAPI RestartDialog(HWND hwnd, LPCTSTR lpPrompt, DWORD dwReturn);
  357. WINSHELLAPI void WINAPI ExitWindowsDialog(HWND hwnd);
  358. WINSHELLAPI int WINAPI RunFileDlg(HWND hwndParent, HICON hIcon, LPCTSTR lpszWorkingDir, LPCTSTR lpszTitle,
  359. LPCTSTR lpszPrompt, DWORD dwFlags);
  360. WINSHELLAPI int WINAPI PickIconDlg(HWND hwnd, LPTSTR pszIconPath, UINT cbIconPath, int FAR *piIconIndex);
  361. WINSHELLAPI BOOL WINAPI GetFileNameFromBrowse(HWND hwnd, LPTSTR szFilePath, UINT cbFilePath, LPCTSTR szWorkingDir, LPCTSTR szDefExt, LPCTSTR szFilters, LPCTSTR szTitle);
  362. WINSHELLAPI int WINAPI DriveType(int iDrive);
  363. WINSHELLAPI int WINAPI RealDriveTypeFlags(int iDrive, BOOL fOKToHitNet);
  364. WINSHELLAPI int WINAPI RealDriveType(int iDrive, BOOL fOKToHitNet);
  365. WINSHELLAPI void WINAPI InvalidateDriveType(int iDrive);
  366. WINSHELLAPI int WINAPI IsNetDrive(int iDrive);
  367. WINSHELLAPI BOOL WINAPI DragQueryInfo(HDROP hDrop, LPDRAGINFO lpdi);
  368. WINSHELLAPI UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags);
  369. WINSHELLAPI void WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet);
  370. WINSHELLAPI LRESULT WINAPI SHRenameFile(HWND hwndParent, LPCTSTR pszDir, LPCTSTR pszOldName, LPCTSTR pszNewName, BOOL bRetainExtension);
  371. WINSHELLAPI UINT WINAPI SHGetNetResource(HNRES hnres, UINT iItem, LPNETRESOURCE pnres, UINT cbMax);
  372. WINSHELLAPI STDAPI SHCreateDefClassObject(REFIID riid, LPVOID FAR* ppv, LPFNCREATEINSTANCE lpfn, UINT FAR * pcRefDll, REFIID riidInstance);
  373. WINSHELLAPI LRESULT WINAPI CallCPLEntry16(HINSTANCE hinst, FARPROC16 lpfnEntry, HWND hwndCPL, UINT msg, DWORD lParam1, DWORD lParam2);
  374. WINSHELLAPI BOOL WINAPI SHRunControlPanel(LPCTSTR lpcszCmdLine, HWND hwndMsgParent);
  375. WINSHELLAPI STDAPI SHCLSIDFromString(LPCTSTR lpsz, LPCLSID lpclsid);
  376. #ifdef WINNT
  377. WINSHELLAPI INT WINAPI LargeIntegerToString(LARGE_INTEGER *pN, LPTSTR szOutStr, UINT nSize, BOOL bFormat, NUMBERFMT *pFmt, DWORD dwNumFmtFlags);
  378. WINSHELLAPI INT WINAPI Int64ToString(_int64 n, LPTSTR szOutStr, UINT nSize, BOOL bFormat, NUMBERFMT *pFmt, DWORD dwNumFmtFlags);
  379. //
  380. // Constants used for dwNumFmtFlags argument in Int64ToString and LargeIntegerToString.
  381. //
  382. #define NUMFMT_IDIGITS 0x00000001
  383. #define NUMFMT_ILZERO 0x00000002
  384. #define NUMFMT_SGROUPING 0x00000004
  385. #define NUMFMT_SDECIMAL 0x00000008
  386. #define NUMFMT_STHOUSAND 0x00000010
  387. #define NUMFMT_INEGNUMBER 0x00000020
  388. #define NUMFMT_ALL 0xFFFFFFFF
  389. #endif
  390. #define SHObjectPropertiesORD 178
  391. WINSHELLAPI BOOL WINAPI SHObjectProperties(HWND hwndOwner, DWORD dwType, LPCTSTR lpObject, LPCTSTR lpPage);
  392. #else // _WIN32
  393. WINSHELLAPI int WINAPI DriveType(int iDrive);
  394. WINSHELLAPI int WINAPI RestartDialog(HWND hwnd, LPCTSTR lpPrompt, DWORD dwReturn);
  395. WINSHELLAPI int WINAPI PickIconDlg(HWND hwnd, LPSTR pszIconPath, UINT cbIconPath, int FAR *piIconIndex);
  396. #endif // _WIN32
  397. //===================================================================
  398. // Shell_MergeMenu parameter
  399. //
  400. #define MM_ADDSEPARATOR 0x00000001L
  401. #define MM_SUBMENUSHAVEIDS 0x00000002L
  402. //-------- drive type identification --------------
  403. // iDrive drive index (0=A, 1=B, ...)
  404. //
  405. #define DRIVE_CDROM 5 // extended DriveType() types
  406. #define DRIVE_RAMDRIVE 6
  407. #define DRIVE_TYPE 0x000F // type masek
  408. #define DRIVE_SLOW 0x0010 // drive is on a slow link
  409. #define DRIVE_LFN 0x0020 // drive supports LFNs
  410. #define DRIVE_AUTORUN 0x0040 // drive has AutoRun.inf in root.
  411. #define DRIVE_AUDIOCD 0x0080 // drive is a AudioCD
  412. #define DRIVE_AUTOOPEN 0x0100 // should *always* auto open on insert
  413. #define DRIVE_NETUNAVAIL 0x0200 // Network drive that is not available
  414. #define DRIVE_SHELLOPEN 0x0400 // should auto open on insert, if shell has focus
  415. #define DRIVE_SECURITY 0x0800 // Supports ACLs
  416. #define DRIVE_COMPRESSED 0x1000 // Root of volume is compressed
  417. #define DRIVE_ISCOMPRESSIBLE 0x2000 // Drive supports compression (not nescesarrily compressed)
  418. #define DriveTypeFlags(iDrive) DriveType('A' + (iDrive))
  419. #define DriveIsSlow(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_SLOW)
  420. #define DriveIsLFN(iDrive) (RealDriveTypeFlags(iDrive, TRUE) & DRIVE_LFN)
  421. #define DriveIsAutoRun(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_AUTORUN)
  422. #define DriveIsAutoOpen(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_AUTOOPEN)
  423. #define DriveIsShellOpen(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_SHELLOPEN)
  424. #define DriveIsAudioCD(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_AUDIOCD)
  425. #define DriveIsNetUnAvail(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_NETUNAVAIL)
  426. #define DriveIsSecure(iDrive) (RealDriveTypeFlags(iDrive, TRUE) & DRIVE_SECURITY)
  427. #define DriveIsCompressed(iDrive) (RealDriveTypeFlags(iDrive, TRUE) & DRIVE_COMPRESSED)
  428. #define DriveIsCompressible(iDrive) (RealDriveTypeFlags(iDrive, TRUE) & DRIVE_ISCOMPRESSIBLE)
  429. #define IsCDRomDrive(iDrive) (RealDriveType(iDrive, FALSE) == DRIVE_CDROM)
  430. #define IsRamDrive(iDrive) (RealDriveType(iDrive, FALSE) == DRIVE_RAMDRIVE)
  431. #define IsRemovableDrive(iDrive) (RealDriveType(iDrive, FALSE) == DRIVE_REMOVABLE)
  432. #define IsRemoteDrive(iDrive) (RealDriveType(iDrive, FALSE) == DRIVE_REMOTE)
  433. //-------- file engine stuff ----------
  434. // "current directory" management routines. used to set parameters
  435. // that paths are qualfied against in MoveCopyDeleteRename()
  436. WINSHELLAPI int WINAPI GetDefaultDrive();
  437. WINSHELLAPI int WINAPI SetDefaultDrive(int iDrive);
  438. WINSHELLAPI int WINAPI SetDefaultDirectory(LPCTSTR lpPath);
  439. WINSHELLAPI void WINAPI GetDefaultDirectory(int iDrive, LPSTR lpPath);
  440. typedef enum {
  441. PARSEFILENAME_QUALIFY = 1,
  442. } PARSEFILENAME_FLAGS;
  443. // this parses a list of file names (like you'd get from an edit control)
  444. // into a double null terminated list appropriate for passing to the file
  445. // engine or drag/drop. this accounts for excape sequences and strings
  446. // in quotes
  447. WINSHELLAPI LPSTR WINAPI ParseFilenames(LPCTSTR lpNames, PARSEFILENAME_FLAGS fFlags);
  448. // this can be used to walk through a string of file names, dealing with
  449. // seperators and escapes
  450. WINSHELLAPI LPSTR WINAPI GetNextFile(LPCTSTR pFrom, LPSTR pTo, int cbMax);
  451. // this message is sent to the progress dialog supplied by the caller
  452. // (if FUNC_CREATEPROGRESSDLG is NOT set). this lets the caller cancel
  453. // the current operation.
  454. // wParam: unused
  455. // lParam: is BOOL FAR * to be filled in with TRUE if user has
  456. // canceled, FALSE otherwise
  457. #define WM_QUERYABORT (WM_APP + 1)
  458. //
  459. // NOTES: No reason to have this one here, but I don't want to break the build.
  460. //
  461. #ifndef WINCOMMCTRLAPI
  462. int WINAPI StrToInt(LPCTSTR lpSrc); // atoi()
  463. #endif
  464. //====== NEW APIS (TEMPORARILY DEFINED HERE; SHOULD BE MOVED TO USER)
  465. #define LINK_MAX_LENGTH 260
  466. #define POSINVALID 32767 // values for invalid position
  467. /* util.c */
  468. #define Shell_Initialize() (TRUE)
  469. #define Shell_Terminate() (TRUE)
  470. #define IDCMD_SYSTEMFIRST 0x8000
  471. #define IDCMD_SYSTEMLAST 0xbfff
  472. #define IDCMD_CANCELED 0xbfff
  473. #define IDCMD_PROCESSED 0xbffe
  474. #define IDCMD_DEFAULT 0xbffe
  475. /* timedate.c */
  476. // **********************************************************************
  477. // DATE is a structure with a date packed into a WORD size value. It
  478. // is compatible with a file date in a directory entry structure.
  479. // **********************************************************************
  480. #ifndef DATE_DEFINED
  481. typedef struct
  482. {
  483. WORD Day :5; // Day number 1 - 31
  484. WORD Month :4; // Month number 1 - 12
  485. WORD Year :7; // Year subtracted from 1980, 0-127
  486. } WORD_DATE;
  487. typedef union
  488. {
  489. WORD wDate;
  490. WORD_DATE sDate;
  491. } WDATE;
  492. #define DATE_DEFINED
  493. #endif
  494. // **********************************************************************
  495. // TIME is a structure with a 24 hour time packed into a WORD size value.
  496. // It is compatible with a file time in a directory entry structure.
  497. // **********************************************************************
  498. #ifndef TIME_DEFINED
  499. typedef struct
  500. {
  501. WORD Sec :5; // Seconds divided by 2 (0 - 29).
  502. WORD Min :6; // Minutes 0 - 59
  503. WORD Hour :5; // Hours 0 - 24
  504. } WORD_TIME;
  505. typedef union
  506. {
  507. WORD wTime;
  508. WORD_TIME sTime;
  509. } WTIME;
  510. #define TIME_DEFINED
  511. #endif
  512. WINSHELLAPI WORD WINAPI Shell_GetCurrentDate(void);
  513. WINSHELLAPI WORD WINAPI Shell_GetCurrentTime(void);
  514. #ifdef _WIN32
  515. //====== SEMI-PRIVATE API ===============================
  516. DECLARE_HANDLE( HPSXA );
  517. WINSHELLAPI HPSXA SHCreatePropSheetExtArray( HKEY hKey, LPCTSTR pszSubKey, UINT max_iface );
  518. WINSHELLAPI void SHDestroyPropSheetExtArray( HPSXA hpsxa );
  519. WINSHELLAPI UINT SHAddFromPropSheetExtArray( HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam );
  520. WINSHELLAPI UINT SHReplaceFromPropSheetExtArray( HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam );
  521. //====== SEMI-PRIVATE API ORDINALS ===============================
  522. // This is the list of semi-private ordinals we semi-publish.
  523. #define SHAddFromPropSheetExtArrayORD 167
  524. #define SHCreatePropSheetExtArrayORD 168
  525. #define SHDestroyPropSheetExtArrayORD 169
  526. #define SHReplaceFromPropSheetExtArrayORD 170
  527. #define SHCreateDefClassObjectORD 70
  528. #define SHGetNetResourceORD 69
  529. #define SHEXP_SHADDFROMPROPSHEETEXTARRAY MAKEINTRESOURCE(SHAddFromPropSheetExtArrayORD)
  530. #define SHEXP_SHCREATEPROPSHEETEXTARRAY MAKEINTRESOURCE(SHCreatePropSheetExtArrayORD)
  531. #define SHEXP_SHDESTROYPROPSHEETEXTARRAY MAKEINTRESOURCE(SHDestroyPropSheetExtArrayORD)
  532. #define SHEXP_SHREPLACEFROMPROPSHEETEXTARRAY MAKEINTRESOURCE(SHReplaceFromPropSheetExtArrayORD)
  533. #define SHEXP_SHCREATEDEFCLASSOBJECT MAKEINTRESOURCE(SHCreateDefClassObjectORD)
  534. #define SHEXP_SHGETNETRESOURCE MAKEINTRESOURCE(SHGetNetResourceORD)
  535. #endif // _WIN32
  536. /*
  537. * The SHFormatDrive API provides access to the Shell
  538. * format dialog. This allows apps which want to format disks
  539. * to bring up the same dialog that the Shell does to do it.
  540. *
  541. * This dialog is not sub-classable. You cannot put custom
  542. * controls in it. If you want this ability, you will have
  543. * to write your own front end for the DMaint_FormatDrive
  544. * engine.
  545. *
  546. * NOTE that the user can format as many diskettes in the specified
  547. * drive, or as many times, as he/she wishes to. There is no way to
  548. * force any specififc number of disks to format. If you want this
  549. * ability, you will have to write your own front end for the
  550. * DMaint_FormatDrive engine.
  551. *
  552. * NOTE also that the format will not start till the user pushes the
  553. * start button in the dialog. There is no way to do auto start. If
  554. * you want this ability, you will have to write your own front end
  555. * for the DMaint_FormatDrive engine.
  556. *
  557. * PARAMETERS
  558. *
  559. * hwnd = The window handle of the window which will own the dialog
  560. * NOTE that unlike SHCheckDrive, hwnd == NULL does not cause
  561. * this dialog to come up as a "top level application" window.
  562. * This parameter should always be non-null, this dialog is
  563. * only designed to be the child of another window, not a
  564. * stand-alone application.
  565. * drive = The 0 based (A: == 0) drive number of the drive to format
  566. * fmtID = The ID of the physical format to format the disk with
  567. * NOTE: The special value SHFMT_ID_DEFAULT means "use the
  568. * default format specified by the DMaint_FormatDrive
  569. * engine". If you want to FORCE a particular format
  570. * ID "up front" you will have to call
  571. * DMaint_GetFormatOptions yourself before calling
  572. * this to obtain the valid list of phys format IDs
  573. * (contents of the PhysFmtIDList array in the
  574. * FMTINFOSTRUCT).
  575. * options = There is currently only two option bits defined
  576. *
  577. * SHFMT_OPT_FULL
  578. * SHFMT_OPT_SYSONLY
  579. *
  580. * The normal defualt in the Shell format dialog is
  581. * "Quick Format", setting this option bit indicates that
  582. * the caller wants to start with FULL format selected
  583. * (this is useful for folks detecting "unformatted" disks
  584. * and wanting to bring up the format dialog).
  585. *
  586. * The SHFMT_OPT_SYSONLY initializes the dialog to
  587. * default to just sys the disk.
  588. *
  589. * All other bits are reserved for future expansion and
  590. * must be 0.
  591. *
  592. * Please note that this is a bit field and not a value
  593. * and treat it accordingly.
  594. *
  595. * RETURN
  596. * The return is either one of the SHFMT_* values, or if the
  597. * returned DWORD value is not == to one of these values, then
  598. * the return is the physical format ID of the last succesful
  599. * format. The LOWORD of this value can be passed on subsequent
  600. * calls as the fmtID parameter to "format the same type you did
  601. * last time".
  602. *
  603. */
  604. DWORD WINAPI SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID,
  605. UINT options);
  606. DWORD WINAPI SHChkDskDrive(HWND hwnd, UINT drive);
  607. //
  608. // Special value of fmtID which means "use the default format"
  609. //
  610. #define SHFMT_ID_DEFAULT 0xFFFF
  611. //
  612. // Option bits for options parameter
  613. //
  614. #define SHFMT_OPT_FULL 0x0001
  615. #define SHFMT_OPT_SYSONLY 0x0002
  616. //
  617. // Special return values. PLEASE NOTE that these are DWORD values.
  618. //
  619. #define SHFMT_ERROR 0xFFFFFFFFL // Error on last format, drive may be formatable
  620. #define SHFMT_CANCEL 0xFFFFFFFEL // Last format was canceled
  621. #define SHFMT_NOFORMAT 0xFFFFFFFDL // Drive is not formatable
  622. #ifndef _WIN32
  623. /*
  624. * The SHCheckDrive API provides access to the Shell
  625. * ScanDisk dialog. This allows apps which want to check disks
  626. * to bring up the same dialog that Shell does to do it.
  627. *
  628. * This dialog is not sub-classable. You cannot put custom
  629. * controls in it. If you want this ability, you will have
  630. * to write your own front end for the DMaint_FixDrive
  631. * engine.
  632. *
  633. * NOTE that the check will not start till the user pushes the
  634. * start button in the dialog unless the SHCHK_OPT_AUTO option is set.
  635. *
  636. * PARAMETERS
  637. *
  638. * hwnd = The window handle of the window which will own the dialog.
  639. * If this parameter is NULL it triggers the special case
  640. * "run as a top level window". The dialog will have a regular
  641. * top level application system menu, can be minimized, etc.
  642. * This is how SCANDSKW.EXE works, it just calls SHCheckDrive
  643. * with a NULL hwnd. If hwnd != NULL SHCheckDrive brings
  644. * up a regular application dialog box form.
  645. * options = These options basically coorespond to the check boxes
  646. * in the Advanced Options dialog. See SHCHK_OPT_ defines
  647. * below.
  648. * DrvList = This is a DWORD bit field which indicates the 0 based
  649. * drive numbers to check. Bit 0 = A, Bit 1 = B, ...
  650. * For use on this API at least one bit must be set (if
  651. * this argument is 0, the call will return SHCHK_NOCHK).
  652. * lpHwnd = An optional argument (can be NULL). If it is non-NULL,
  653. * SHCheckDrive will place the window handle of the
  654. * window it creates in this location.
  655. *
  656. * RETURN
  657. * The return is one of the SHCHK_* values.
  658. *
  659. */
  660. DWORD WINAPI SHCheckDrive(HWND hwnd, DWORD options, DWORD DrvList, HWND FAR* lpHwnd);
  661. //
  662. // Special return values. PLEASE NOTE that these are DWORD values.
  663. //
  664. #define SHCHK_ERROR 0xFFFFFFFFL // Fatal Error on check
  665. #define SHCHK_CANCEL 0xFFFFFFFEL // Check was canceled
  666. #define SHCHK_NOCHK 0xFFFFFFFDL // At least one Drive is not "checkable"
  667. // or no drives were specified
  668. #define SHCHK_SMNOTFIX 0xFFFFFFFCL // Some errors were not fixed
  669. #define SHCHK_ERRORMEM 0xFFFFFFFBL // Couldn't alloc memory to start check
  670. #define SHCHK_ERRORINIT 0xFFFFFFFAL // Couldn't access DSKMAINT.DLL
  671. #ifdef FROSTING
  672. #define SHCHK_RERUN 0xFFFFFFF9L // Couldn't check all drives (for sage)
  673. #endif
  674. #define SHCHK_NOERROR 0x00000000L // No errors on drive
  675. #define SHCHK_ALLFIXED 0x00000001L // Errors on drive, all were fixed
  676. // NOTE: This is not sensitive to
  677. // SHCHK_OPT_RO being set
  678. //
  679. // Option bits
  680. //
  681. // IMPORTANT NOTE: These are set up so that the default setting is 0
  682. // for all bits WITH TWO EXCEPTIONS. Currently the default
  683. // setting has the SHCHK_OPT_XLCPY and SHCHK_OPT_LSTMF
  684. // bits set......
  685. //
  686. // Also note that specification of invalid combinations of bits (for example
  687. // setting both SHCHK_OPT_XLCPY and SHCHK_OPT_XLDEL) will result in very random
  688. // behavior.
  689. //
  690. #define SHCHK_OPT_REP 0x00000001L // Generate detail report
  691. #define SHCHK_OPT_RO 0x00000002L // Run in preview mode
  692. #define SHCHK_OPT_NOSYS 0x00000004L // Surf Anal don't check system area
  693. #define SHCHK_OPT_NODATA 0x00000008L // Surf Anal don't check data area
  694. #define SHCHK_OPT_NOBAD 0x00000010L // Disable Surface Analysis
  695. #define SHCHK_OPT_LSTMF 0x00000020L // Convert lost clusters to files
  696. #define SHCHK_OPT_NOCHKNM 0x00000040L // Don't check file names
  697. #define SHCHK_OPT_NOCHKDT 0x00000080L // DOn't check date/time fields
  698. #define SHCHK_OPT_INTER 0x00000100L // Interactive mode
  699. #define SHCHK_OPT_XLCPY 0x00000200L // Def cross link resolution is COPY
  700. #define SHCHK_OPT_XLDEL 0x00000400L // Def cross link resolution is DELETE
  701. #define SHCHK_OPT_ALLHIDSYS 0x00000800L // All HID SYS files are unmovable
  702. #define SHCHK_OPT_NOWRTTST 0x00001000L // Surf Anal no write testing.
  703. #define SHCHK_OPT_DEFOPTIONS 0x00002000L // Get above options from registry
  704. #define SHCHK_OPT_DRVLISTONLY 0x00004000L // Normaly all drives in the system
  705. // are shown in the drive list box
  706. // and those on the DrvList are selected
  707. // This option says put only the drives
  708. // in DrvList in the list box and
  709. // disable the control
  710. #define SHCHK_OPT_AUTO 0x00008000L // Auto push start button
  711. #define SHCHK_OPT_EXCLULOCK 0x00010000L // Exclusive lock drive
  712. #define SHCHK_OPT_FLWRTLOCK 0x00020000L // Allow RD fail write
  713. #define SHCHK_OPT_MKOLDFS 0x00040000L // Remove new FS stuff
  714. // WARNING: This function is
  715. // reserved for SETUP, specifying
  716. // This will TURN OFF the Read
  717. // Only (preview), Interactive
  718. // and report settings, and turn
  719. // off surface analysis
  720. // automatically.....
  721. #define SHCHK_OPT_PROGONLY 0x00080000L // Put up front end dialog with
  722. // the progress bar, but run
  723. // "silently", no errors or
  724. // warnings...
  725. #define SHCHK_OPT_NOWND 0x00100000L // No window at all and run
  726. // silently as above...
  727. #define SHCHK_OPT_NOCHKHST 0x00200000L // By default a check of the
  728. // host drive of compresssed
  729. // volumes is done first as
  730. // part of the check of the
  731. // compressed drive. This
  732. // option disables this.
  733. #define SHCHK_OPT_REPONLYERR 0x00400000L // Report only if error
  734. #define SHCHK_OPT_NOLOG 0x00800000L // No logging
  735. #define SHCHK_OPT_LOGAPPEND 0x01000000L // Append to log
  736. #define SHCHK_OPT_MINIMIZED 0x02000000L // Allows top level window
  737. // to be started minimized
  738. // this option is valid only
  739. // when the hwnd parameter is
  740. // NULL
  741. #ifdef FROSTING
  742. #define SHCHK_OPT_SAGESET 0x04000000L // Specifies that the given
  743. // settings should be configured
  744. #define SHCHK_OPT_SAGERUN 0x08000000L // Specifies that the given
  745. // settings should be used to
  746. // check the appropriate drives
  747. #else
  748. #define SHCHK_OPT_RESERVED1 0x04000000L
  749. #define SHCHK_OPT_RESERVED2 0x08000000L
  750. #endif
  751. #endif // ifndef WIN32
  752. #ifdef __cplusplus
  753. }
  754. #endif /* __cplusplus */
  755. #ifndef RC_INVOKED
  756. #pragma pack()
  757. #endif /* !RC_INVOKED */
  758. #endif // _SHSEMIP_H_