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

918 lines
33 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. /* NOTE: All dialog and string resource ID's defined in this file are
  10. * in the range:
  11. * 32248 - 32504 (0x7DF8 - 0x7EF8)
  12. */
  13. #ifndef _OLE2UI_H_
  14. #define _OLE2UI_H_
  15. #ifndef RC_INVOKED
  16. #pragma message ("Including OLE2UI.H from " __FILE__)
  17. #endif //RC_INVOKED
  18. #ifdef WIN32
  19. #define _INC_OLE
  20. #define __RPC_H__
  21. #endif
  22. #if !defined(__cplusplus) && !defined( __TURBOC__)
  23. #define NONAMELESSUNION // use strict ANSI standard (for DVOBJ.H)
  24. #endif
  25. #include <windows.h>
  26. #include <shellapi.h>
  27. #include <ole2.h>
  28. #include <string.h>
  29. #include <dlgs.h> //For fileopen dlg; standard include
  30. #include "olestd.h"
  31. #ifdef __TURBOC__
  32. #define _getcwd getcwd
  33. #define _itoa itoa
  34. #define __max max
  35. #define _find_t find_t
  36. #endif // __TURBOC__
  37. #ifdef WIN32
  38. #define _fmemset memset
  39. #define _fmemcpy memcpy
  40. #define _fmemcmp memcmp
  41. #define _fstrcpy strcpy
  42. #define _fstrlen strlen
  43. #define _fstrrchr strrchr
  44. #define _fstrtok strtok
  45. #define lstrcpyn strncpy
  46. // BUGBUG32: isspace function does not seem to work properly
  47. #undef isspace
  48. #define isspace(j) (j==' ' || j=='\t' || j=='\n')
  49. #endif // WIN32
  50. #if !defined( EXPORT )
  51. #ifdef WIN32
  52. #define EXPORT
  53. #else
  54. #define EXPORT __export
  55. #endif // WIN32
  56. #endif // !EXPORT
  57. /*
  58. * Initialization / Uninitialization routines. OleUIInitialize
  59. * must be called prior to using any functions in OLE2UI, and OleUIUnInitialize
  60. * must be called before you app shuts down and when you are done using the
  61. * library.
  62. *
  63. * NOTE: If you are using the DLL version of this library, these functions
  64. * are automatically called in the DLL's LibMain and WEP, so you should
  65. * not call them directly from your application.
  66. */
  67. // Backward compatibility with older library
  68. #define OleUIUninitialize OleUIUnInitialize
  69. STDAPI_(BOOL) OleUIInitialize(HINSTANCE hInstance, HINSTANCE hPrevInst);
  70. STDAPI_(BOOL) OleUIUninitialize(void);
  71. #if !defined( SZCLASSICONBOX )
  72. #define SZCLASSICONBOX "ole2uiIBCls"
  73. #endif
  74. #if !defined( SZCLASSRESULTIMAGE )
  75. #define SZCLASSRESULTIMAGE "ole2uiRICls"
  76. #endif
  77. // object count, used to support DllCanUnloadNow and OleUICanUnloadNow
  78. extern DWORD g_dwObjectCount;
  79. STDAPI OleUICanUnloadNow(void);
  80. STDAPI OleUILockLibrary(BOOL fLock);
  81. //Dialog Identifiers as passed in Help messages to identify the source.
  82. #define IDD_INSERTOBJECT 32248
  83. #define IDD_CHANGEICON 32249
  84. #define IDD_CONVERT 32250
  85. #define IDD_PASTESPECIAL 32251
  86. #define IDD_EDITLINKS 32252
  87. #define IDD_FILEOPEN 32253
  88. #define IDD_BUSY 32254
  89. #define IDD_UPDATELINKS 32255
  90. #define IDD_CANNOTUPDATELINK 32256
  91. #define IDD_CHANGESOURCE 32257
  92. #define IDD_INSERTFILEBROWSE 32258
  93. #define IDD_CHANGEICONBROWSE 32259
  94. // The following Dialogs are message dialogs used by OleUIPromptUser API
  95. #define IDD_LINKSOURCEUNAVAILABLE 32260
  96. #define IDD_SERVERNOTREG 32261
  97. #define IDD_LINKTYPECHANGED 32262
  98. #define IDD_SERVERNOTFOUND 32263
  99. #define IDD_OUTOFMEMORY 32264
  100. // Stringtable identifers
  101. #define IDS_OLE2UIUNKNOWN 32300
  102. #define IDS_OLE2UILINK 32301
  103. #define IDS_OLE2UIOBJECT 32302
  104. #define IDS_OLE2UIEDIT 32303
  105. #define IDS_OLE2UICONVERT 32304
  106. #define IDS_OLE2UIEDITLINKCMD_1VERB 32305
  107. #define IDS_OLE2UIEDITOBJECTCMD_1VERB 32306
  108. #define IDS_OLE2UIEDITLINKCMD_NVERB 32307
  109. #define IDS_OLE2UIEDITOBJECTCMD_NVERB 32308
  110. #define IDS_OLE2UIEDITNOOBJCMD 32309
  111. // def. icon label (usu. "Document")
  112. #define IDS_DEFICONLABEL 32310
  113. #define IDS_OLE2UIPASTELINKEDTYPE 32311
  114. #define IDS_FILTERS 32320
  115. #define IDS_ICONFILTERS 32321
  116. #define IDS_BROWSE 32322
  117. //Resource identifiers for bitmaps
  118. #define IDB_RESULTSEGA 32325
  119. #define IDB_RESULTSVGA 32326
  120. #define IDB_RESULTSHIRESVGA 32327
  121. //Missing from windows.h
  122. #ifndef PVOID
  123. typedef VOID *PVOID;
  124. #endif
  125. //Hook type used in all structures.
  126. typedef UINT (CALLBACK *LPFNOLEUIHOOK)(HWND, UINT, WPARAM, LPARAM);
  127. //Strings for registered messages
  128. #define SZOLEUI_MSG_HELP "OLEUI_MSG_HELP"
  129. #define SZOLEUI_MSG_ENDDIALOG "OLEUI_MSG_ENDDIALOG"
  130. #define SZOLEUI_MSG_BROWSE "OLEUI_MSG_BROWSE"
  131. #define SZOLEUI_MSG_CHANGEICON "OLEUI_MSG_CHANGEICON"
  132. #define SZOLEUI_MSG_CLOSEBUSYDIALOG "OLEUI_MSG_CLOSEBUSYDIALOG"
  133. #define SZOLEUI_MSG_FILEOKSTRING "OLEUI_MSG_FILEOKSTRING"
  134. //Standard error definitions
  135. #define OLEUI_FALSE 0
  136. #define OLEUI_SUCCESS 1 //No error, same as OLEUI_OK
  137. #define OLEUI_OK 1 //OK button pressed
  138. #define OLEUI_CANCEL 2 //Cancel button pressed
  139. #define OLEUI_ERR_STANDARDMIN 100
  140. #define OLEUI_ERR_STRUCTURENULL 101 //Standard field validation
  141. #define OLEUI_ERR_STRUCTUREINVALID 102
  142. #define OLEUI_ERR_CBSTRUCTINCORRECT 103
  143. #define OLEUI_ERR_HWNDOWNERINVALID 104
  144. #define OLEUI_ERR_LPSZCAPTIONINVALID 105
  145. #define OLEUI_ERR_LPFNHOOKINVALID 106
  146. #define OLEUI_ERR_HINSTANCEINVALID 107
  147. #define OLEUI_ERR_LPSZTEMPLATEINVALID 108
  148. #define OLEUI_ERR_HRESOURCEINVALID 109
  149. #define OLEUI_ERR_FINDTEMPLATEFAILURE 110 //Initialization errors
  150. #define OLEUI_ERR_LOADTEMPLATEFAILURE 111
  151. #define OLEUI_ERR_DIALOGFAILURE 112
  152. #define OLEUI_ERR_LOCALMEMALLOC 113
  153. #define OLEUI_ERR_GLOBALMEMALLOC 114
  154. #define OLEUI_ERR_LOADSTRING 115
  155. #define OLEUI_ERR_STANDARDMAX 116 //Start here for specific errors.
  156. //Help Button Identifier
  157. #define ID_OLEUIHELP 99
  158. // Help button for fileopen.dlg (need this for resizing) 1038 is pshHelp
  159. #define IDHELP 1038
  160. // Static text control (use this instead of -1 so things work correctly for
  161. // localization
  162. #define ID_STATIC 98
  163. //Maximum key size we read from the RegDB.
  164. #define OLEUI_CCHKEYMAX 256 // make any changes to this in geticon.c too
  165. //Maximum verb length and length of Object menu
  166. #define OLEUI_CCHVERBMAX 32
  167. #define OLEUI_OBJECTMENUMAX 256
  168. //Maximum MS-DOS pathname.
  169. #define OLEUI_CCHPATHMAX 256 // make any changes to this in geticon.c too
  170. #define OLEUI_CCHFILEMAX 13
  171. //Icon label length
  172. #define OLEUI_CCHLABELMAX 40 // make any changes to this in geticon.c too
  173. //Length of the CLSID string
  174. #define OLEUI_CCHCLSIDSTRING 39
  175. /*
  176. * What follows here are first function prototypes for general utility
  177. * functions, then sections laid out by dialog. Each dialog section
  178. * defines the dialog structure, the API prototype, flags for the dwFlags
  179. * field, the dialog-specific error values, and dialog control IDs (for
  180. * hooks and custom templates.
  181. */
  182. //Miscellaneous utility functions.
  183. STDAPI_(BOOL) OleUIAddVerbMenu(LPOLEOBJECT lpOleObj,
  184. LPSTR lpszShortType,
  185. HMENU hMenu,
  186. UINT uPos,
  187. UINT uIDVerbMin,
  188. UINT uIDVerbMax,
  189. BOOL bAddConvert,
  190. UINT idConvert,
  191. HMENU FAR *lphMenu);
  192. //Metafile utility functions
  193. STDAPI_(HGLOBAL) OleUIMetafilePictFromIconAndLabel(HICON, LPSTR, LPSTR, UINT);
  194. STDAPI_(void) OleUIMetafilePictIconFree(HGLOBAL);
  195. STDAPI_(BOOL) OleUIMetafilePictIconDraw(HDC, LPRECT, HGLOBAL, BOOL);
  196. STDAPI_(UINT) OleUIMetafilePictExtractLabel(HGLOBAL, LPSTR, UINT, LPDWORD);
  197. STDAPI_(HICON) OleUIMetafilePictExtractIcon(HGLOBAL);
  198. STDAPI_(BOOL) OleUIMetafilePictExtractIconSource(HGLOBAL,LPSTR,UINT FAR *);
  199. /*************************************************************************
  200. ** INSERT OBJECT DIALOG
  201. *************************************************************************/
  202. typedef struct tagOLEUIINSERTOBJECT
  203. {
  204. //These IN fields are standard across all OLEUI dialog functions.
  205. DWORD cbStruct; //Structure Size
  206. DWORD dwFlags; //IN-OUT: Flags
  207. HWND hWndOwner; //Owning window
  208. LPCSTR lpszCaption; //Dialog caption bar contents
  209. LPFNOLEUIHOOK lpfnHook; //Hook callback
  210. LPARAM lCustData; //Custom data to pass to hook
  211. HINSTANCE hInstance; //Instance for customized template name
  212. LPCSTR lpszTemplate; //Customized template name
  213. HRSRC hResource; //Customized template handle
  214. //Specifics for OLEUIINSERTOBJECT. All are IN-OUT unless otherwise spec.
  215. CLSID clsid; //Return space for class ID
  216. LPSTR lpszFile; //Filename for inserts or links
  217. UINT cchFile; //Size of lpszFile buffer: OLEUI_CCHPATHMAX
  218. UINT cClsidExclude; //IN only: CLSIDs in lpClsidExclude
  219. LPCLSID lpClsidExclude; //List of CLSIDs to exclude from listing.
  220. //Specific to create objects if flags say so
  221. IID iid; //Requested interface on creation.
  222. DWORD oleRender; //Rendering option
  223. LPFORMATETC lpFormatEtc; //Desired format
  224. LPOLECLIENTSITE lpIOleClientSite; //Site to be use for the object.
  225. LPSTORAGE lpIStorage; //Storage used for the object
  226. LPVOID FAR *ppvObj; //Where the object is returned.
  227. SCODE sc; //Result of creation calls.
  228. HGLOBAL hMetaPict; //OUT: METAFILEPICT containing iconic aspect.
  229. //IFF we couldn't stuff it in the cache.
  230. } OLEUIINSERTOBJECT, *POLEUIINSERTOBJECT, FAR *LPOLEUIINSERTOBJECT;
  231. //API prototype
  232. STDAPI_(UINT) OleUIInsertObject(LPOLEUIINSERTOBJECT);
  233. //Insert Object flags
  234. #define IOF_SHOWHELP 0x00000001L
  235. #define IOF_SELECTCREATENEW 0x00000002L
  236. #define IOF_SELECTCREATEFROMFILE 0x00000004L
  237. #define IOF_CHECKLINK 0x00000008L
  238. #define IOF_CHECKDISPLAYASICON 0x00000010L
  239. #define IOF_CREATENEWOBJECT 0x00000020L
  240. #define IOF_CREATEFILEOBJECT 0x00000040L
  241. #define IOF_CREATELINKOBJECT 0x00000080L
  242. #define IOF_DISABLELINK 0x00000100L
  243. #define IOF_VERIFYSERVERSEXIST 0x00000200L
  244. #define IOF_DISABLEDISPLAYASICON 0x00000400L
  245. //Insert Object specific error codes
  246. #define OLEUI_IOERR_LPSZFILEINVALID (OLEUI_ERR_STANDARDMAX+0)
  247. #define OLEUI_IOERR_LPSZLABELINVALID (OLEUI_ERR_STANDARDMAX+1)
  248. #define OLEUI_IOERR_HICONINVALID (OLEUI_ERR_STANDARDMAX+2)
  249. #define OLEUI_IOERR_LPFORMATETCINVALID (OLEUI_ERR_STANDARDMAX+3)
  250. #define OLEUI_IOERR_PPVOBJINVALID (OLEUI_ERR_STANDARDMAX+4)
  251. #define OLEUI_IOERR_LPIOLECLIENTSITEINVALID (OLEUI_ERR_STANDARDMAX+5)
  252. #define OLEUI_IOERR_LPISTORAGEINVALID (OLEUI_ERR_STANDARDMAX+6)
  253. #define OLEUI_IOERR_SCODEHASERROR (OLEUI_ERR_STANDARDMAX+7)
  254. #define OLEUI_IOERR_LPCLSIDEXCLUDEINVALID (OLEUI_ERR_STANDARDMAX+8)
  255. #define OLEUI_IOERR_CCHFILEINVALID (OLEUI_ERR_STANDARDMAX+9)
  256. //Insert Object Dialog identifiers
  257. #define ID_IO_CREATENEW 2100
  258. #define ID_IO_CREATEFROMFILE 2101
  259. #define ID_IO_LINKFILE 2102
  260. #define ID_IO_OBJECTTYPELIST 2103
  261. #define ID_IO_DISPLAYASICON 2104
  262. #define ID_IO_CHANGEICON 2105
  263. #define ID_IO_FILE 2106
  264. #define ID_IO_FILEDISPLAY 2107
  265. #define ID_IO_RESULTIMAGE 2108
  266. #define ID_IO_RESULTTEXT 2109
  267. #define ID_IO_ICONDISPLAY 2110
  268. #define ID_IO_OBJECTTYPETEXT 2111
  269. #define ID_IO_FILETEXT 2112
  270. #define ID_IO_FILETYPE 2113
  271. // Strings in OLE2UI resources
  272. #define IDS_IORESULTNEW 32400
  273. #define IDS_IORESULTNEWICON 32401
  274. #define IDS_IORESULTFROMFILE1 32402
  275. #define IDS_IORESULTFROMFILE2 32403
  276. #define IDS_IORESULTFROMFILEICON2 32404
  277. #define IDS_IORESULTLINKFILE1 32405
  278. #define IDS_IORESULTLINKFILE2 32406
  279. #define IDS_IORESULTLINKFILEICON1 32407
  280. #define IDS_IORESULTLINKFILEICON2 32408
  281. /*************************************************************************
  282. ** PASTE SPECIAL DIALOG
  283. *************************************************************************/
  284. // Maximum number of link types
  285. #define PS_MAXLINKTYPES 8
  286. //NOTE: OLEUIPASTEENTRY and OLEUIPASTEFLAG structs are defined in OLESTD.H
  287. typedef struct tagOLEUIPASTESPECIAL
  288. {
  289. //These IN fields are standard across all OLEUI dialog functions.
  290. DWORD cbStruct; //Structure Size
  291. DWORD dwFlags; //IN-OUT: Flags
  292. HWND hWndOwner; //Owning window
  293. LPCSTR lpszCaption; //Dialog caption bar contents
  294. LPFNOLEUIHOOK lpfnHook; //Hook callback
  295. LPARAM lCustData; //Custom data to pass to hook
  296. HINSTANCE hInstance; //Instance for customized template name
  297. LPCSTR lpszTemplate; //Customized template name
  298. HRSRC hResource; //Customized template handle
  299. //Specifics for OLEUIPASTESPECIAL.
  300. //IN fields
  301. LPDATAOBJECT lpSrcDataObj; //Source IDataObject* (on the
  302. // clipboard) for data to paste
  303. LPOLEUIPASTEENTRY arrPasteEntries; //OLEUIPASTEENTRY array which
  304. // specifies acceptable formats. See
  305. // OLEUIPASTEENTRY for more info.
  306. int cPasteEntries; //No. of OLEUIPASTEENTRY array entries
  307. UINT FAR *arrLinkTypes; //List of link types that are
  308. // acceptable. Link types are referred
  309. // to using OLEUIPASTEFLAGS in
  310. // arrPasteEntries
  311. int cLinkTypes; //Number of link types
  312. UINT cClsidExclude; //Number of CLSIDs in lpClsidExclude
  313. LPCLSID lpClsidExclude; //List of CLSIDs to exclude from list.
  314. //OUT fields
  315. int nSelectedIndex; //Index of arrPasteEntries[] that the
  316. // user selected
  317. BOOL fLink; //Indicates if Paste or Paste Link was
  318. // selected by the user
  319. HGLOBAL hMetaPict; //Handle to Metafile containing icon
  320. // and icon title selected by the user
  321. // Use the Metafile utility functions
  322. // defined in this header to
  323. // manipulate hMetaPict
  324. SIZEL sizel; // size of object/link in its source
  325. // if the display aspect chosen by
  326. // the user matches the aspect
  327. // displayed in the source. if
  328. // different aspect is chosen then
  329. // sizel.cx=sizel.cy=0 is returned.
  330. // sizel displayed in source is
  331. // retrieved from the
  332. // ObjectDescriptor if fLink is FALSE
  333. // LinkSrcDescriptor if fLink is TRUE
  334. } OLEUIPASTESPECIAL, *POLEUIPASTESPECIAL, FAR *LPOLEUIPASTESPECIAL;
  335. //API to bring up PasteSpecial dialog
  336. STDAPI_(UINT) OleUIPasteSpecial(LPOLEUIPASTESPECIAL);
  337. //Paste Special flags
  338. // Show Help button. IN flag.
  339. #define PSF_SHOWHELP 0x00000001L
  340. //Select Paste radio button at dialog startup. This is the default if
  341. // PSF_SELECTPASTE or PSF_SELECTPASTELINK are not specified. Also specifies
  342. // state of button on dialog termination. IN/OUT flag.
  343. #define PSF_SELECTPASTE 0x00000002L
  344. //Select PasteLink radio button at dialog startup. Also specifies state of
  345. // button on dialog termination. IN/OUT flag.
  346. #define PSF_SELECTPASTELINK 0x00000004L
  347. //Specfies if DisplayAsIcon button was checked on dialog termination. OUT flag
  348. #define PSF_CHECKDISPLAYASICON 0x00000008L
  349. #define PSF_DISABLEDISPLAYASICON 0x00000010L
  350. //Paste Special specific error codes
  351. #define OLEUI_IOERR_SRCDATAOBJECTINVALID (OLEUI_ERR_STANDARDMAX+0)
  352. #define OLEUI_IOERR_ARRPASTEENTRIESINVALID (OLEUI_ERR_STANDARDMAX+1)
  353. #define OLEUI_IOERR_ARRLINKTYPESINVALID (OLEUI_ERR_STANDARDMAX+2)
  354. #define OLEUI_PSERR_CLIPBOARDCHANGED (OLEUI_ERR_STANDARDMAX+3)
  355. //Paste Special Dialog identifiers
  356. #define ID_PS_PASTE 500
  357. #define ID_PS_PASTELINK 501
  358. #define ID_PS_SOURCETEXT 502
  359. #define ID_PS_PASTELIST 503
  360. #define ID_PS_PASTELINKLIST 504
  361. #define ID_PS_DISPLAYLIST 505
  362. #define ID_PS_DISPLAYASICON 506
  363. #define ID_PS_ICONDISPLAY 507
  364. #define ID_PS_CHANGEICON 508
  365. #define ID_PS_RESULTIMAGE 509
  366. #define ID_PS_RESULTTEXT 510
  367. #define ID_PS_RESULTGROUP 511
  368. #define ID_PS_STXSOURCE 512
  369. #define ID_PS_STXAS 513
  370. // Paste Special String IDs
  371. #define IDS_PSPASTEDATA 32410
  372. #define IDS_PSPASTEOBJECT 32411
  373. #define IDS_PSPASTEOBJECTASICON 32412
  374. #define IDS_PSPASTELINKDATA 32413
  375. #define IDS_PSPASTELINKOBJECT 32414
  376. #define IDS_PSPASTELINKOBJECTASICON 32415
  377. #define IDS_PSNONOLE 32416
  378. #define IDS_PSUNKNOWNTYPE 32417
  379. #define IDS_PSUNKNOWNSRC 32418
  380. #define IDS_PSUNKNOWNAPP 32419
  381. /*************************************************************************
  382. ** EDIT LINKS DIALOG
  383. *************************************************************************/
  384. /* IOleUILinkContainer Interface
  385. ** -----------------------------
  386. ** This interface must be implemented by container applications that
  387. ** want to use the EditLinks dialog. the EditLinks dialog calls back
  388. ** to the container app to perform the OLE functions to manipulate
  389. ** the links within the container.
  390. */
  391. #define LPOLEUILINKCONTAINER IOleUILinkContainer FAR*
  392. #undef INTERFACE
  393. #define INTERFACE IOleUILinkContainer
  394. DECLARE_INTERFACE_(IOleUILinkContainer, IUnknown)
  395. {
  396. //*** IUnknown methods ***/
  397. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  398. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  399. STDMETHOD_(ULONG,Release) (THIS) PURE;
  400. STDMETHOD_(DWORD,GetNextLink) (THIS_ DWORD dwLink) PURE;
  401. STDMETHOD(SetLinkUpdateOptions) (THIS_ DWORD dwLink, DWORD dwUpdateOpt) PURE;
  402. STDMETHOD(GetLinkUpdateOptions) (THIS_ DWORD dwLink, DWORD FAR* lpdwUpdateOpt) PURE;
  403. STDMETHOD(SetLinkSource) (THIS_
  404. DWORD dwLink,
  405. LPSTR lpszDisplayName,
  406. ULONG lenFileName,
  407. ULONG FAR* pchEaten,
  408. BOOL fValidateSource) PURE;
  409. STDMETHOD(GetLinkSource) (THIS_
  410. DWORD dwLink,
  411. LPSTR FAR* lplpszDisplayName,
  412. ULONG FAR* lplenFileName,
  413. LPSTR FAR* lplpszFullLinkType,
  414. LPSTR FAR* lplpszShortLinkType,
  415. BOOL FAR* lpfSourceAvailable,
  416. BOOL FAR* lpfIsSelected) PURE;
  417. STDMETHOD(OpenLinkSource) (THIS_ DWORD dwLink) PURE;
  418. STDMETHOD(UpdateLink) (THIS_
  419. DWORD dwLink,
  420. BOOL fErrorMessage,
  421. BOOL fErrorAction) PURE;
  422. STDMETHOD(CancelLink) (THIS_ DWORD dwLink) PURE;
  423. };
  424. typedef struct tagOLEUIEDITLINKS
  425. {
  426. //These IN fields are standard across all OLEUI dialog functions.
  427. DWORD cbStruct; //Structure Size
  428. DWORD dwFlags; //IN-OUT: Flags
  429. HWND hWndOwner; //Owning window
  430. LPCSTR lpszCaption; //Dialog caption bar contents
  431. LPFNOLEUIHOOK lpfnHook; //Hook callback
  432. LPARAM lCustData; //Custom data to pass to hook
  433. HINSTANCE hInstance; //Instance for customized template name
  434. LPCSTR lpszTemplate; //Customized template name
  435. HRSRC hResource; //Customized template handle
  436. //Specifics for OLEUI<STRUCT>. All are IN-OUT unless otherwise spec.
  437. LPOLEUILINKCONTAINER lpOleUILinkContainer; //IN: Interface to manipulate
  438. //links in the container
  439. } OLEUIEDITLINKS, *POLEUIEDITLINKS, FAR *LPOLEUIEDITLINKS;
  440. //API Prototype
  441. STDAPI_(UINT) OleUIEditLinks(LPOLEUIEDITLINKS);
  442. // Edit Links flags
  443. #define ELF_SHOWHELP 0x00000001L
  444. #define ELF_DISABLEUPDATENOW 0x00000002L
  445. #define ELF_DISABLEOPENSOURCE 0x00000004L
  446. #define ELF_DISABLECHANGESOURCE 0x00000008L
  447. #define ELF_DISABLECANCELLINK 0x00000010L
  448. // Edit Links Dialog identifiers
  449. #define ID_EL_CHANGESOURCE 201
  450. #define ID_EL_AUTOMATIC 202
  451. #define ID_EL_CLOSE 208
  452. #define ID_EL_CANCELLINK 209
  453. #define ID_EL_UPDATENOW 210
  454. #define ID_EL_OPENSOURCE 211
  455. #define ID_EL_MANUAL 212
  456. #define ID_EL_LINKSOURCE 216
  457. #define ID_EL_LINKTYPE 217
  458. #define ID_EL_UPDATE 218
  459. #define ID_EL_NULL -1
  460. #define ID_EL_LINKSLISTBOX 206
  461. #define ID_EL_COL1 220
  462. #define ID_EL_COL2 221
  463. #define ID_EL_COL3 222
  464. /*************************************************************************
  465. ** CHANGE ICON DIALOG
  466. *************************************************************************/
  467. typedef struct tagOLEUICHANGEICON
  468. {
  469. //These IN fields are standard across all OLEUI dialog functions.
  470. DWORD cbStruct; //Structure Size
  471. DWORD dwFlags; //IN-OUT: Flags
  472. HWND hWndOwner; //Owning window
  473. LPCSTR lpszCaption; //Dialog caption bar contents
  474. LPFNOLEUIHOOK lpfnHook; //Hook callback
  475. LPARAM lCustData; //Custom data to pass to hook
  476. HINSTANCE hInstance; //Instance for customized template name
  477. LPCSTR lpszTemplate; //Customized template name
  478. HRSRC hResource; //Customized template handle
  479. //Specifics for OLEUICHANGEICON. All are IN-OUT unless otherwise spec.
  480. HGLOBAL hMetaPict; //Current and final image. Source of the
  481. //icon is embedded in the metafile itself.
  482. CLSID clsid; //IN only: class used to get Default icon
  483. char szIconExe[OLEUI_CCHPATHMAX];
  484. int cchIconExe;
  485. } OLEUICHANGEICON, *POLEUICHANGEICON, FAR *LPOLEUICHANGEICON;
  486. //API prototype
  487. STDAPI_(UINT) OleUIChangeIcon(LPOLEUICHANGEICON);
  488. //Change Icon flags
  489. #define CIF_SHOWHELP 0x00000001L
  490. #define CIF_SELECTCURRENT 0x00000002L
  491. #define CIF_SELECTDEFAULT 0x00000004L
  492. #define CIF_SELECTFROMFILE 0x00000008L
  493. #define CIF_USEICONEXE 0x0000000aL
  494. //Change Icon specific error codes
  495. #define OLEUI_CIERR_MUSTHAVECLSID (OLEUI_ERR_STANDARDMAX+0)
  496. #define OLEUI_CIERR_MUSTHAVECURRENTMETAFILE (OLEUI_ERR_STANDARDMAX+1)
  497. #define OLEUI_CIERR_SZICONEXEINVALID (OLEUI_ERR_STANDARDMAX+2)
  498. //Change Icon Dialog identifiers
  499. #define ID_GROUP 120
  500. #define ID_CURRENT 121
  501. #define ID_CURRENTICON 122
  502. #define ID_DEFAULT 123
  503. #define ID_DEFAULTICON 124
  504. #define ID_FROMFILE 125
  505. #define ID_FROMFILEEDIT 126
  506. #define ID_ICONLIST 127
  507. #define ID_LABEL 128
  508. #define ID_LABELEDIT 129
  509. #define ID_BROWSE 130
  510. #define ID_RESULTICON 132
  511. #define ID_RESULTLABEL 133
  512. // Stringtable defines for Change Icon
  513. #define IDS_CINOICONSINFILE 32430
  514. #define IDS_CIINVALIDFILE 32431
  515. #define IDS_CIFILEACCESS 32432
  516. #define IDS_CIFILESHARE 32433
  517. #define IDS_CIFILEOPENFAIL 32434
  518. /*************************************************************************
  519. ** CONVERT DIALOG
  520. *************************************************************************/
  521. typedef struct tagOLEUICONVERT
  522. {
  523. //These IN fields are standard across all OLEUI dialog functions.
  524. DWORD cbStruct; //Structure Size
  525. DWORD dwFlags; //IN-OUT: Flags
  526. HWND hWndOwner; //Owning window
  527. LPCSTR lpszCaption; //Dialog caption bar contents
  528. LPFNOLEUIHOOK lpfnHook; //Hook callback
  529. LPARAM lCustData; //Custom data to pass to hook
  530. HINSTANCE hInstance; //Instance for customized template name
  531. LPCSTR lpszTemplate; //Customized template name
  532. HRSRC hResource; //Customized template handle
  533. //Specifics for OLEUICONVERT. All are IN-OUT unless otherwise spec.
  534. CLSID clsid; //Class ID sent in to dialog: IN only
  535. CLSID clsidConvertDefault; //Class ID to use as convert default: IN only
  536. CLSID clsidActivateDefault; //Class ID to use as activate default: IN only
  537. CLSID clsidNew; //Selected Class ID: OUT only
  538. DWORD dvAspect; //IN-OUT, either DVASPECT_CONTENT or
  539. //DVASPECT_ICON
  540. WORD wFormat; //Original data format
  541. BOOL fIsLinkedObject; //IN only; true if object is linked
  542. HGLOBAL hMetaPict; //IN-OUT: METAFILEPICT containing iconic aspect.
  543. LPSTR lpszUserType; //IN-OUT: user type name of original class.
  544. // We'll do lookup if it's NULL.
  545. // This gets freed on exit.
  546. BOOL fObjectsIconChanged; // OUT; TRUE if ChangeIcon was called (and not cancelled)
  547. LPSTR lpszDefLabel; //IN-OUT: default label to use for icon.
  548. // if NULL, the short user type name
  549. // will be used. if the object is a
  550. // link, the caller should pass the
  551. // DisplayName of the link source
  552. // This gets freed on exit.
  553. UINT cClsidExclude; //IN: No. of CLSIDs in lpClsidExclude
  554. LPCLSID lpClsidExclude; //IN: List of CLSIDs to exclude from list
  555. } OLEUICONVERT, *POLEUICONVERT, FAR *LPOLEUICONVERT;
  556. //API prototype
  557. STDAPI_(UINT) OleUIConvert(LPOLEUICONVERT);
  558. // Determine if there is at least one class that can Convert or ActivateAs
  559. // the given clsid.
  560. STDAPI_(BOOL) OleUICanConvertOrActivateAs(
  561. REFCLSID rClsid,
  562. BOOL fIsLinkedObject,
  563. WORD wFormat
  564. );
  565. //Convert Dialog flags
  566. // IN only: Shows "HELP" button
  567. #define CF_SHOWHELPBUTTON 0x00000001L
  568. // IN only: lets you set the convert default object - the one that is
  569. // selected as default in the convert listbox.
  570. #define CF_SETCONVERTDEFAULT 0x00000002L
  571. // IN only: lets you set the activate default object - the one that is
  572. // selected as default in the activate listbox.
  573. #define CF_SETACTIVATEDEFAULT 0x00000004L
  574. // IN/OUT: Selects the "Convert To" radio button, is set on exit if
  575. // this button was selected
  576. #define CF_SELECTCONVERTTO 0x00000008L
  577. // IN/OUT: Selects the "Activate As" radio button, is set on exit if
  578. // this button was selected
  579. #define CF_SELECTACTIVATEAS 0x00000010L
  580. #define CF_DISABLEDISPLAYASICON 0x00000020L
  581. #define CF_DISABLEACTIVATEAS 0x00000040L
  582. //Convert specific error codes
  583. #define OLEUI_CTERR_CLASSIDINVALID (OLEUI_ERR_STANDARDMAX+1)
  584. #define OLEUI_CTERR_DVASPECTINVALID (OLEUI_ERR_STANDARDMAX+2)
  585. #define OLEUI_CTERR_CBFORMATINVALID (OLEUI_ERR_STANDARDMAX+3)
  586. #define OLEUI_CTERR_HMETAPICTINVALID (OLEUI_ERR_STANDARDMAX+4)
  587. #define OLEUI_CTERR_STRINGINVALID (OLEUI_ERR_STANDARDMAX+5)
  588. //Convert Dialog identifiers
  589. #define IDCV_OBJECTTYPE 150
  590. #define IDCV_DISPLAYASICON 152
  591. #define IDCV_CHANGEICON 153
  592. #define IDCV_ACTIVATELIST 154
  593. #define IDCV_CONVERTTO 155
  594. #define IDCV_ACTIVATEAS 156
  595. #define IDCV_RESULTTEXT 157
  596. #define IDCV_CONVERTLIST 158
  597. #define IDCV_ICON 159
  598. #define IDCV_ICONLABEL1 160
  599. #define IDCV_ICONLABEL2 161
  600. #define IDCV_STXCURTYPE 162
  601. #define IDCV_GRPRESULT 163
  602. #define IDCV_STXCONVERTTO 164
  603. // String IDs for Convert dialog
  604. #define IDS_CVRESULTCONVERTLINK 32440
  605. #define IDS_CVRESULTCONVERTTO 32441
  606. #define IDS_CVRESULTNOCHANGE 32442
  607. #define IDS_CVRESULTDISPLAYASICON 32443
  608. #define IDS_CVRESULTACTIVATEAS 32444
  609. #define IDS_CVRESULTACTIVATEDIFF 32445
  610. /*************************************************************************
  611. ** BUSY DIALOG
  612. *************************************************************************/
  613. typedef struct tagOLEUIBUSY
  614. {
  615. //These IN fields are standard across all OLEUI dialog functions.
  616. DWORD cbStruct; //Structure Size
  617. DWORD dwFlags; //IN-OUT: Flags ** NOTE ** this dialog has no flags
  618. HWND hWndOwner; //Owning window
  619. LPCSTR lpszCaption; //Dialog caption bar contents
  620. LPFNOLEUIHOOK lpfnHook; //Hook callback
  621. LPARAM lCustData; //Custom data to pass to hook
  622. HINSTANCE hInstance; //Instance for customized template name
  623. LPCSTR lpszTemplate; //Customized template name
  624. HRSRC hResource; //Customized template handle
  625. //Specifics for OLEUIBUSY.
  626. HTASK hTask; //IN: HTask which is blocking
  627. HWND FAR * lphWndDialog; //IN: Dialog's HWND is placed here
  628. } OLEUIBUSY, *POLEUIBUSY, FAR *LPOLEUIBUSY;
  629. //API prototype
  630. STDAPI_(UINT) OleUIBusy(LPOLEUIBUSY);
  631. // Flags for this dialog
  632. // IN only: Disables "Cancel" button
  633. #define BZ_DISABLECANCELBUTTON 0x00000001L
  634. // IN only: Disables "Switch To..." button
  635. #define BZ_DISABLESWITCHTOBUTTON 0x00000002L
  636. // IN only: Disables "Retry" button
  637. #define BZ_DISABLERETRYBUTTON 0x00000004L
  638. // IN only: Generates a "Not Responding" dialog as opposed to the
  639. // "Busy" dialog. The wording in the text is slightly different, and
  640. // the "Cancel" button is grayed out if you set this flag.
  641. #define BZ_NOTRESPONDINGDIALOG 0x00000008L
  642. // Busy specific error/return codes
  643. #define OLEUI_BZERR_HTASKINVALID (OLEUI_ERR_STANDARDMAX+0)
  644. // SWITCHTOSELECTED is returned when user hit "switch to"
  645. #define OLEUI_BZ_SWITCHTOSELECTED (OLEUI_ERR_STANDARDMAX+1)
  646. // RETRYSELECTED is returned when user hit "retry"
  647. #define OLEUI_BZ_RETRYSELECTED (OLEUI_ERR_STANDARDMAX+2)
  648. // CALLUNBLOCKED is returned when call has been unblocked
  649. #define OLEUI_BZ_CALLUNBLOCKED (OLEUI_ERR_STANDARDMAX+3)
  650. // Busy dialog identifiers
  651. #define IDBZ_RETRY 600
  652. #define IDBZ_ICON 601
  653. #define IDBZ_MESSAGE1 602
  654. #define IDBZ_SWITCHTO 604
  655. // Busy dialog stringtable defines
  656. #define IDS_BZRESULTTEXTBUSY 32447
  657. #define IDS_BZRESULTTEXTNOTRESPONDING 32448
  658. // Links dialog stringtable defines
  659. #define IDS_LINK_AUTO 32450
  660. #define IDS_LINK_MANUAL 32451
  661. #define IDS_LINK_UNKNOWN 32452
  662. #define IDS_LINKS 32453
  663. #define IDS_FAILED 32454
  664. #define IDS_CHANGESOURCE 32455
  665. #define IDS_INVALIDSOURCE 32456
  666. #define IDS_ERR_GETLINKSOURCE 32457
  667. #define IDS_ERR_GETLINKUPDATEOPTIONS 32458
  668. #define IDS_ERR_ADDSTRING 32459
  669. #define IDS_CHANGEADDITIONALLINKS 32460
  670. #define IDS_CLOSE 32461
  671. /*************************************************************************
  672. ** PROMPT USER DIALOGS
  673. *************************************************************************/
  674. #define ID_PU_LINKS 900
  675. #define ID_PU_TEXT 901
  676. #define ID_PU_CONVERT 902
  677. #define ID_PU_BROWSE 904
  678. #define ID_PU_METER 905
  679. #define ID_PU_PERCENT 906
  680. #define ID_PU_STOP 907
  681. // used for -1 ids in dialogs:
  682. #define ID_DUMMY 999
  683. /* inside ole2ui.c */
  684. #ifdef __cplusplus
  685. extern "C"
  686. #endif
  687. int EXPORT FAR CDECL OleUIPromptUser(WORD nTemplate, HWND hwndParent, ...);
  688. #define UPDATELINKS_STARTDELAY 2000 // Delay before 1st link updates
  689. // to give the user a chance to
  690. // dismiss the dialog before any
  691. // links update.
  692. STDAPI_(BOOL) OleUIUpdateLinks(
  693. LPOLEUILINKCONTAINER lpOleUILinkCntr,
  694. HWND hwndParent,
  695. LPSTR lpszTitle,
  696. int cLinks);
  697. /*************************************************************************
  698. ** OLE OBJECT FEEDBACK EFFECTS
  699. *************************************************************************/
  700. #define OLEUI_HANDLES_USEINVERSE 0x00000001L
  701. #define OLEUI_HANDLES_NOBORDER 0x00000002L
  702. #define OLEUI_HANDLES_INSIDE 0x00000004L
  703. #define OLEUI_HANDLES_OUTSIDE 0x00000008L
  704. #define OLEUI_SHADE_FULLRECT 1
  705. #define OLEUI_SHADE_BORDERIN 2
  706. #define OLEUI_SHADE_BORDEROUT 3
  707. /* objfdbk.c function prototypes */
  708. STDAPI_(void) OleUIDrawHandles(LPRECT lpRect, HDC hdc, DWORD dwFlags, UINT cSize, BOOL fDraw);
  709. STDAPI_(void) OleUIDrawShading(LPRECT lpRect, HDC hdc, DWORD dwFlags, UINT cWidth);
  710. STDAPI_(void) OleUIShowObject(LPCRECT lprc, HDC hdc, BOOL fIsLink);
  711. /*************************************************************************
  712. ** Hatch window definitions and prototypes **
  713. *************************************************************************/
  714. #define DEFAULT_HATCHBORDER_WIDTH 4
  715. STDAPI_(BOOL) RegisterHatchWindowClass(HINSTANCE hInst);
  716. STDAPI_(HWND) CreateHatchWindow(HWND hWndParent, HINSTANCE hInst);
  717. STDAPI_(UINT) GetHatchWidth(HWND hWndHatch);
  718. STDAPI_(void) GetHatchRect(HWND hWndHatch, LPRECT lpHatchRect);
  719. STDAPI_(void) SetHatchRect(HWND hWndHatch, LPRECT lprcHatchRect);
  720. STDAPI_(void) SetHatchWindowSize(
  721. HWND hWndHatch,
  722. LPRECT lprcIPObjRect,
  723. LPRECT lprcClipRect,
  724. LPPOINT lpptOffset
  725. );
  726. /*************************************************************************
  727. ** VERSION VERIFICATION INFORMATION
  728. *************************************************************************/
  729. // The following magic number is used to verify that the resources we bind
  730. // to our EXE are the same "version" as the LIB (or DLL) file which
  731. // contains these routines. This is not the same as the Version information
  732. // resource that we place in OLE2UI.RC, this is a special ID that we will
  733. // have compiled in to our EXE. Upon initialization of OLE2UI, we will
  734. // look in our resources for an RCDATA called "VERIFICATION" (see OLE2UI.RC),
  735. // and make sure that the magic number there equals the magic number below.
  736. #define OLEUI_VERSION_MAGIC 0x4D42
  737. #endif //_OLE2UI_H_