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.

1001 lines
38 KiB

  1. /*
  2. * OLE2UI.H
  3. *
  4. * Published definitions, structures, types, and function prototypes for the
  5. * OLE 2.0 User Interface support library.
  6. *
  7. * Copyright (c)1993 Microsoft Corporation, All Rights Reserved
  8. */
  9. #define NONAMELESSUNION // use strict ANSI standard (for DVOBJ.H)
  10. #ifndef _OLE2UI_H_
  11. #define _OLE2UI_H_
  12. #ifndef RC_INVOKED
  13. #pragma message ("Including OLE2UI.H from " __FILE__)
  14. #endif //RC_INVOKED
  15. #include <windows.h>
  16. #include <shellapi.h>
  17. #include <ole2.h>
  18. #include <string.h>
  19. #include "olestd.h"
  20. #include "uiclass.h"
  21. // -- see below
  22. #ifdef __TURBOC__
  23. #define _getcwd getcwd
  24. #define _itoa itoa
  25. #define __max max
  26. #define _find_t find_t
  27. #endif // __TURBOC__
  28. /*
  29. * Initialization / Uninitialization routines. OleUIInitialize
  30. * MUST be called prior to using any functions in OLE2UI.
  31. */
  32. STDAPI_(BOOL) OleUIInitialize(HINSTANCE);
  33. STDAPI_(BOOL) OleUIUnInitialize(void); // Must be called when completed using functions in OLE2UI
  34. //Dialog Identifiers as passed in Help messages to identify the source.
  35. #define IDD_INSERTOBJECT 1000
  36. #define IDD_CHANGEICON 1001
  37. #define IDD_CONVERT 1002
  38. #define IDD_PASTESPECIAL 1003
  39. #define IDD_EDITLINKS 1004
  40. #define IDD_FILEOPEN 1005
  41. #define IDD_BUSY 1006
  42. #define IDD_LINKSOURCEUNAVAILABLE 1007
  43. #define IDD_CANNOTUPDATELINK 1008
  44. #define IDD_SERVERNOTREG 1009
  45. #define IDD_LINKTYPECHANGED 1010
  46. #define IDD_SERVERNOTFOUND 1011
  47. #define IDD_UPDATELINKS 1012
  48. #define IDD_OUTOFMEMORY 1013
  49. #define IDOK 1
  50. #define IDCANCEL 2
  51. // Stringtable identifers
  52. #define IDS_OLE2UIUNKNOWN 300
  53. #define IDS_OLE2UILINK 301
  54. #define IDS_OLE2UIOBJECT 302
  55. #define IDS_OLE2UIEDIT 303
  56. #define IDS_OLE2UICONVERT 304
  57. #define IDS_OLE2UIEDITLINKCMD_1VERB 305
  58. #define IDS_OLE2UIEDITOBJECTCMD_1VERB 306
  59. #define IDS_OLE2UIEDITLINKCMD_NVERB 307
  60. #define IDS_OLE2UIEDITOBJECTCMD_NVERB 308
  61. #define IDS_OLE2UIEDITNOOBJCMD 309
  62. #define IDS_DEFICONLABEL 310 // def. icon label (usu. "Document")
  63. #define IDS_FILTERS 64
  64. #define IDS_ICONFILTERS 65
  65. //Resource identifiers for bitmaps
  66. #define IDB_RESULTSEGA 10
  67. #define IDB_RESULTSVGA 11
  68. #define IDB_RESULTSHIRESVGA 12
  69. //Missing from windows.h
  70. #ifndef PVOID
  71. typedef VOID *PVOID;
  72. #endif
  73. //Hook type used in all structures.
  74. typedef UINT (CALLBACK *LPFNOLEUIHOOK)(HWND, UINT, WPARAM, LPARAM);
  75. //Strings for registered messages
  76. #define SZOLEUI_MSG_HELP "OLEUI_MSG_HELP"
  77. #define SZOLEUI_MSG_ENDDIALOG "OLEUI_MSG_ENDDIALOG"
  78. #define SZOLEUI_MSG_BROWSE "OLEUI_MSG_BROWSE"
  79. #define SZOLEUI_MSG_CHANGEICON "OLEUI_MSG_CHANGEICON"
  80. #define SZOLEUI_MSG_CLOSEBUSYDIALOG "OLEUI_MSG_CLOSEBUSYDIALOG"
  81. #define SZOLEUI_MSG_FILEOKSTRING "OLEUI_MSG_FILEOKSTRING"
  82. // Define the classname strings. The strings below define the custom
  83. // control classnames for the controls used in the UI dialogs.
  84. //
  85. // **************************************************************
  86. // These classnames must be distinct for each application
  87. // which uses this library, or your application will generate an
  88. // fatal error under the debugging version of Windows 3.1.
  89. // **************************************************************
  90. //
  91. // The MAKEFILE for this library automatically generates a file
  92. // uiclass.h which contains distinct definitions for these
  93. // classname strings, as long as you use a distinct name when
  94. // you build the library. See the MAKEFILE for more information
  95. // on setting the name of the library.
  96. #define SZCLASSICONBOX OLEUICLASS1
  97. #define SZCLASSRESULTIMAGE OLEUICLASS2
  98. #define OLEUI_ERR_STANDARDMIN 100
  99. #define OLEUI_ERR_STRUCTURENULL 101 //Standard field validation
  100. #define OLEUI_ERR_STRUCTUREINVALID 102
  101. #define OLEUI_ERR_CBSTRUCTINCORRECT 103
  102. #define OLEUI_ERR_HWNDOWNERINVALID 104
  103. #define OLEUI_ERR_LPSZCAPTIONINVALID 105
  104. #define OLEUI_ERR_LPFNHOOKINVALID 106
  105. #define OLEUI_ERR_HINSTANCEINVALID 107
  106. #define OLEUI_ERR_LPSZTEMPLATEINVALID 108
  107. #define OLEUI_ERR_HRESOURCEINVALID 109
  108. #define OLEUI_ERR_FINDTEMPLATEFAILURE 110 //Initialization errors
  109. #define OLEUI_ERR_LOADTEMPLATEFAILURE 111
  110. #define OLEUI_ERR_DIALOGFAILURE 112
  111. #define OLEUI_ERR_LOCALMEMALLOC 113
  112. #define OLEUI_ERR_GLOBALMEMALLOC 114
  113. #define OLEUI_ERR_LOADSTRING 115
  114. #define OLEUI_ERR_STANDARDMAX 116 //Start here for specific errors.
  115. //Help Button Identifier
  116. #define ID_OLEUIHELP 99
  117. // Help button for fileopen.dlg (need this for resizing) 1038 is pshHelp
  118. #define IDHELP 1038
  119. // Static text control (use this instead of -1 so things work correctly for
  120. // localization
  121. #define ID_STATIC 98
  122. //Maximum key size we read from the RegDB.
  123. #define OLEUI_CCHKEYMAX 256 // make any changes to this in geticon.c too
  124. //Maximum verb length and length of Object menu
  125. #define OLEUI_CCHVERBMAX 32
  126. #define OLEUI_OBJECTMENUMAX 64
  127. //Maximum MS-DOS pathname.
  128. #define OLEUI_CCHPATHMAX 256 // make any changes to this in geticon.c too
  129. #define OLEUI_CCHFILEMAX 13
  130. //Icon label length
  131. #define OLEUI_CCHLABELMAX 40 // make any changes to this in geticon.c too
  132. //Length of the CLSID string
  133. #define OLEUI_CCHCLSIDSTRING 39
  134. /*
  135. * What follows here are first function prototypes for general utility
  136. * functions, then sections laid out by dialog. Each dialog section
  137. * defines the dialog structure, the API prototype, flags for the dwFlags
  138. * field, the dialog-specific error values, and dialog control IDs (for
  139. * hooks and custom templates.
  140. */
  141. //Miscellaneous utility functions.
  142. STDAPI_(BOOL) OleUIAddVerbMenu(LPOLEOBJECT lpOleObj,
  143. LPSTR lpszShortType,
  144. HMENU hMenu,
  145. UINT uPos,
  146. UINT uIDVerbMin,
  147. BOOL bAddConvert,
  148. UINT idConvert,
  149. HMENU FAR *lphMenu);
  150. //Metafile utility functions
  151. STDAPI_(HGLOBAL) OleUIMetafilePictFromIconAndLabel(HICON, LPSTR, LPSTR, UINT);
  152. STDAPI_(void) OleUIMetafilePictIconFree(HGLOBAL);
  153. STDAPI_(BOOL) OleUIMetafilePictIconDraw(HDC, LPRECT, HGLOBAL, BOOL);
  154. STDAPI_(UINT) OleUIMetafilePictExtractLabel(HGLOBAL, LPSTR, UINT, LPDWORD);
  155. STDAPI_(HICON) OleUIMetafilePictExtractIcon(HGLOBAL);
  156. STDAPI_(BOOL) OleUIMetafilePictExtractIconSource(HGLOBAL,LPSTR,UINT FAR *);
  157. /*************************************************************************
  158. ** INSERT OBJECT DIALOG
  159. *************************************************************************/
  160. typedef struct tagOLEUIINSERTOBJECT
  161. {
  162. //These IN fields are standard across all OLEUI dialog functions.
  163. DWORD cbStruct; //Structure Size
  164. DWORD dwFlags; //IN-OUT: Flags
  165. HWND hWndOwner; //Owning window
  166. LPCSTR lpszCaption; //Dialog caption bar contents
  167. LPFNOLEUIHOOK lpfnHook; //Hook callback
  168. LPARAM lCustData; //Custom data to pass to hook
  169. HINSTANCE hInstance; //Instance for customized template name
  170. LPCSTR lpszTemplate; //Customized template name
  171. HRSRC hResource; //Customized template handle
  172. //Specifics for OLEUIINSERTOBJECT. All are IN-OUT unless otherwise spec.
  173. CLSID clsid; //Return space for class ID
  174. LPSTR lpszFile; //Filename for inserts or links
  175. UINT cchFile; //Size of lpszFile buffer: OLEUI_CCHPATHMAX
  176. UINT cClsidExclude; //IN only: CLSIDs in lpClsidExclude
  177. LPCLSID lpClsidExclude; //List of CLSIDs to exclude from listing.
  178. //Specific to create objects if flags say so
  179. IID iid; //Requested interface on creation.
  180. DWORD oleRender; //Rendering option
  181. LPFORMATETC lpFormatEtc; //Desired format
  182. LPOLECLIENTSITE lpIOleClientSite; //Site to be use for the object.
  183. LPSTORAGE lpIStorage; //Storage used for the object
  184. LPVOID FAR *ppvObj; //Where the object is returned.
  185. SCODE sc; //Result of creation calls.
  186. HGLOBAL hMetaPict; //OUT: METAFILEPICT containing iconic aspect.
  187. //IFF we couldn't stuff it in the cache.
  188. } OLEUIINSERTOBJECT, *POLEUIINSERTOBJECT, FAR *LPOLEUIINSERTOBJECT;
  189. //API prototype
  190. STDAPI_(UINT) OleUIInsertObject(LPOLEUIINSERTOBJECT);
  191. //Insert Object flags
  192. #define IOF_SHOWHELP 0x00000001L
  193. #define IOF_SELECTCREATENEW 0x00000002L
  194. #define IOF_SELECTCREATEFROMFILE 0x00000004L
  195. #define IOF_CHECKLINK 0x00000008L
  196. #define IOF_CHECKDISPLAYASICON 0x00000010L
  197. #define IOF_CREATENEWOBJECT 0x00000020L
  198. #define IOF_CREATEFILEOBJECT 0x00000040L
  199. #define IOF_CREATELINKOBJECT 0x00000080L
  200. #define IOF_DISABLELINK 0x00000100L
  201. #define IOF_VERIFYSERVERSEXIST 0x00000200L
  202. //Insert Object specific error codes
  203. #define OLEUI_IOERR_LPSZFILEINVALID (OLEUI_ERR_STANDARDMAX+0)
  204. #define OLEUI_IOERR_LPSZLABELINVALID (OLEUI_ERR_STANDARDMAX+1)
  205. #define OLEUI_IOERR_HICONINVALID (OLEUI_ERR_STANDARDMAX+2)
  206. #define OLEUI_IOERR_LPFORMATETCINVALID (OLEUI_ERR_STANDARDMAX+3)
  207. #define OLEUI_IOERR_PPVOBJINVALID (OLEUI_ERR_STANDARDMAX+4)
  208. #define OLEUI_IOERR_LPIOLECLIENTSITEINVALID (OLEUI_ERR_STANDARDMAX+5)
  209. #define OLEUI_IOERR_LPISTORAGEINVALID (OLEUI_ERR_STANDARDMAX+6)
  210. #define OLEUI_IOERR_SCODEHASERROR (OLEUI_ERR_STANDARDMAX+7)
  211. #define OLEUI_IOERR_LPCLSIDEXCLUDEINVALID (OLEUI_ERR_STANDARDMAX+8)
  212. #define OLEUI_IOERR_CCHFILEINVALID (OLEUI_ERR_STANDARDMAX+9)
  213. //Insert Object Dialog identifiers
  214. #define ID_IO_CREATENEW 2100
  215. #define ID_IO_CREATEFROMFILE 2101
  216. #define ID_IO_LINKFILE 2102
  217. #define ID_IO_OBJECTTYPELIST 2103
  218. #define ID_IO_DISPLAYASICON 2104
  219. #define ID_IO_CHANGEICON 2105
  220. #define ID_IO_FILE 2106
  221. #define ID_IO_FILEDISPLAY 2107
  222. #define ID_IO_RESULTIMAGE 2108
  223. #define ID_IO_RESULTTEXT 2109
  224. #define ID_IO_ICONDISPLAY 2110
  225. #define ID_IO_OBJECTTYPETEXT 2111
  226. #define ID_IO_FILETEXT 2112
  227. #define ID_IO_FILETYPE 2113
  228. // Strings in OLE2UI resources
  229. #define IDS_IORESULTNEW 256
  230. #define IDS_IORESULTNEWICON 257
  231. #define IDS_IORESULTFROMFILE1 258
  232. #define IDS_IORESULTFROMFILE2 259
  233. #define IDS_IORESULTFROMFILEICON2 260
  234. #define IDS_IORESULTLINKFILE1 261
  235. #define IDS_IORESULTLINKFILE2 262
  236. #define IDS_IORESULTLINKFILEICON1 263
  237. #define IDS_IORESULTLINKFILEICON2 264
  238. /*************************************************************************
  239. ** PASTE SPECIAL DIALOG
  240. *************************************************************************/
  241. // Maximum number of link types
  242. #define PS_MAXLINKTYPES 8
  243. //NOTE: OLEUIPASTEENTRY and OLEUIPASTEFLAG structs are defined in OLESTD.H
  244. typedef struct tagOLEUIPASTESPECIAL
  245. {
  246. //These IN fields are standard across all OLEUI dialog functions.
  247. DWORD cbStruct; //Structure Size
  248. DWORD dwFlags; //IN-OUT: Flags
  249. HWND hWndOwner; //Owning window
  250. LPCSTR lpszCaption; //Dialog caption bar contents
  251. LPFNOLEUIHOOK lpfnHook; //Hook callback
  252. LPARAM lCustData; //Custom data to pass to hook
  253. HINSTANCE hInstance; //Instance for customized template name
  254. LPCSTR lpszTemplate; //Customized template name
  255. HRSRC hResource; //Customized template handle
  256. //Specifics for OLEUIPASTESPECIAL.
  257. //IN fields
  258. LPDATAOBJECT lpSrcDataObj; //Source IDataObject* (on the clipboard) for data to paste
  259. LPOLEUIPASTEENTRY arrPasteEntries; //OLEUIPASTEENTRY array which specifies acceptable formats. See
  260. // OLEUIPASTEENTRY for more information.
  261. int cPasteEntries; //Number of OLEUIPASTEENTRY array entries
  262. UINT FAR *arrLinkTypes; //List of link types that are acceptable. Link types are referred
  263. // to using OLEUIPASTEFLAGS in arrPasteEntries
  264. int cLinkTypes; //Number of link types
  265. //OUT fields
  266. int nSelectedIndex; //Index of arrPasteEntries[] that the user selected
  267. BOOL fLink; //Indicates if Paste or Paste Link was selected by the user
  268. HGLOBAL hMetaPict; //Handle to Metafile containing icon and icon title selected by the user
  269. // Use the Metafile utility functions defined in this header to
  270. // manipulate hMetaPict
  271. } OLEUIPASTESPECIAL, *POLEUIPASTESPECIAL, FAR *LPOLEUIPASTESPECIAL;
  272. //API to bring up PasteSpecial dialog
  273. STDAPI_(UINT) OleUIPasteSpecial(LPOLEUIPASTESPECIAL);
  274. //Paste Special flags
  275. // Show Help button. IN flag.
  276. #define PSF_SHOWHELP 0x00000001L
  277. // Select Paste radio button at dialog startup. This is the default if PSF_SELECTPASTE or PSF_SELECTPASTELINK
  278. // are not specified. Also specifies state of button on dialog termination. IN/OUT flag.
  279. #define PSF_SELECTPASTE 0x00000002L
  280. // Select PasteLink radio button at dialog startup. Also specifies state of button on dialog termination.
  281. // IN/OUT flag.
  282. #define PSF_SELECTPASTELINK 0x00000004L
  283. // Specfies if DisplayAsIcon button was checked on dialog termination. OUT flag.
  284. #define PSF_CHECKDISPLAYASICON 0x00000008L
  285. //Paste Special specific error codes
  286. #define OLEUI_IOERR_SRCDATAOBJECTINVALID (OLEUI_ERR_STANDARDMAX+0)
  287. #define OLEUI_IOERR_ARRPASTEENTRIESINVALID (OLEUI_ERR_STANDARDMAX+1)
  288. #define OLEUI_IOERR_ARRLINKTYPESINVALID (OLEUI_ERR_STANDARDMAX+2)
  289. #define OLEUI_PSERR_CLIPBOARDCHANGED (OLEUI_ERR_STANDARDMAX+3)
  290. //Paste Special Dialog identifiers
  291. #define ID_PS_PASTE 500
  292. #define ID_PS_PASTELINK 501
  293. #define ID_PS_SOURCETEXT 502
  294. #define ID_PS_PASTELIST 503
  295. #define ID_PS_PASTELINKLIST 504
  296. #define ID_PS_DISPLAYLIST 505
  297. #define ID_PS_DISPLAYASICON 506
  298. #define ID_PS_ICONDISPLAY 507
  299. #define ID_PS_CHANGEICON 508
  300. #define ID_PS_RESULTIMAGE 509
  301. #define ID_PS_RESULTTEXT 510
  302. #define ID_PS_RESULTGROUP 511
  303. #define ID_PS_STXSOURCE 512
  304. #define ID_PS_STXAS 513
  305. // Paste Special String IDs
  306. #define IDS_PSPASTEDATA 400
  307. #define IDS_PSPASTEOBJECT 401
  308. #define IDS_PSPASTEOBJECTASICON 402
  309. #define IDS_PSPASTELINKDATA 403
  310. #define IDS_PSPASTELINKOBJECT 404
  311. #define IDS_PSPASTELINKOBJECTASICON 405
  312. #define IDS_PSNONOLE 406
  313. #define IDS_PSUNKNOWNTYPE 407
  314. #define IDS_PSUNKNOWNSRC 408
  315. #define IDS_PSUNKNOWNAPP 409
  316. /*************************************************************************
  317. ** EDIT LINKS DIALOG
  318. *************************************************************************/
  319. /* IOleUILinkContainer Interface
  320. ** -----------------------------
  321. ** This interface must be implemented by container applications that
  322. ** want to use the EditLinks dialog. the EditLinks dialog calls back
  323. ** to the container app to perform the OLE functions to manipulate
  324. ** the links within the container.
  325. */
  326. #define LPOLEUILINKCONTAINER IOleUILinkContainer FAR*
  327. #undef INTERFACE
  328. #define INTERFACE IOleUILinkContainer
  329. DECLARE_INTERFACE_(IOleUILinkContainer, IUnknown)
  330. {
  331. //*** IUnknown methods ***/
  332. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  333. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  334. STDMETHOD_(ULONG,Release) (THIS) PURE;
  335. STDMETHOD_(DWORD,GetNextLink) (THIS_ DWORD dwLink) PURE;
  336. STDMETHOD(SetLinkUpdateOptions) (THIS_ DWORD dwLink, DWORD dwUpdateOpt) PURE;
  337. STDMETHOD(GetLinkUpdateOptions) (THIS_ DWORD dwLink, DWORD FAR* lpdwUpdateOpt) PURE;
  338. STDMETHOD(SetLinkSource) (THIS_
  339. DWORD dwLink,
  340. LPSTR lpszDisplayName,
  341. ULONG lenFileName,
  342. ULONG FAR* pchEaten,
  343. BOOL fValidateSource) PURE;
  344. STDMETHOD(GetLinkSource) (THIS_
  345. DWORD dwLink,
  346. LPSTR FAR* lplpszDisplayName,
  347. ULONG FAR* lplenFileName,
  348. LPSTR FAR* lplpszFullLinkType,
  349. LPSTR FAR* lplpszShortLinkType,
  350. BOOL FAR* lpfSourceAvailable,
  351. BOOL FAR* lpfIsSelected) PURE;
  352. STDMETHOD(OpenLinkSource) (THIS_ DWORD dwLink) PURE;
  353. STDMETHOD(UpdateLink) (THIS_
  354. DWORD dwLink,
  355. BOOL fErrorMessage,
  356. BOOL fErrorAction) PURE;
  357. STDMETHOD(CancelLink) (THIS_ DWORD dwLink) PURE;
  358. };
  359. typedef struct tagOLEUIEDITLINKS
  360. {
  361. //These IN fields are standard across all OLEUI dialog functions.
  362. DWORD cbStruct; //Structure Size
  363. DWORD dwFlags; //IN-OUT: Flags
  364. HWND hWndOwner; //Owning window
  365. LPCSTR lpszCaption; //Dialog caption bar contents
  366. LPFNOLEUIHOOK lpfnHook; //Hook callback
  367. LPARAM lCustData; //Custom data to pass to hook
  368. HINSTANCE hInstance; //Instance for customized template name
  369. LPCSTR lpszTemplate; //Customized template name
  370. HRSRC hResource; //Customized template handle
  371. //Specifics for OLEUI<STRUCT>. All are IN-OUT unless otherwise spec.
  372. LPOLEUILINKCONTAINER lpOleUILinkContainer; //IN: Interface to manipulate
  373. //links in the container
  374. } OLEUIEDITLINKS, *POLEUIEDITLINKS, FAR *LPOLEUIEDITLINKS;
  375. //API Prototype
  376. STDAPI_(UINT) OleUIEditLinks(LPOLEUIEDITLINKS);
  377. // Edit Links flags
  378. #define ELF_SHOWHELP 0x00000001L
  379. // Edit Links Dialog identifiers
  380. #define ID_EL_CHANGESOURCE 201
  381. #define ID_EL_AUTOMATIC 202
  382. #define ID_EL_CLOSE 208
  383. #define ID_EL_CANCELLINK 209
  384. #define ID_EL_UPDATENOW 210
  385. #define ID_EL_OPENSOURCE 211
  386. #define ID_EL_MANUAL 212
  387. #define ID_EL_LINKSOURCE 216
  388. #define ID_EL_LINKTYPE 217
  389. #define ID_EL_UPDATE 218
  390. #define ID_EL_NULL -1
  391. #define ID_EL_LINKSLISTBOX 206
  392. #define ID_EL_HELP 207
  393. #define ID_EL_COL1 223
  394. #define ID_EL_COL2 221
  395. #define ID_EL_COL3 222
  396. /*************************************************************************
  397. ** CHANGE ICON DIALOG
  398. *************************************************************************/
  399. typedef struct tagOLEUICHANGEICON
  400. {
  401. //These IN fields are standard across all OLEUI dialog functions.
  402. DWORD cbStruct; //Structure Size
  403. DWORD dwFlags; //IN-OUT: Flags
  404. HWND hWndOwner; //Owning window
  405. LPCSTR lpszCaption; //Dialog caption bar contents
  406. LPFNOLEUIHOOK lpfnHook; //Hook callback
  407. LPARAM lCustData; //Custom data to pass to hook
  408. HINSTANCE hInstance; //Instance for customized template name
  409. LPCSTR lpszTemplate; //Customized template name
  410. HRSRC hResource; //Customized template handle
  411. //Specifics for OLEUICHANGEICON. All are IN-OUT unless otherwise spec.
  412. HGLOBAL hMetaPict; //Current and final image. Source of the
  413. //icon is embedded in the metafile itself.
  414. CLSID clsid; //IN only: class used to get Default icon
  415. char szIconExe[OLEUI_CCHPATHMAX];
  416. int cchIconExe;
  417. } OLEUICHANGEICON, *POLEUICHANGEICON, FAR *LPOLEUICHANGEICON;
  418. //API prototype
  419. STDAPI_(UINT) OleUIChangeIcon(LPOLEUICHANGEICON);
  420. //Change Icon flags
  421. #define CIF_SHOWHELP 0x00000001L
  422. #define CIF_SELECTCURRENT 0x00000002L
  423. #define CIF_SELECTDEFAULT 0x00000004L
  424. #define CIF_SELECTFROMFILE 0x00000008L
  425. #define CIF_USEICONEXE 0x0000000aL
  426. //Change Icon specific error codes
  427. #define OLEUI_CIERR_MUSTHAVECLSID (OLEUI_ERR_STANDARDMAX+0)
  428. #define OLEUI_CIERR_MUSTHAVECURRENTMETAFILE (OLEUI_ERR_STANDARDMAX+1)
  429. #define OLEUI_CIERR_SZICONEXEINVALID (OLEUI_ERR_STANDARDMAX+2)
  430. //Change Icon Dialog identifiers
  431. #define ID_GROUP 120
  432. #define ID_CURRENT 121
  433. #define ID_CURRENTICON 122
  434. #define ID_DEFAULT 123
  435. #define ID_DEFAULTICON 124
  436. #define ID_FROMFILE 125
  437. #define ID_FROMFILEEDIT 126
  438. #define ID_ICONLIST 127
  439. #define ID_LABEL 128
  440. #define ID_LABELEDIT 129
  441. #define ID_BROWSE 130
  442. #define ID_RESULTICON 132
  443. #define ID_RESULTLABEL 133
  444. // Stringtable defines for Change Icon
  445. #define IDS_CINOICONSINFILE 288
  446. #define IDS_CIINVALIDFILE 289
  447. #define IDS_CIFILEACCESS 290
  448. #define IDS_CIFILESHARE 291
  449. #define IDS_CIFILEOPENFAIL 292
  450. /*************************************************************************
  451. ** CONVERT DIALOG
  452. *************************************************************************/
  453. typedef struct tagOLEUICONVERT
  454. {
  455. //These IN fields are standard across all OLEUI dialog functions.
  456. DWORD cbStruct; //Structure Size
  457. DWORD dwFlags; //IN-OUT: Flags
  458. HWND hWndOwner; //Owning window
  459. LPCSTR lpszCaption; //Dialog caption bar contents
  460. LPFNOLEUIHOOK lpfnHook; //Hook callback
  461. LPARAM lCustData; //Custom data to pass to hook
  462. HINSTANCE hInstance; //Instance for customized template name
  463. LPCSTR lpszTemplate; //Customized template name
  464. HRSRC hResource; //Customized template handle
  465. //Specifics for OLEUICONVERT. All are IN-OUT unless otherwise spec.
  466. CLSID clsid; //Class ID sent in to dialog: IN only
  467. CLSID clsidConvertDefault; //Class ID to use as convert default: IN only
  468. CLSID clsidActivateDefault; //Class ID to use as activate default: IN only
  469. CLSID clsidNew; //Selected Class ID: OUT only
  470. DWORD dvAspect; //IN-OUT, either DVASPECT_CONTENT or
  471. //DVASPECT_ICON
  472. WORD wFormat; //Original data format
  473. BOOL fIsLinkedObject; //IN only; true if object is linked
  474. HGLOBAL hMetaPict; //IN-OUT: METAFILEPICT containing iconic aspect.
  475. LPSTR lpszUserType; //IN: user type name of original class. We'll do lookup if it's NULL.
  476. //This gets freed on exit.
  477. BOOL fObjectsIconChanged; // OUT; TRUE if ChangeIcon was called (and not cancelled)
  478. } OLEUICONVERT, *POLEUICONVERT, FAR *LPOLEUICONVERT;
  479. //API prototype
  480. STDAPI_(UINT) OleUIConvert(LPOLEUICONVERT);
  481. //Convert Dialog flags
  482. // IN only: Shows "HELP" button
  483. #define CF_SHOWHELPBUTTON 0x00000001L
  484. // IN only: lets you set the convert default object - the one that is
  485. // selected as default in the convert listbox.
  486. #define CF_SETCONVERTDEFAULT 0x00000002L
  487. // IN only: lets you set the activate default object - the one that is
  488. // selected as default in the activate listbox.
  489. #define CF_SETACTIVATEDEFAULT 0x00000004L
  490. // IN/OUT: Selects the "Convert To" radio button, is set on exit if
  491. // this button was selected
  492. #define CF_SELECTCONVERTTO 0x00000008L
  493. // IN/OUT: Selects the "Activate As" radio button, is set on exit if
  494. // this button was selected
  495. #define CF_SELECTACTIVATEAS 0x00000010L
  496. //Convert specific error codes
  497. #define OLEUI_CTERR_CLASSIDINVALID (OLEUI_ERR_STANDARDMAX+1)
  498. #define OLEUI_CTERR_DVASPECTINVALID (OLEUI_ERR_STANDARDMAX+2)
  499. #define OLEUI_CTERR_CBFORMATINVALID (OLEUI_ERR_STANDARDMAX+3)
  500. #define OLEUI_CTERR_HMETAPICTINVALID (OLEUI_ERR_STANDARDMAX+4)
  501. #define OLEUI_CTERR_STRINGINVALID (OLEUI_ERR_STANDARDMAX+5)
  502. //Convert Dialog identifiers
  503. #define IDCV_OBJECTTYPE 150
  504. #define IDCV_HELP 151
  505. #define IDCV_DISPLAYASICON 152
  506. #define IDCV_CHANGEICON 153
  507. #define IDCV_ACTIVATELIST 154
  508. #define IDCV_CONVERTTO 155
  509. #define IDCV_ACTIVATEAS 156
  510. #define IDCV_RESULTTEXT 157
  511. #define IDCV_CONVERTLIST 158
  512. #define IDCV_ICON 159
  513. #define IDCV_ICONLABEL1 160
  514. #define IDCV_ICONLABEL2 161
  515. #define IDCV_STXCURTYPE 162
  516. #define IDCV_GRPRESULT 163
  517. #define IDCV_STXCONVERTTO 164
  518. // String IDs for Convert dialog
  519. #define IDS_CVRESULTCONVERTLINK 500
  520. #define IDS_CVRESULTCONVERTTO 501
  521. #define IDS_CVRESULTNOCHANGE 502
  522. #define IDS_CVRESULTDISPLAYASICON 503
  523. #define IDS_CVRESULTACTIVATEAS 504
  524. #define IDS_CVRESULTACTIVATEDIFF 505
  525. /*************************************************************************
  526. ** BUSY DIALOG
  527. *************************************************************************/
  528. typedef struct tagOLEUIBUSY
  529. {
  530. //These IN fields are standard across all OLEUI dialog functions.
  531. DWORD cbStruct; //Structure Size
  532. DWORD dwFlags; //IN-OUT: Flags ** NOTE ** this dialog has no flags
  533. HWND hWndOwner; //Owning window
  534. LPCSTR lpszCaption; //Dialog caption bar contents
  535. LPFNOLEUIHOOK lpfnHook; //Hook callback
  536. LPARAM lCustData; //Custom data to pass to hook
  537. HINSTANCE hInstance; //Instance for customized template name
  538. LPCSTR lpszTemplate; //Customized template name
  539. HRSRC hResource; //Customized template handle
  540. //Specifics for OLEUIBUSY.
  541. HTASK hTask; //IN: HTask which is blocking
  542. HWND FAR * lphWndDialog; //IN: Dialog's HWND is placed here
  543. } OLEUIBUSY, *POLEUIBUSY, FAR *LPOLEUIBUSY;
  544. //API prototype
  545. STDAPI_(UINT) OleUIBusy(LPOLEUIBUSY);
  546. // Flags for this dialog
  547. // IN only: Disables "Cancel" button
  548. #define BZ_DISABLECANCELBUTTON 0x00000001L
  549. // IN only: Disables "Switch To..." button
  550. #define BZ_DISABLESWITCHTOBUTTON 0x00000002L
  551. // IN only: Disables "Retry" button
  552. #define BZ_DISABLERETRYBUTTON 0x00000004L
  553. // IN only: Generates a "Not Responding" dialog as opposed to the
  554. // "Busy" dialog. The wording in the text is slightly different, and
  555. // the "Cancel" button is grayed out if you set this flag.
  556. #define BZ_NOTRESPONDINGDIALOG 0x00000008L
  557. // Busy specific error/return codes
  558. #define OLEUI_BZERR_HTASKINVALID (OLEUI_ERR_STANDARDMAX+0)
  559. // SWITCHTOSELECTED is returned when user hit "switch to"
  560. #define OLEUI_BZ_SWITCHTOSELECTED (OLEUI_ERR_STANDARDMAX+1)
  561. // RETRYSELECTED is returned when user hit "retry"
  562. #define OLEUI_BZ_RETRYSELECTED (OLEUI_ERR_STANDARDMAX+2)
  563. // CALLUNBLOCKED is returned when call has been unblocked
  564. #define OLEUI_BZ_CALLUNBLOCKED (OLEUI_ERR_STANDARDMAX+3)
  565. // Busy dialog identifiers
  566. #define IDBZ_RETRY 600
  567. #define IDBZ_ICON 601
  568. #define IDBZ_MESSAGE1 602
  569. #define IDBZ_SWITCHTO 604
  570. // Busy dialog stringtable defines
  571. #define IDS_BZRESULTTEXTBUSY 601
  572. #define IDS_BZRESULTTEXTNOTRESPONDING 602
  573. // Links dialog stringtable defines
  574. #define IDS_LINK_AUTO 800
  575. #define IDS_LINK_MANUAL 801
  576. #define IDS_LINK_UNKNOWN 802
  577. #define IDS_LINKS 803
  578. #define IDS_FAILED 804
  579. #define IDS_CHANGESOURCE 805
  580. #define IDS_INVALIDSOURCE 806
  581. #define IDS_ERR_GETLINKSOURCE 807
  582. #define IDS_ERR_GETLINKUPDATEOPTIONS 808
  583. #define IDS_ERR_ADDSTRING 809
  584. #define IDS_CHANGEADDITIONALLINKS 810
  585. /*************************************************************************
  586. ** PROMPT USER DIALOGS
  587. *************************************************************************/
  588. #define ID_PU_LINKS 900
  589. #define ID_PU_TEXT 901
  590. #define ID_PU_CONVERT 902
  591. #define ID_PU_HELP 903
  592. #define ID_PU_BROWSE 904
  593. #define ID_PU_METER 905
  594. #define ID_PU_PERCENT 906
  595. #define ID_PU_STOP 907
  596. // used for -1 ids in dialogs:
  597. #define ID_DUMMY 999
  598. /* inside ole2ui.c */
  599. #ifdef __cplusplus
  600. extern "C"
  601. #endif
  602. int __export FAR CDECL OleUIPromptUser(int nTemplate, HWND hwndParent, ...);
  603. STDAPI_(BOOL) OleUIUpdateLinks(
  604. LPOLEUILINKCONTAINER lpOleUILinkCntr,
  605. HWND hwndParent,
  606. LPSTR lpszTitle,
  607. int cLinks);
  608. /*************************************************************************
  609. ** OLE OBJECT FEEDBACK EFFECTS
  610. *************************************************************************/
  611. #define OLEUI_HANDLES_USEINVERSE 0x00000001L
  612. #define OLEUI_HANDLES_NOBORDER 0x00000002L
  613. #define OLEUI_HANDLES_INSIDE 0x00000004L
  614. #define OLEUI_HANDLES_OUTSIDE 0x00000008L
  615. /* objfdbk.c function prototypes */
  616. STDAPI_(void) OleUIDrawHandles(LPRECT lpRect, HDC hdc, DWORD dwFlags, UINT cSize, BOOL fDraw);
  617. STDAPI_(void) OleUIDrawShading(LPRECT lpRect, HDC hdc, DWORD dwFlags, UINT cWidth);
  618. STDAPI_(void) OleUIShowObject(LPCRECT lprc, HDC hdc, BOOL fIsLink);
  619. /*************************************************************************
  620. ** Hatch window definitions and prototypes **
  621. *************************************************************************/
  622. #define DEFAULT_HATCHBORDER_WIDTH 4
  623. STDAPI_(BOOL) RegisterHatchWindowClass(HINSTANCE hInst);
  624. STDAPI_(HWND) CreateHatchWindow(HWND hWndParent, HINSTANCE hInst);
  625. STDAPI_(UINT) GetHatchWidth(HWND hWndHatch);
  626. STDAPI_(void) GetHatchRect(HWND hWndHatch, LPRECT lpHatchRect);
  627. STDAPI_(void) SetHatchRect(HWND hWndHatch, LPRECT lprcHatchRect);
  628. STDAPI_(void) SetHatchWindowSize(
  629. HWND hWndHatch,
  630. LPRECT lprcIPObjRect,
  631. LPRECT lprcClipRect,
  632. LPPOINT lpptOffset
  633. );
  634. /*************************************************************************
  635. ** VERSION VERIFICATION INFORMATION
  636. *************************************************************************/
  637. // The following magic number is used to verify that the resources we bind
  638. // to our EXE are the same "version" as the LIB (or DLL) file which
  639. // contains these routines. This is not the same as the Version information
  640. // resource that we place in OLE2UI.RC, this is a special ID that we will
  641. // have compiled in to our EXE. Upon initialization of OLE2UI, we will
  642. // look in our resources for an RCDATA called "VERIFICATION" (see OLE2UI.RC),
  643. // and make sure that the magic number there equals the magic number below.
  644. #define OLEUI_VERSION_MAGIC 0x4D42
  645. #endif //_OLE2UI_H_
  646. /*****************************************************************************\
  647. * *
  648. * dlgs.h - Common dialog's dialog element ID numbers *
  649. * *
  650. * Version 1.0 *
  651. * *
  652. * Copyright (c) 1992, Microsoft Corp. All rights reserved. *
  653. * *
  654. \*****************************************************************************/
  655. #ifndef _INC_DLGS
  656. #define _INC_DLGS
  657. #define ctlFirst 0x0400
  658. #define ctlLast 0x04ff
  659. /* Push buttons */
  660. #define psh1 0x0400
  661. #define psh2 0x0401
  662. #define psh3 0x0402
  663. #define psh4 0x0403
  664. #define psh5 0x0404
  665. #define psh6 0x0405
  666. #define psh7 0x0406
  667. #define psh8 0x0407
  668. #define psh9 0x0408
  669. #define psh10 0x0409
  670. #define psh11 0x040a
  671. #define psh12 0x040b
  672. #define psh13 0x040c
  673. #define psh14 0x040d
  674. #define psh15 0x040e
  675. #define pshHelp psh15
  676. #define psh16 0x040f
  677. /* Checkboxes */
  678. #define chx1 0x0410
  679. #define chx2 0x0411
  680. #define chx3 0x0412
  681. #define chx4 0x0413
  682. #define chx5 0x0414
  683. #define chx6 0x0415
  684. #define chx7 0x0416
  685. #define chx8 0x0417
  686. #define chx9 0x0418
  687. #define chx10 0x0419
  688. #define chx11 0x041a
  689. #define chx12 0x041b
  690. #define chx13 0x041c
  691. #define chx14 0x041d
  692. #define chx15 0x041e
  693. #define chx16 0x041f
  694. /* Radio buttons */
  695. #define rad1 0x0420
  696. #define rad2 0x0421
  697. #define rad3 0x0422
  698. #define rad4 0x0423
  699. #define rad5 0x0424
  700. #define rad6 0x0425
  701. #define rad7 0x0426
  702. #define rad8 0x0427
  703. #define rad9 0x0428
  704. #define rad10 0x0429
  705. #define rad11 0x042a
  706. #define rad12 0x042b
  707. #define rad13 0x042c
  708. #define rad14 0x042d
  709. #define rad15 0x042e
  710. #define rad16 0x042f
  711. /* Groups, frames, rectangles, and icons */
  712. #define grp1 0x0430
  713. #define grp2 0x0431
  714. #define grp3 0x0432
  715. #define grp4 0x0433
  716. #define frm1 0x0434
  717. #define frm2 0x0435
  718. #define frm3 0x0436
  719. #define frm4 0x0437
  720. #define rct1 0x0438
  721. #define rct2 0x0439
  722. #define rct3 0x043a
  723. #define rct4 0x043b
  724. #define ico1 0x043c
  725. #define ico2 0x043d
  726. #define ico3 0x043e
  727. #define ico4 0x043f
  728. /* Static text */
  729. #define stc1 0x0440
  730. #define stc2 0x0441
  731. #define stc3 0x0442
  732. #define stc4 0x0443
  733. #define stc5 0x0444
  734. #define stc6 0x0445
  735. #define stc7 0x0446
  736. #define stc8 0x0447
  737. #define stc9 0x0448
  738. #define stc10 0x0449
  739. #define stc11 0x044a
  740. #define stc12 0x044b
  741. #define stc13 0x044c
  742. #define stc14 0x044d
  743. #define stc15 0x044e
  744. #define stc16 0x044f
  745. #define stc17 0x0450
  746. #define stc18 0x0451
  747. #define stc19 0x0452
  748. #define stc20 0x0453
  749. #define stc21 0x0454
  750. #define stc22 0x0455
  751. #define stc23 0x0456
  752. #define stc24 0x0457
  753. #define stc25 0x0458
  754. #define stc26 0x0459
  755. #define stc27 0x045a
  756. #define stc28 0x045b
  757. #define stc29 0x045c
  758. #define stc30 0x045d
  759. #define stc31 0x045e
  760. #define stc32 0x045f
  761. /* Listboxes */
  762. #define lst1 0x0460
  763. #define lst2 0x0461
  764. #define lst3 0x0462
  765. #define lst4 0x0463
  766. #define lst5 0x0464
  767. #define lst6 0x0465
  768. #define lst7 0x0466
  769. #define lst8 0x0467
  770. #define lst9 0x0468
  771. #define lst10 0x0469
  772. #define lst11 0x046a
  773. #define lst12 0x046b
  774. #define lst13 0x046c
  775. #define lst14 0x046d
  776. #define lst15 0x046e
  777. #define lst16 0x046f
  778. /* Combo boxes */
  779. #define cmb1 0x0470
  780. #define cmb2 0x0471
  781. #define cmb3 0x0472
  782. #define cmb4 0x0473
  783. #define cmb5 0x0474
  784. #define cmb6 0x0475
  785. #define cmb7 0x0476
  786. #define cmb8 0x0477
  787. #define cmb9 0x0478
  788. #define cmb10 0x0479
  789. #define cmb11 0x047a
  790. #define cmb12 0x047b
  791. #define cmb13 0x047c
  792. #define cmb14 0x047d
  793. #define cmb15 0x047e
  794. #define cmb16 0x047f
  795. /* Edit controls */
  796. #define edt1 0x0480
  797. #define edt2 0x0481
  798. #define edt3 0x0482
  799. #define edt4 0x0483
  800. #define edt5 0x0484
  801. #define edt6 0x0485
  802. #define edt7 0x0486
  803. #define edt8 0x0487
  804. #define edt9 0x0488
  805. #define edt10 0x0489
  806. #define edt11 0x048a
  807. #define edt12 0x048b
  808. #define edt13 0x048c
  809. #define edt14 0x048d
  810. #define edt15 0x048e
  811. #define edt16 0x048f
  812. /* Scroll bars */
  813. #define scr1 0x0490
  814. #define scr2 0x0491
  815. #define scr3 0x0492
  816. #define scr4 0x0493
  817. #define scr5 0x0494
  818. #define scr6 0x0495
  819. #define scr7 0x0496
  820. #define scr8 0x0497
  821. /* These dialog resource ordinals really start at 0x0600, but the
  822. * RC Compiler can't handle hex for resource IDs, hence the decimal.
  823. */
  824. #define FILEOPENORD 1536
  825. #define MULTIFILEOPENORD 1537
  826. #define PRINTDLGORD 1538
  827. #define PRNSETUPDLGORD 1539
  828. #define FINDDLGORD 1540
  829. #define REPLACEDLGORD 1541
  830. #define FONTDLGORD 1542
  831. #define FORMATDLGORD31 1543
  832. #define FORMATDLGORD30 1544
  833. #endif /* !_INC_DLGS */