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.

771 lines
31 KiB

  1. #ifndef _SHELLP_H_
  2. #define _SHELLP_H_
  3. //
  4. // Define API decoration for direct importing of DLL references.
  5. //
  6. #ifndef WINSHELLAPI
  7. #if !defined(_SHELL32_)
  8. #define WINSHELLAPI DECLSPEC_IMPORT
  9. #else
  10. #define WINSHELLAPI
  11. #endif
  12. #endif // WINSHELLAPI
  13. //
  14. // shell private header
  15. //
  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. //===========================================================================
  23. #ifndef _SHSEMIP_H_
  24. // Handle to property sheet extension array
  25. DECLARE_HANDLE( HPSXA );
  26. #endif // _SHSEMIP_H_
  27. //===========================================================================
  28. // Shell restrictions. (Parameter for SHRestriction)
  29. typedef enum
  30. {
  31. REST_NONE = 0x00000000,
  32. REST_NORUN = 0x00000001,
  33. REST_NOCLOSE = 0x00000002,
  34. REST_NOSAVESET = 0x00000004,
  35. REST_NOFILEMENU = 0x00000008,
  36. REST_NOSETFOLDERS = 0x00000010,
  37. REST_NOSETTASKBAR = 0x00000020,
  38. REST_NODESKTOP = 0x00000040,
  39. REST_NOFIND = 0x00000080,
  40. REST_NODRIVES = 0x00000100,
  41. REST_NODRIVEAUTORUN = 0x00000200,
  42. REST_NODRIVETYPEAUTORUN = 0x00000400,
  43. REST_NONETHOOD = 0x00000800,
  44. REST_STARTBANNER = 0x00001000,
  45. REST_RESTRICTRUN = 0x00002000,
  46. REST_NOPRINTERTABS = 0x00004000,
  47. REST_NOPRINTERDELETE = 0x00008000,
  48. REST_NOPRINTERADD = 0x00010000,
  49. REST_NOSTARTMENUSUBFOLDERS = 0x00020000,
  50. REST_MYDOCSONNET = 0x00040000,
  51. REST_NOEXITTODOS = 0x00080000,
  52. } RESTRICTIONS;
  53. WINSHELLAPI HRESULT WINAPI CIDLData_CreateFromIDArray(LPCITEMIDLIST pidlFolder, UINT cidl, LPCITEMIDLIST apidl[], LPDATAOBJECT * ppdtobj);
  54. WINSHELLAPI BOOL WINAPI SHIsBadInterfacePtr(LPCVOID pv, UINT cbVtbl);
  55. //
  56. // Stream API
  57. //
  58. WINSHELLAPI LPSTREAM WINAPI OpenRegStream(HKEY hkey, LPCSTR pszSubkey, LPCSTR pszValue, DWORD grfMode);
  59. WINSHELLAPI LPSTREAM WINAPI OpenFileStream(LPCSTR szFile, DWORD grfMode);
  60. //
  61. // OLE ripoffs of Drag and Drop related API
  62. //
  63. WINSHELLAPI HRESULT WINAPI SHRegisterDragDrop(HWND hwnd, LPDROPTARGET pdtgt);
  64. WINSHELLAPI HRESULT WINAPI SHRevokeDragDrop(HWND hwnd);
  65. WINSHELLAPI HRESULT WINAPI SHDoDragDrop(HWND hwndOwner, LPDATAOBJECT pdata, LPDROPSOURCE pdsrc, DWORD dwEffect, LPDWORD pdwEffect);
  66. //
  67. // Special folder
  68. //
  69. WINSHELLAPI LPITEMIDLIST WINAPI SHCloneSpecialIDList(HWND hwndOwner, int nFolder, BOOL fCreate);
  70. WINSHELLAPI BOOL WINAPI SHGetSpecialFolderPath(HWND hwndOwner, LPSTR lpszPath, int nFolder, BOOL fCreate);
  71. // DiskFull
  72. WINSHELLAPI void WINAPI SHHandleDiskFull(HWND hwnd, int idDrive);
  73. //
  74. // File Search APIS
  75. //
  76. WINSHELLAPI BOOL WINAPI SHFindFiles(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile);
  77. WINSHELLAPI BOOL WINAPI SHFindComputer(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile);
  78. //
  79. //
  80. WINSHELLAPI void WINAPI PathGetShortPath(LPSTR pszLongPath);
  81. WINSHELLAPI BOOL WINAPI PathFindOnPath(LPSTR szFile, LPCSTR FAR * ppszOtherDirs);
  82. WINSHELLAPI BOOL WINAPI PathYetAnotherMakeUniqueName(LPSTR pszUniqueName, LPCSTR pszPath, LPCSTR pszShort, LPCSTR pszFileSpec);
  83. //
  84. WINSHELLAPI BOOL WINAPI Win32CreateDirectory(LPCSTR lpszPath, LPSECURITY_ATTRIBUTES lpsa);
  85. WINSHELLAPI BOOL WINAPI Win32RemoveDirectory(LPCSTR lpszPath);
  86. WINSHELLAPI BOOL WINAPI Win32DeleteFile(LPCSTR lpszPath);
  87. // Convert an IDList into a logical IDList so that desktop folders
  88. // appear at the right spot in the tree
  89. WINSHELLAPI LPITEMIDLIST WINAPI SHLogILFromFSIL(LPCITEMIDLIST pidlFS);
  90. // Convert an ole string.
  91. WINSHELLAPI BOOL WINAPI StrRetToStrN(LPSTR szOut, UINT uszOut, LPSTRRET pStrRet, LPCITEMIDLIST pidl);
  92. WINSHELLAPI DWORD WINAPI SHWaitForFileToOpen(LPCITEMIDLIST pidl,
  93. UINT uOptions, DWORD dwtimeout);
  94. WINSHELLAPI HRESULT WINAPI SHGetRealIDL(LPSHELLFOLDER psf, LPCITEMIDLIST pidlSimple, LPITEMIDLIST FAR* ppidlReal);
  95. WINSHELLAPI void WINAPI SetAppStartingCursor(HWND hwnd, BOOL fSet);
  96. #define DECLAREWAITCURSOR HCURSOR hcursor_wait_cursor_save
  97. #define SetWaitCursor() hcursor_wait_cursor_save = SetCursor(LoadCursor(NULL, IDC_WAIT))
  98. #define ResetWaitCursor() SetCursor(hcursor_wait_cursor_save)
  99. WINSHELLAPI DWORD WINAPI SHRestricted(RESTRICTIONS rest);
  100. WINSHELLAPI LPVOID WINAPI SHGetHandlerEntry(LPCSTR szHandler, LPCSTR szProcName, HINSTANCE *lpModule);
  101. WINSHELLAPI STDAPI SHCoCreateInstance(LPCSTR pszCLSID, const CLSID FAR * lpclsid,
  102. LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv);
  103. WINSHELLAPI BOOL WINAPI SignalFileOpen(LPCITEMIDLIST pidl);
  104. WINSHELLAPI LPITEMIDLIST WINAPI SHSimpleIDListFromPath(LPCSTR pszPath);
  105. WINSHELLAPI int WINAPI SHCreateDirectory(HWND hwnd, LPCSTR pszPath);
  106. WINSHELLAPI HPSXA SHCreatePropSheetExtArray( HKEY hKey, PCSTR pszSubKey, UINT max_iface );
  107. WINSHELLAPI void SHDestroyPropSheetExtArray( HPSXA hpsxa );
  108. WINSHELLAPI UINT SHAddFromPropSheetExtArray( HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam );
  109. WINSHELLAPI UINT SHReplaceFromPropSheetExtArray( HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam );
  110. WINSHELLAPI DWORD SHNetConnectionDialog(HWND hwnd, LPSTR pszRemoteName, DWORD dwType) ;
  111. WINSHELLAPI STDAPI SHLoadOLE(LPARAM lParam);
  112. WINSHELLAPI void WINAPI Desktop_UpdateBriefcaseOnEvent(HWND hwnd, UINT uEvent);
  113. WINSHELLAPI HRESULT WINAPI SHCreateStdEnumFmtEtc(UINT cfmt, const FORMATETC afmt[], LPENUMFORMATETC * ppenumFormatEtc);
  114. // Shell create link API
  115. #define SHCL_USETEMPLATE 0x0001
  116. #define SHCL_USEDESKTOP 0x0002
  117. #define SHCL_CONFIRM 0x0004
  118. WINSHELLAPI HRESULT WINAPI SHCreateLinks(HWND hwnd, LPCSTR pszDir, IDataObject *pDataObj, UINT fFlags, LPITEMIDLIST* ppidl);
  119. //
  120. // Interface pointer validation
  121. //
  122. #define IsBadInterfacePtr(pitf, ITF) SHIsBadInterfacePtr(pitf, sizeof(ITF##Vtbl))
  123. //===========================================================================
  124. // Image dragging API (definitely private)
  125. //===========================================================================
  126. // stuff for doing auto scrolling
  127. #define NUM_POINTS 3
  128. typedef struct { // asd
  129. int iNextSample;
  130. DWORD dwLastScroll;
  131. BOOL bFull;
  132. POINT pts[NUM_POINTS];
  133. DWORD dwTimes[NUM_POINTS];
  134. } AUTO_SCROLL_DATA;
  135. #define DAD_InitScrollData(pad) (pad)->bFull = FALSE, (pad)->iNextSample = 0, (pad)->dwLastScroll = 0
  136. WINSHELLAPI BOOL WINAPI DAD_SetDragImage(HIMAGELIST him, POINT FAR* pptOffset);
  137. WINSHELLAPI BOOL WINAPI DAD_DragEnter(HWND hwndTarget);
  138. WINSHELLAPI BOOL WINAPI DAD_DragEnterEx(HWND hwndTarget, const POINT ptStart);
  139. WINSHELLAPI BOOL WINAPI DAD_ShowDragImage(BOOL fShow);
  140. WINSHELLAPI BOOL WINAPI DAD_DragMove(POINT pt);
  141. WINSHELLAPI BOOL WINAPI DAD_DragLeave(void);
  142. WINSHELLAPI BOOL WINAPI DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *pad, const POINT *pptNow);
  143. WINSHELLAPI BOOL WINAPI DAD_SetDragImageFromListView(HWND hwndLV, POINT ptOffset);
  144. //===========================================================================
  145. // Another block of private API
  146. //===========================================================================
  147. // indexes into the shell image lists (Shell_GetImageList) for default images
  148. #define II_DOCNOASSOC 0 // document (blank page) (not associated)
  149. #define II_DOCUMENT 1 // document (with stuff on the page)
  150. #define II_APPLICATION 2 // application (exe, com, bat)
  151. #define II_FOLDER 3 // folder (plain)
  152. #define II_FOLDEROPEN 4 // folder (open)
  153. // Startmenu images.
  154. #define II_STPROGS 19
  155. #define II_STDOCS 20
  156. #define II_STSETNGS 21
  157. #define II_STFIND 22
  158. #define II_STHELP 23
  159. #define II_STRUN 24
  160. #define II_STSUSPD 25
  161. #define II_STEJECT 26
  162. #define II_STSHUTD 27
  163. // More startmenu image.
  164. #define II_STCPANEL 35
  165. #define II_STSPROGS 36
  166. #define II_STPRNTRS 37
  167. #define II_STFONTS 38
  168. #define II_STTASKBR 39
  169. WINSHELLAPI BOOL WINAPI Shell_GetImageLists(HIMAGELIST FAR *phiml, HIMAGELIST FAR *phimlSmall);
  170. WINSHELLAPI void WINAPI Shell_SysColorChange(void);
  171. WINSHELLAPI int WINAPI Shell_GetCachedImageIndex(LPCSTR pszIconPath, int iIconIndex, UINT uIconFlags);
  172. WINSHELLAPI LRESULT WINAPI SHShellFolderView_Message(HWND hwndMain, UINT uMsg, LPARAM lParam);
  173. // A usefull function in Defview for mapping idlist into index into system
  174. // image list. Optionally it can also look up the index of the selected
  175. // icon.
  176. WINSHELLAPI int WINAPI SHMapPIDLToSystemImageListIndex(LPSHELLFOLDER pshf, LPCITEMIDLIST pidl, int *piIndexSel);
  177. //
  178. // OLE string
  179. //
  180. WINSHELLAPI int WINAPI OleStrToStrN(LPSTR, int, LPCOLESTR, int);
  181. WINSHELLAPI int WINAPI StrToOleStrN(LPOLESTR, int, LPCSTR, int);
  182. WINSHELLAPI int WINAPI OleStrToStr(LPSTR, LPCOLESTR);
  183. WINSHELLAPI int WINAPI StrToOleStr(LPOLESTR, LPCSTR);
  184. //===========================================================================
  185. // Useful macros
  186. //===========================================================================
  187. #define ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i)))
  188. #define ShortFromResult(r) (short)SCODE_CODE(GetScode(r))
  189. // Tray CopyData Messages
  190. #define TCDM_APPBAR 0x00000000
  191. #define TCDM_NOTIFY 0x00000001
  192. #define TCDM_LOADINPROC 0x00000002
  193. //===========================================================================
  194. // IShellFolder::UIObject helper
  195. //===========================================================================
  196. STDAPI SHCreateDefExtIconKey(HKEY hkey, LPCSTR pszModule, int iIcon, int iIconOpen, UINT uFlags, LPEXTRACTICON FAR* pxiconOut);
  197. STDAPI SHCreateDefExtIcon(LPCSTR pszModule, int iIcon, int iIconOpen, UINT uFlags, LPEXTRACTICON FAR* pxiconOut);
  198. //
  199. // BUGBUG: lParam for DFM_INVOKECOMMAND needs to be changed
  200. // now it contains "args" but it should just contain the LPCMINVOKECOMMANDINFO
  201. // uMsg wParam lParam
  202. #define DFM_MERGECONTEXTMENU 1 // uFlags LPQCMINFO
  203. #define DFM_INVOKECOMMAND 2 // idCmd pszArgs
  204. #define DFM_ADDREF 3 // 0 0
  205. #define DFM_RELEASE 4 // 0 0
  206. #define DFM_GETHELPTEXT 5 // idCmd,cchMax pszText
  207. #define DFM_WM_MEASUREITEM 6 // ---from the message---
  208. #define DFM_WM_DRAWITEM 7 // ---from the message---
  209. #define DFM_WM_INITMENUPOPUP 8 // ---from the message---
  210. #define DFM_VALIDATECMD 9 // idCmd 0
  211. #define DFM_MERGECONTEXTMENU_TOP 10 // uFlags LPQCMINFO
  212. // Commands from DFM_INVOKECOMMAND when strings are passed in
  213. #define DFM_CMD_DELETE ((WPARAM)-1)
  214. #define DFM_CMD_MOVE ((WPARAM)-2)
  215. #define DFM_CMD_COPY ((WPARAM)-3)
  216. #define DFM_CMD_LINK ((WPARAM)-4)
  217. #define DFM_CMD_PROPERTIES ((WPARAM)-5)
  218. #define DFM_CMD_NEWFOLDER ((WPARAM)-6)
  219. #define DFM_CMD_PASTE ((WPARAM)-7)
  220. #define DFM_CMD_VIEWLIST ((WPARAM)-8)
  221. #define DFM_CMD_VIEWDETAILS ((WPARAM)-9)
  222. #define DFM_CMD_PASTELINK ((WPARAM)-10)
  223. #define DFM_CMD_PASTESPECIAL ((WPARAM)-11)
  224. #define DFM_CMD_MODALPROP ((WPARAM)-12)
  225. typedef struct _QCMINFO // qcm
  226. {
  227. HMENU hmenu; // in
  228. UINT indexMenu; // in
  229. UINT idCmdFirst; // in/out
  230. UINT idCmdLast; // in
  231. } QCMINFO, FAR* LPQCMINFO;
  232. typedef HRESULT (CALLBACK FAR* LPFNDFMCALLBACK)(LPSHELLFOLDER psf,
  233. HWND hwndOwner,
  234. LPDATAOBJECT pdtobj,
  235. UINT uMsg,
  236. WPARAM wParam,
  237. LPARAM lParam);
  238. STDAPI CDefFolderMenu_Create(LPCITEMIDLIST pidlFolder,
  239. HWND hwndOwner,
  240. UINT cidl, LPCITEMIDLIST FAR* apidl,
  241. LPSHELLFOLDER psf,
  242. LPFNDFMCALLBACK lpfn,
  243. HKEY hkeyProgID, HKEY hkeyBaseProgID,
  244. LPCONTEXTMENU FAR* ppcm);
  245. void PASCAL CDefFolderMenu_MergeMenu(HINSTANCE hinst, UINT idMainMerge, UINT idPopupMerge,
  246. LPQCMINFO pqcm);
  247. void PASCAL Def_InitFileCommands(ULONG dwAttr, HMENU hmInit, UINT idCmdFirst,
  248. BOOL bContext);
  249. void PASCAL Def_InitEditCommands(ULONG dwAttr, HMENU hmInit, UINT idCmdFirst,
  250. LPDROPTARGET pdtgt, UINT fContext);
  251. void NEAR PASCAL _SHPrettyMenu(HMENU hm);
  252. //===========================================================================
  253. // Default IShellView for IShellFolder
  254. //===========================================================================
  255. WINSHELLAPI HRESULT WINAPI SHCreateShellFolderView(LPSHELLFOLDER pshf, LPCITEMIDLIST pidl, LONG lEvent, LPSHELLVIEW FAR* ppsv);
  256. // Menu ID's
  257. #ifdef BUG_23171_FIXED
  258. #define SFVIDM_FIRST (FCIDM_SHVIEWLAST-0x0fff)
  259. #else
  260. // MENUEX currently cannot handle subtraction in the ID's, so we need
  261. // to subtract for it.
  262. #if (FCIDM_SHVIEWLAST != 0x7fff)
  263. #error FCIDM_SHVIEWLAST has changed, so shellp.h needs to also
  264. #endif
  265. #define SFVIDM_FIRST (0x7000)
  266. #endif
  267. #define SFVIDM_LAST (FCIDM_SHVIEWLAST)
  268. // Popup menu ID's used in merging menus
  269. #define SFVIDM_MENU_ARRANGE (SFVIDM_FIRST + 0x0001)
  270. #define SFVIDM_MENU_VIEW (SFVIDM_FIRST + 0x0002)
  271. #define SFVIDM_MENU_SELECT (SFVIDM_FIRST + 0x0003)
  272. // TBINFO flags
  273. #define TBIF_APPEND 0
  274. #define TBIF_PREPEND 1
  275. #define TBIF_REPLACE 2
  276. typedef struct _TBINFO
  277. {
  278. UINT cbuttons; // out
  279. UINT uFlags; // out (one of TBIF_ flags)
  280. } TBINFO, FAR * LPTBINFO;
  281. typedef struct _COPYHOOKINFO
  282. {
  283. HWND hwnd;
  284. DWORD wFunc;
  285. DWORD wFlags;
  286. LPCSTR pszSrcFile;
  287. DWORD dwSrcAttribs;
  288. LPCSTR pszDestFile;
  289. DWORD dwDestAttribs;
  290. } COPYHOOKINFO, *LPCOPYHOOKINFO;
  291. typedef struct _DETAILSINFO
  292. {
  293. LPCITEMIDLIST pidl; // pidl to get details of
  294. // Note: do not change the order of these fields until IShellDetails
  295. // has gone away!
  296. int fmt; // LVCFMT_* value (header only)
  297. int cxChar; // Number of "average" characters (header only)
  298. STRRET str; // String information
  299. } DETAILSINFO, *PDETAILSINFO;
  300. // uMsg wParam lParam
  301. #define DVM_MERGEMENU 1 // uFlags LPQCMINFO
  302. #define DVM_INVOKECOMMAND 2 // idCmd 0
  303. #define DVM_GETHELPTEXT 3 // idCmd,cchMax pszText
  304. #define DVM_GETTOOLTIPTEXT 4 // idCmd,cchMax pszText
  305. #define DVM_GETBUTTONINFO 5 // 0 LPTBINFO
  306. #define DVM_GETBUTTONS 6 // idCmdFirst,cbtnMax LPTBBUTTON
  307. #define DVM_INITMENUPOPUP 7 // idCmdFirst,nIndex hmenu
  308. #define DVM_SELCHANGE 8 // idCmdFirst,nItem PDVSELCHANGEINFO
  309. #define DVM_DRAWITEM 9 // idCmdFirst pdis
  310. #define DVM_MEASUREITEM 10 // idCmdFirst pmis
  311. #define DVM_EXITMENULOOP 11 // - -
  312. #define DVM_RELEASE 12 // - lSelChangeInfo (ShellFolder private)
  313. #define DVM_GETCCHMAX 13 // pidlItem pcchMax
  314. #define DVM_FSNOTIFY 14 // LPITEMIDLIST* lEvent
  315. #define DVM_WINDOWCREATED 15 // hwnd PDVSELCHANGEINFO
  316. #define DVM_WINDOWDESTROY 16 // hwnd PDVSELCHANGEINFO
  317. #define DVM_REFRESH 17 // - lSelChangeInfo
  318. #define DVM_SETFOCUS 18 // - lSelChangeInfo
  319. #define DVM_KILLFOCUS 19 // - -
  320. #define DVM_QUERYCOPYHOOK 20 // - -
  321. #define DVM_NOTIFYCOPYHOOK 21 // - LPCOPYHOOKINFO
  322. #define DVM_NOTIFY 22 // idFrom LPNOTIFY
  323. #define DVM_GETDETAILSOF 23 // iColumn PDETAILSINFO
  324. #define DVM_COLUMNCLICK 24 // iColumn -
  325. #define DVM_QUERYFSNOTIFY 25 // - FSNotifyEntry *
  326. #define DVM_DEFITEMCOUNT 26 // - PINT
  327. #define DVM_DEFVIEWMODE 27 // - PFOLDERVIEWMODE
  328. #define DVM_UNMERGEMENU 28 // uFlags
  329. #define DVM_INSERTITEM 29 // pidl PDVSELCHANGEINFO
  330. #define DVM_DELETEITEM 30 // pidl PDVSELCHANGEINFO
  331. #define DVM_UPDATESTATUSBAR 31 // - lSelChangeInfo
  332. #define DVM_BACKGROUNDENUM 32
  333. #define DVM_GETWORKINGDIR 33
  334. #define DVM_GETCOLSAVESTREAM 34 // flags IStream **
  335. #define DVM_SELECTALL 35 // lSelChangeInfo
  336. #define DVM_DIDDRAGDROP 36 // dwEffect IDataObject *
  337. typedef struct _DVSELCHANGEINFO {
  338. UINT uOldState;
  339. UINT uNewState;
  340. LPARAM lParamItem;
  341. LPARAM* plParam;
  342. } DVSELCHANGEINFO, *PDVSELCHANGEINFO;
  343. typedef HRESULT (CALLBACK FAR* LPFNVIEWCALLBACK)(LPSHELLVIEW psvOuter,
  344. LPSHELLFOLDER psf,
  345. HWND hwndMain,
  346. UINT uMsg,
  347. WPARAM wParam,
  348. LPARAM lParam);
  349. // SHCreateShellFolderViewEx struct
  350. typedef struct _CSFV
  351. {
  352. UINT cbSize;
  353. LPSHELLFOLDER pshf;
  354. LPSHELLVIEW psvOuter;
  355. LPCITEMIDLIST pidl;
  356. LONG lEvents;
  357. LPFNVIEWCALLBACK pfnCallback; // No callback if NULL
  358. FOLDERVIEWMODE fvm;
  359. } CSFV, FAR * LPCSFV;
  360. // Tell the FolderView to rearrange. The lParam will be passed to
  361. // IShellFolder::CompareIDs
  362. #define SFVM_REARRANGE 0x00000001
  363. #define ShellFolderView_ReArrange(_hwnd, _lparam) \
  364. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_REARRANGE, _lparam)
  365. // Get the last sorting parameter given to FolderView
  366. #define SFVM_GETARRANGEPARAM 0x00000002
  367. #define ShellFolderView_GetArrangeParam(_hwnd) \
  368. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_GETARRANGEPARAM, 0L)
  369. // Add an OBJECT into the view (May need to add insert also)
  370. #define SFVM_ADDOBJECT 0x00000003
  371. #define ShellFolderView_AddObject(_hwnd, _pidl) \
  372. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_ADDOBJECT, (LPARAM)_pidl)
  373. // Gets the count of objects in the view
  374. #define SFVM_GETOBJECTCOUNT 0x00000004
  375. #define ShellFolderView_GetObjectCount(_hwnd) \
  376. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_GETOBJECTCOUNT, (LPARAM)0)
  377. // Returns a pointer to the Idlist associated with the specified index
  378. // Returns NULL if at end of list.
  379. #define SFVM_GETOBJECT 0x00000005
  380. #define ShellFolderView_GetObject(_hwnd, _iObject) \
  381. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_GETOBJECT, _iObject)
  382. // Remove an OBJECT into the view (This works by pidl, may need index also);
  383. #define SFVM_REMOVEOBJECT 0x00000006
  384. #define ShellFolderView_RemoveObject(_hwnd, _pidl) \
  385. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_REMOVEOBJECT, (LPARAM)_pidl)
  386. // updates an object by passing in pointer to two PIDLS, the first
  387. // is the old pidl, the second one is the one with update information.
  388. #define SFVM_UPDATEOBJECT 0x00000007
  389. #define ShellFolderView_UpdateObject(_hwnd, _ppidl) \
  390. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_UPDATEOBJECT, (LPARAM)_ppidl)
  391. // Sets the redraw mode for the window that is displaying the information
  392. #define SFVM_SETREDRAW 0x00000008
  393. #define ShellFolderView_SetRedraw(_hwnd, fRedraw) \
  394. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_SETREDRAW, (LPARAM)fRedraw)
  395. // Returns an array of the selected IDS to the caller.
  396. // lparam is a pointer to receive the idlists into
  397. // return value is the count of items in the array.
  398. #define SFVM_GETSELECTEDOBJECTS 0x00000009
  399. #define ShellFolderView_GetSelectedObjects(_hwnd, ppidl) \
  400. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_GETSELECTEDOBJECTS, (LPARAM)ppidl)
  401. // Checks if the current drop is on the view window
  402. // lparam is unused
  403. // return value is TRUE if the current drop is upon the background of the
  404. // view window, FALSE otherwise
  405. #define SFVM_ISDROPONSOURCE 0x0000000a
  406. #define ShellFolderView_IsDropOnSource(_hwnd, _pdtgt) \
  407. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_ISDROPONSOURCE, (LPARAM)_pdtgt)
  408. // Moves the selected icons in the listview
  409. // lparam is a pointer to a drop target
  410. // return value is unused
  411. #define SFVM_MOVEICONS 0x0000000b
  412. #define ShellFolderView_MoveIcons(_hwnd, _pdt) \
  413. (void)SHShellFolderView_Message(_hwnd, SFVM_MOVEICONS, (LPARAM)(LPDROPTARGET)_pdt)
  414. // Gets the start point of a drag-drop
  415. // lparam is a pointer to a point
  416. // return value is unused
  417. #define SFVM_GETDRAGPOINT 0x0000000c
  418. #define ShellFolderView_GetDragPoint(_hwnd, _ppt) \
  419. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_GETDRAGPOINT, (LPARAM)(LPPOINT)_ppt)
  420. // Gets the end point of a drag-drop
  421. // lparam is a pointer to a point
  422. // return value is unused
  423. #define SFVM_GETDROPPOINT 0x0000000d
  424. #define ShellFolderView_GetDropPoint(_hwnd, _ppt) \
  425. SHShellFolderView_Message(_hwnd, SFVM_GETDROPPOINT, (LPARAM)(LPPOINT)_ppt)
  426. #define ShellFolderView_GetAnchorPoint(_hwnd, _fStart, _ppt) \
  427. (BOOL)((_fStart) ? ShellFolderView_GetDragPoint(_hwnd, _ppt) : ShellFolderView_GetDropPoint(_hwnd, _ppt))
  428. typedef struct _SFV_SETITEMPOS
  429. {
  430. LPCITEMIDLIST pidl;
  431. POINT pt;
  432. } SFV_SETITEMPOS, FAR *LPSFV_SETITEMPOS;
  433. // Sets the position of an item in the viewer
  434. // lparam is a pointer to a SVF_SETITEMPOS
  435. // return value is unused
  436. #define SFVM_SETITEMPOS 0x0000000e
  437. #define ShellFolderView_SetItemPos(_hwnd, _pidl, _x, _y) \
  438. { SFV_SETITEMPOS _sip = {_pidl, {_x, _y}}; \
  439. SHShellFolderView_Message(_hwnd, SFVM_SETITEMPOS, (LPARAM)(LPSFV_SETITEMPOS)&_sip);}
  440. // Determines if a given drop target interface is the one being used for
  441. // the background of the ShellFolderView (as opposed to an object in the
  442. // view)
  443. // lparam is a pointer to a drop target interface
  444. // return value is TRUE if it is the background drop target, FALSE otherwise
  445. #define SFVM_ISBKDROPTARGET 0x0000000f
  446. #define ShellFolderView_IsBkDropTarget(_hwnd, _pdptgt) \
  447. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_ISBKDROPTARGET, (LPARAM)(LPDROPTARGET)_pdptgt)
  448. // Notifies a ShellView when one of its objects get put on the clipboard
  449. // as a result of a menu command.
  450. //
  451. // called by defcm.c when it does a copy/cut
  452. //
  453. // lparam is the dwEffect (DROPEFFECT_MOVE, DROPEFFECT_COPY)
  454. // return value is void.
  455. #define SFVM_SETCLIPBOARD 0x00000010
  456. #define ShellFolderView_SetClipboard(_hwnd, _dwEffect) \
  457. (void)SHShellFolderView_Message(_hwnd, SFVM_SETCLIPBOARD, (LPARAM)(DWORD)(_dwEffect))
  458. // sets auto arrange
  459. #define SFVM_AUTOARRANGE 0x00000011
  460. #define ShellFolderView_AutoArrange(_hwnd) \
  461. (void)SHShellFolderView_Message(_hwnd, SFVM_AUTOARRANGE, 0)
  462. // sets snap to grid
  463. #define SFVM_ARRANGEGRID 0x00000012
  464. #define ShellFolderView_ArrangeGrid(_hwnd) \
  465. (void)SHShellFolderView_Message(_hwnd, SFVM_ARRANGEGRID, 0)
  466. #define SFVM_GETAUTOARRANGE 0x00000013
  467. #define ShellFolderView_GetAutoArrange(_hwnd) \
  468. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_GETAUTOARRANGE, 0)
  469. #define SFVM_GETSELECTEDCOUNT 0x00000014
  470. #define ShellFolderView_GetSelectedCount(_hwnd) \
  471. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_GETSELECTEDCOUNT, 0)
  472. typedef struct {
  473. int cxSmall;
  474. int cySmall;
  475. int cxLarge;
  476. int cyLarge;
  477. } ITEMSPACING, *LPITEMSPACING;
  478. #define SFVM_GETITEMSPACING 0x00000015
  479. #define ShellFolderView_GetItemSpacing(_hwnd, lpis) \
  480. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_GETITEMSPACING, (LPARAM)lpis)
  481. // Causes an object to be repainted
  482. #define SFVM_REFRESHOBJECT 0x00000016
  483. #define ShellFolderView_RefreshObject(_hwnd, _ppidl) \
  484. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_REFRESHOBJECT, (LPARAM)_ppidl)
  485. #define SFVM_SETPOINTS 0x00000017
  486. #define ShellFolderView_SetPoints(_hwnd, _pdtobj) \
  487. (void)SHShellFolderView_Message(_hwnd, SFVM_SETPOINTS, (LPARAM)_pdtobj)
  488. // SVM_SELECTANDPOSITIONITEM lParam
  489. typedef struct
  490. {
  491. LPCITEMIDLIST pidl; // relative pidl to the view
  492. UINT uSelectFlags; // select flags
  493. BOOL fMove; // if true, we should also move it to point pt
  494. POINT pt;
  495. } SFM_SAP;
  496. // shell view messages
  497. #define SVM_SELECTITEM (WM_USER + 1)
  498. #define SVM_MOVESELECTEDITEMS (WM_USER + 2)
  499. #define SVM_GETANCHORPOINT (WM_USER + 3)
  500. #define SVM_GETITEMPOSITION (WM_USER + 4)
  501. #define SVM_SELECTANDPOSITIONITEM (WM_USER + 5)
  502. // Heap tracking stuff.
  503. #ifdef MEMMON
  504. #ifndef INC_MEMMON
  505. #define INC_MEMMON
  506. #define LocalAlloc SHLocalAlloc
  507. #define LocalFree SHLocalFree
  508. #define LocalReAlloc SHLocalReAlloc
  509. WINSHELLAPI HLOCAL WINAPI SHLocalAlloc(UINT uFlags, UINT cb);
  510. WINSHELLAPI HLOCAL WINAPI SHLocalReAlloc(HLOCAL hOld, UINT cbNew, UINT uFlags);
  511. WINSHELLAPI HLOCAL WINAPI SHLocalFree(HLOCAL h);
  512. #endif
  513. #endif
  514. //===========================================================================
  515. // CDefShellFolder members (for easy subclassing)
  516. //===========================================================================
  517. // Single instance members
  518. STDMETHODIMP_(ULONG) CSIShellFolder_AddRef(LPSHELLFOLDER psf) ;
  519. STDMETHODIMP_(ULONG) CSIShellFolder_Release(LPSHELLFOLDER psf);
  520. // Default implementation (no dependencies to the instance data)
  521. STDMETHODIMP CDefShellFolder_QueryInterface(LPSHELLFOLDER psf, REFIID riid, LPVOID FAR* ppvObj);
  522. STDMETHODIMP CDefShellFolder_BindToStorage(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPBC pbc,
  523. REFIID riid, LPVOID FAR* ppvOut);
  524. STDMETHODIMP CDefShellFolder_BindToObject(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, LPVOID FAR* ppvOut);
  525. STDMETHODIMP CDefShellFolder_GetAttributesOf(LPSHELLFOLDER psf, UINT cidl, LPCITEMIDLIST FAR* apidl, ULONG FAR* rgfOut);
  526. STDMETHODIMP CDefShellFolder_SetNameOf(LPSHELLFOLDER psf, HWND hwndOwner,
  527. LPCITEMIDLIST pidl, LPCOLESTR lpszName, DWORD dwReserved, LPITEMIDLIST FAR* ppidlOut);
  528. // File Search APIS
  529. WINSHELLAPI LPCONTEXTMENU WINAPI SHFind_InitMenuPopup(HMENU hmenu, HWND hwndOwner, UINT idCmdFirst, UINT idCmdLast);
  530. WINSHELLAPI void WINAPI Control_RunDLL(HWND hwndStub, HINSTANCE hAppInstance, LPSTR lpszCmdLine, int nCmdShow);
  531. // to add 16 bit pages to 32bit things. hGlobal can be NULL
  532. WINSHELLAPI UINT WINAPI SHAddPages16(HGLOBAL hGlobal, LPCSTR pszDllEntry, LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam);
  533. WINSHELLAPI HRESULT WINAPI SHCreateShellFolderViewEx(LPCSFV pcsfv, LPSHELLVIEW FAR* ppsv);
  534. //===========================================================================
  535. // Defview related API and interface
  536. //
  537. // Notes: At this point, we have no plan to publish this mechanism.
  538. //===========================================================================
  539. typedef struct _SHELLDETAILS
  540. {
  541. int fmt; // LVCFMT_* value (header only)
  542. int cxChar; // Number of "average" characters (header only)
  543. STRRET str; // String information
  544. } SHELLDETAILS, FAR *LPSHELLDETAILS;
  545. #undef INTERFACE
  546. #define INTERFACE IShellDetails
  547. DECLARE_INTERFACE_(IShellDetails, IUnknown)
  548. {
  549. // *** IUnknown methods ***
  550. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  551. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  552. STDMETHOD_(ULONG,Release) (THIS) PURE;
  553. // *** IShellDetails methods ***
  554. STDMETHOD(GetDetailsOf)(THIS_ LPCITEMIDLIST pidl, UINT iColumn, LPSHELLDETAILS pDetails) PURE;
  555. STDMETHOD(ColumnClick)(THIS_ UINT iColumn) PURE;
  556. };
  557. //
  558. // Private QueryContextMenuFlag passed from DefView
  559. //
  560. #define CMF_DVFILE 0x00010000 // "File" pulldown
  561. //
  562. // Functions to help the cabinets sync to each other
  563. // uOptions parameter to SHWaitForFileOpen
  564. //
  565. #define WFFO_WAITTIME 10000L
  566. #define WFFO_ADD 0x0001
  567. #define WFFO_REMOVE 0x0002
  568. #define WFFO_WAIT 0x0004
  569. // Common strings
  570. #define STR_DESKTOPCLASS "Progman"
  571. //===========================================================================
  572. // Helper functions for pidl allocation using the task allocator.
  573. //
  574. WINSHELLAPI HRESULT WINAPI SHILClone(LPCITEMIDLIST pidl, LPITEMIDLIST * ppidlOut);
  575. WINSHELLAPI HRESULT WINAPI SHILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, LPITEMIDLIST * ppidlOut);
  576. #define SHILFree(pidl) SHFree(pidl)
  577. WINSHELLAPI HRESULT WINAPI SHDllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID FAR* ppv);
  578. #include <fsmenu.h>
  579. //===========================================================================
  580. //----------------------------------------------------------------------------
  581. #define IsLFNDriveORD 119
  582. WINSHELLAPI BOOL WINAPI IsLFNDrive(LPCSTR pszPath);
  583. WINSHELLAPI int WINAPI SHOutOfMemoryMessageBox(HWND hwndOwner, LPSTR pszTitle, UINT fuStyle);
  584. WINSHELLAPI BOOL WINAPI SHWinHelp(HWND hwndMain, LPCSTR lpszHelp, UINT usCommand, DWORD ulData);
  585. WINSHELLAPI BOOL WINAPI RLBuildListOfPaths(void);
  586. #define SHValidateUNCORD 173
  587. #define VALIDATEUNC_NOUI 0x0002 // dont bring up stinking UI!
  588. #define VALIDATEUNC_CONNECT 0x0001 // connect a drive letter
  589. #define VALIDATEUNC_PRINT 0x0004 // validate as print share instead of disk share
  590. #define VALIDATEUNC_VALID 0x0007 // valid flags
  591. WINSHELLAPI BOOL WINAPI SHValidateUNC(HWND hwndOwner, LPSTR pszFile, UINT fConnect);
  592. //----------------------------------------------------------------------------
  593. #define OleStrToStrNORD 78
  594. #define SHCloneSpecialIDListORD 89
  595. #define SHDllGetClassObjectORD 128
  596. #define SHLogILFromFSILORD 95
  597. #define SHMapPIDLToSystemImageListIndexORD 77
  598. #define SHShellFolderView_MessageORD 73
  599. #define Shell_GetImageListsORD 71
  600. #define SHGetSpecialFolderPathORD 175
  601. #define StrToOleStrNORD 79
  602. #define ILCloneORD 18
  603. #define ILCloneFirstORD 19
  604. #define ILCombineORD 25
  605. #define ILCreateFromPathORD 157
  606. #define ILFindChildORD 24
  607. #define ILFreeORD 155
  608. #define ILGetNextORD 153
  609. #define ILGetSizeORD 152
  610. #define ILIsEqualORD 21
  611. #define ILRemoveLastIDORD 17
  612. #define PathAddBackslashORD 32
  613. #define PathCombineORD 37
  614. #define PathIsExeORD 43
  615. #define PathMatchSpecORD 46
  616. #define SHGetSetSettingsORD 68
  617. #define SHILCreateFromPathORD 28
  618. #define SHFreeORD 195
  619. #define MemMon_FreeORD 123
  620. //
  621. // Storage name of a scrap/bookmark item
  622. //
  623. #define WSTR_SCRAPITEM L"\003ITEM000"
  624. //
  625. // PifMgr Thunked APIs (in SHELL.DLL)
  626. //
  627. extern int WINAPI PifMgr_OpenProperties(LPCSTR lpszApp, LPCSTR lpszPIF, int hInf, int flOpt);
  628. extern int WINAPI PifMgr_GetProperties(int hProps, LPCSTR lpszGroup, LPVOID lpProps, int cbProps, int flOpt);
  629. extern int WINAPI PifMgr_SetProperties(int hProps, LPCSTR lpszGroup, const VOID FAR *lpProps, int cbProps, int flOpt);
  630. extern int WINAPI PifMgr_CloseProperties(int hProps, int flOpt);
  631. //
  632. // exported from SHSCRAP.DLL
  633. //
  634. #define SCRAP_CREATEFROMDATAOBJECT "Scrap_CreateFromDataObject"
  635. typedef HRESULT (WINAPI FAR * LPFNSCRAPCREATEFROMDATAOBJECT)(LPCSTR pszPath, LPDATAOBJECT pDataObj, BOOL fLink, LPSTR pszNewFile);
  636. extern HRESULT WINAPI Scrap_CreateFromDataObject(LPCSTR pszPath, LPDATAOBJECT pDataObj, BOOL fLink, LPSTR pszNewFile);
  637. WINSHELLAPI void WINAPI SHSetInstanceExplorer(IUnknown *punk);
  638. // Always use TerminateThreadEx.
  639. BOOL APIENTRY TerminateThreadEx(HANDLE hThread, DWORD dwExitCode, BOOL bCleanupFlag);
  640. #define TerminateThread(hThread, dwExitCode) TerminateThreadEx(hThread, dwExitCode, TRUE)
  641. //===========================================================================
  642. #ifdef __cplusplus
  643. }
  644. #endif /* __cplusplus */
  645. #ifndef RC_INVOKED
  646. #pragma pack()
  647. #endif /* !RC_INVOKED */
  648. #endif // _SHELLP_H_