home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / msinc.pak / OLEDLG.H < prev    next >
C/C++ Source or Header  |  1997-07-23  |  74KB  |  1,624 lines

  1. /*++ BUILD Version: 0002    Increment this if a change has global effects
  2.  
  3. Copyright (c) 1993-1995, Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.         oledlg.h
  8.  
  9. Abstract:
  10.  
  11.         Include file for the OLE common dialogs.
  12.         The following dialog implementations are provided:
  13.                 - Insert Object Dialog
  14.                 - Convert Object Dialog
  15.                 - Paste Special Dialog
  16.                 - Change Icon Dialog
  17.                 - Edit Links Dialog
  18.                 - Update Links Dialog
  19.                 - Change Source Dialog
  20.                 - Busy Dialog
  21.                 - User Error Message Dialog
  22.                 - Object Properties Dialog
  23.  
  24. --*/
  25.  
  26. #ifndef _OLEDLG_H_
  27. #define _OLEDLG_H_
  28.  
  29. #ifndef RC_INVOKED
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #ifndef __cplusplus
  36. #define NONAMELESSUNION     // use strict ANSI standard (for DVOBJ.H)
  37. #endif
  38.  
  39. // syncronize UNICODE options
  40. #if defined(_UNICODE) && !defined(UNICODE)
  41.         #define UNICODE
  42. #endif
  43. #if defined(UNICODE) && !defined(_UNICODE)
  44.         #define _UNICODE
  45. #endif
  46.  
  47. #ifndef _WINDOWS_
  48. #include <windows.h>
  49. #endif
  50. #ifndef _INC_SHELLAPI
  51. #include <shellapi.h>
  52. #endif
  53. #ifndef _INC_COMMDLG
  54. #include <commdlg.h>
  55. #endif
  56. #ifndef _OLE2_H_
  57. #include <ole2.h>
  58. #endif
  59. #include <string.h>
  60. #include <tchar.h>
  61.  
  62. #endif // RC_INVOKED
  63.  
  64. #include <dlgs.h>           // common dialog IDs
  65.  
  66. // Help Button Identifier
  67. #define IDC_OLEUIHELP                   99
  68.  
  69. // Insert Object Dialog identifiers
  70. #define IDC_IO_CREATENEW                2100
  71. #define IDC_IO_CREATEFROMFILE           2101
  72. #define IDC_IO_LINKFILE                 2102
  73. #define IDC_IO_OBJECTTYPELIST           2103
  74. #define IDC_IO_DISPLAYASICON            2104
  75. #define IDC_IO_CHANGEICON               2105
  76. #define IDC_IO_FILE                     2106
  77. #define IDC_IO_FILEDISPLAY              2107
  78. #define IDC_IO_RESULTIMAGE              2108
  79. #define IDC_IO_RESULTTEXT               2109
  80. #define IDC_IO_ICONDISPLAY              2110
  81. #define IDC_IO_OBJECTTYPETEXT           2111    //{{NOHELP}}
  82. #define IDC_IO_FILETEXT                 2112    //{{NOHELP}}
  83. #define IDC_IO_FILETYPE                 2113
  84. #define IDC_IO_INSERTCONTROL            2114
  85. #define IDC_IO_ADDCONTROL               2115
  86. #define IDC_IO_CONTROLTYPELIST          2116
  87.  
  88. // Paste Special Dialog identifiers
  89. #define IDC_PS_PASTE                    500
  90. #define IDC_PS_PASTELINK                501
  91. #define IDC_PS_SOURCETEXT               502
  92. #define IDC_PS_PASTELIST                503     //{{NOHELP}}
  93. #define IDC_PS_PASTELINKLIST            504     //{{NOHELP}}
  94. #define IDC_PS_DISPLAYLIST              505
  95. #define IDC_PS_DISPLAYASICON            506
  96. #define IDC_PS_ICONDISPLAY              507
  97. #define IDC_PS_CHANGEICON               508
  98. #define IDC_PS_RESULTIMAGE              509
  99. #define IDC_PS_RESULTTEXT               510
  100.  
  101. // Change Icon Dialog identifiers
  102. #define IDC_CI_GROUP                    120     //{{NOHELP}}
  103. #define IDC_CI_CURRENT                  121
  104. #define IDC_CI_CURRENTICON              122
  105. #define IDC_CI_DEFAULT                  123
  106. #define IDC_CI_DEFAULTICON              124
  107. #define IDC_CI_FROMFILE                 125
  108. #define IDC_CI_FROMFILEEDIT             126
  109. #define IDC_CI_ICONLIST                 127
  110. #define IDC_CI_LABEL                    128     //{{NOHELP}
  111. #define IDC_CI_LABELEDIT                129
  112. #define IDC_CI_BROWSE                   130
  113. #define IDC_CI_ICONDISPLAY              131
  114.  
  115. // Convert Dialog identifiers
  116. #define IDC_CV_OBJECTTYPE               150
  117. #define IDC_CV_DISPLAYASICON            152
  118. #define IDC_CV_CHANGEICON               153
  119. #define IDC_CV_ACTIVATELIST             154
  120. #define IDC_CV_CONVERTTO                155
  121. #define IDC_CV_ACTIVATEAS               156
  122. #define IDC_CV_RESULTTEXT               157
  123. #define IDC_CV_CONVERTLIST              158
  124. #define IDC_CV_ICONDISPLAY              165
  125.  
  126. // Edit Links Dialog identifiers
  127. #define IDC_EL_CHANGESOURCE             201
  128. #define IDC_EL_AUTOMATIC                202
  129. #define IDC_EL_CANCELLINK               209
  130. #define IDC_EL_UPDATENOW                210
  131. #define IDC_EL_OPENSOURCE               211
  132. #define IDC_EL_MANUAL                   212
  133. #define IDC_EL_LINKSOURCE               216
  134. #define IDC_EL_LINKTYPE                 217
  135. #define IDC_EL_LINKSLISTBOX             206
  136. #define IDC_EL_COL1                     220     //{{NOHELP}}
  137. #define IDC_EL_COL2                     221     //{{NOHELP}}
  138. #define IDC_EL_COL3                     222     //{{NOHELP}}
  139.  
  140. // Busy dialog identifiers
  141. #define IDC_BZ_RETRY                    600
  142. #define IDC_BZ_ICON                     601
  143. #define IDC_BZ_MESSAGE1                 602     //{{NOHELP}}
  144. #define IDC_BZ_SWITCHTO                 604
  145.  
  146. // Update Links dialog identifiers
  147. #define IDC_UL_METER                    1029    //{{NOHELP}}
  148. #define IDC_UL_STOP                     1030    //{{NOHELP}}
  149. #define IDC_UL_PERCENT                  1031    //{{NOHELP}}
  150. #define IDC_UL_PROGRESS                 1032    //{{NOHELP}}
  151.  
  152. // User Prompt dialog identifiers
  153. #define IDC_PU_LINKS                    900     //{{NOHELP}}
  154. #define IDC_PU_TEXT                     901     //{{NOHELP}}
  155. #define IDC_PU_CONVERT                  902     //{{NOHELP}}
  156. #define IDC_PU_ICON                     908     //{{NOHELP}}
  157.  
  158. // General Properties identifiers
  159. #define IDC_GP_OBJECTNAME               1009
  160. #define IDC_GP_OBJECTTYPE               1010
  161. #define IDC_GP_OBJECTSIZE               1011
  162. #define IDC_GP_CONVERT                  1013
  163. #define IDC_GP_OBJECTICON               1014    //{{NOHELP}}
  164. #define IDC_GP_OBJECTLOCATION           1022
  165.  
  166. // View Properties identifiers
  167. #define IDC_VP_PERCENT                  1000
  168. #define IDC_VP_CHANGEICON               1001
  169. #define IDC_VP_EDITABLE                 1002
  170. #define IDC_VP_ASICON                   1003
  171. #define IDC_VP_RELATIVE                 1005
  172. #define IDC_VP_SPIN                     1006
  173. #define IDC_VP_SCALETXT                 1034
  174. #define IDC_VP_ICONDISPLAY              1021
  175. #define IDC_VP_RESULTIMAGE              1033
  176.  
  177. // Link Properties identifiers
  178. #define IDC_LP_OPENSOURCE               1006
  179. #define IDC_LP_UPDATENOW                1007
  180. #define IDC_LP_BREAKLINK                1008
  181. #define IDC_LP_LINKSOURCE               1012
  182. #define IDC_LP_CHANGESOURCE             1015
  183. #define IDC_LP_AUTOMATIC                1016
  184. #define IDC_LP_MANUAL                   1017
  185. #define IDC_LP_DATE                     1018
  186. #define IDC_LP_TIME                     1019
  187.  
  188. // Dialog Identifiers as passed in Help messages to identify the source.
  189. #define IDD_INSERTOBJECT                1000
  190. #define IDD_CHANGEICON                  1001
  191. #define IDD_CONVERT                     1002
  192. #define IDD_PASTESPECIAL                1003
  193. #define IDD_EDITLINKS                   1004
  194. #define IDD_BUSY                        1006
  195. #define IDD_UPDATELINKS                 1007
  196. #define IDD_CHANGESOURCE                1009
  197. #define IDD_INSERTFILEBROWSE            1010
  198. #define IDD_CHANGEICONBROWSE            1011
  199. #define IDD_CONVERTONLY                 1012
  200. #define IDD_CHANGESOURCE4               1013
  201. #define IDD_GNRLPROPS                   1100
  202. #define IDD_VIEWPROPS                   1101
  203. #define IDD_LINKPROPS                   1102
  204.  
  205. // The following Dialogs are message dialogs used by OleUIPromptUser API
  206. #define IDD_CANNOTUPDATELINK            1008
  207. #define IDD_LINKSOURCEUNAVAILABLE       1020
  208. #define IDD_SERVERNOTFOUND              1023
  209. #define IDD_OUTOFMEMORY                 1024
  210. #define IDD_SERVERNOTREGW               1021
  211. #define IDD_LINKTYPECHANGEDW            1022
  212. #define IDD_SERVERNOTREGA               1025
  213. #define IDD_LINKTYPECHANGEDA            1026
  214. #ifdef UNICODE
  215. #define IDD_SERVERNOTREG                IDD_SERVERNOTREGW
  216. #define IDD_LINKTYPECHANGED             IDD_LINKTYPECHANGEDW
  217. #else
  218. #define IDD_SERVERNOTREG                IDD_SERVERNOTREGA
  219. #define IDD_LINKTYPECHANGED             IDD_LINKTYPECHANGEDA
  220. #endif
  221.  
  222. #ifndef RC_INVOKED
  223.  
  224. #pragma pack(push, 8)
  225.  
  226. #ifndef EXPORT
  227.         #define EXPORT
  228. #endif
  229.  
  230. // Delimeter used to separate ItemMoniker pieces of a composite moniker
  231. #ifdef _MAC
  232.         #define OLESTDDELIM ":"
  233. #else
  234.         #define OLESTDDELIM TEXT("\\")
  235. #endif
  236.  
  237. // Hook type used in all structures.
  238. typedef UINT (CALLBACK *LPFNOLEUIHOOK)(HWND, UINT, WPARAM, LPARAM);
  239.  
  240. // Strings for registered messages
  241. #define SZOLEUI_MSG_HELP                TEXT("OLEUI_MSG_HELP")
  242. #define SZOLEUI_MSG_ENDDIALOG           TEXT("OLEUI_MSG_ENDDIALOG")
  243. #define SZOLEUI_MSG_BROWSE              TEXT("OLEUI_MSG_BROWSE")
  244. #define SZOLEUI_MSG_CHANGEICON          TEXT("OLEUI_MSG_CHANGEICON")
  245. #define SZOLEUI_MSG_CLOSEBUSYDIALOG     TEXT("OLEUI_MSG_CLOSEBUSYDIALOG")
  246. #define SZOLEUI_MSG_CONVERT             TEXT("OLEUI_MSG_CONVERT")
  247. #define SZOLEUI_MSG_CHANGESOURCE        TEXT("OLEUI_MSG_CHANGESOURCE")
  248. #define SZOLEUI_MSG_ADDCONTROL          TEXT("OLEUI_MSG_ADDCONTROL")
  249. #define SZOLEUI_MSG_BROWSE_OFN          TEXT("OLEUI_MSG_BROWSE_OFN")
  250.  
  251. // Identifiers for SZOLEUI_MSG_BROWSE_OFN (in wParam)
  252. #define ID_BROWSE_CHANGEICON            1
  253. #define ID_BROWSE_INSERTFILE            2
  254. #define ID_BROWSE_ADDCONTROL            3
  255. #define ID_BROWSE_CHANGESOURCE          4
  256.  
  257. // Standard success/error definitions
  258. #define OLEUI_FALSE                     0
  259. #define OLEUI_SUCCESS                   1     // No error, same as OLEUI_OK
  260. #define OLEUI_OK                        1     // OK button pressed
  261. #define OLEUI_CANCEL                    2     // Cancel button pressed
  262.  
  263. #define OLEUI_ERR_STANDARDMIN           100
  264. #define OLEUI_ERR_STRUCTURENULL         101   // Standard field validation
  265. #define OLEUI_ERR_STRUCTUREINVALID      102
  266. #define OLEUI_ERR_CBSTRUCTINCORRECT     103
  267. #define OLEUI_ERR_HWNDOWNERINVALID      104
  268. #define OLEUI_ERR_LPSZCAPTIONINVALID    105
  269. #define OLEUI_ERR_LPFNHOOKINVALID       106
  270. #define OLEUI_ERR_HINSTANCEINVALID      107
  271. #define OLEUI_ERR_LPSZTEMPLATEINVALID   108
  272. #define OLEUI_ERR_HRESOURCEINVALID      109
  273.  
  274. #define OLEUI_ERR_FINDTEMPLATEFAILURE   110   // Initialization errors
  275. #define OLEUI_ERR_LOADTEMPLATEFAILURE   111
  276. #define OLEUI_ERR_DIALOGFAILURE         112
  277. #define OLEUI_ERR_LOCALMEMALLOC         113
  278. #define OLEUI_ERR_GLOBALMEMALLOC        114
  279. #define OLEUI_ERR_LOADSTRING            115
  280. #define OLEUI_ERR_OLEMEMALLOC           116
  281.  
  282. #define OLEUI_ERR_STANDARDMAX           116  // Start here for specific errors.
  283.  
  284. // Miscellaneous utility functions.
  285. STDAPI_(BOOL) OleUIAddVerbMenuW(LPOLEOBJECT lpOleObj, LPCWSTR lpszShortType,
  286.         HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax,
  287.         BOOL bAddConvert, UINT idConvert, HMENU FAR *lphMenu);
  288. STDAPI_(BOOL) OleUIAddVerbMenuA(LPOLEOBJECT lpOleObj, LPCSTR lpszShortType,
  289.         HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax,
  290.         BOOL bAddConvert, UINT idConvert, HMENU FAR *lphMenu);
  291. #ifdef UNICODE
  292. #define OleUIAddVerbMenu OleUIAddVerbMenuW
  293. #else
  294. #define OleUIAddVerbMenu OleUIAddVerbMenuA
  295. #endif
  296.  
  297. /////////////////////////////////////////////////////////////////////////////
  298. // INSERT OBJECT DIALOG
  299.  
  300. typedef struct tagOLEUIINSERTOBJECTW
  301. {
  302.         // These IN fields are standard across all OLEUI dialog functions.
  303.         DWORD           cbStruct;       // Structure Size
  304.         DWORD           dwFlags;        // IN-OUT:  Flags
  305.         HWND            hWndOwner;      // Owning window
  306.         LPCWSTR         lpszCaption;    // Dialog caption bar contents
  307.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  308.         LPARAM          lCustData;      // Custom data to pass to hook
  309.         HINSTANCE       hInstance;      // Instance for customized template name
  310.         LPCWSTR         lpszTemplate;   // Customized template name
  311.         HRSRC           hResource;      // Customized template handle
  312.  
  313.         // Specifics for OLEUIINSERTOBJECT.
  314.         CLSID           clsid;          // OUT: Return space for class ID
  315.         LPWSTR          lpszFile;       // IN-OUT: Filename for inserts or links
  316.         UINT            cchFile;        // IN: Size of lpszFile buffer: MAX_PATH
  317.         UINT            cClsidExclude;  // IN: CLSIDs in lpClsidExclude
  318.         LPCLSID         lpClsidExclude; // IN: List of CLSIDs to exclude from listing.
  319.  
  320.         // Specific to create objects if flags say so
  321.         IID             iid;            // IN: Requested interface on creation.
  322.         DWORD           oleRender;      // IN: Rendering option
  323.         LPFORMATETC     lpFormatEtc;    // IN: Desired format
  324.         LPOLECLIENTSITE lpIOleClientSite;   // IN: Site to be use for the object.
  325.         LPSTORAGE       lpIStorage;     // IN: Storage used for the object
  326.         LPVOID FAR      *ppvObj;        // OUT: Where the object is returned.
  327.         SCODE           sc;             // OUT: Result of creation calls.
  328.         HGLOBAL         hMetaPict;      // OUT: metafile aspect (METAFILEPICT)
  329.  
  330. } OLEUIINSERTOBJECTW, *POLEUIINSERTOBJECTW, FAR *LPOLEUIINSERTOBJECTW;
  331. typedef struct tagOLEUIINSERTOBJECTA
  332. {
  333.         // These IN fields are standard across all OLEUI dialog functions.
  334.         DWORD           cbStruct;       // Structure Size
  335.         DWORD           dwFlags;        // IN-OUT:  Flags
  336.         HWND            hWndOwner;      // Owning window
  337.         LPCSTR          lpszCaption;    // Dialog caption bar contents
  338.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  339.         LPARAM          lCustData;      // Custom data to pass to hook
  340.         HINSTANCE       hInstance;      // Instance for customized template name
  341.         LPCSTR          lpszTemplate;   // Customized template name
  342.         HRSRC           hResource;      // Customized template handle
  343.  
  344.         // Specifics for OLEUIINSERTOBJECT.
  345.         CLSID           clsid;          // OUT: Return space for class ID
  346.         LPSTR           lpszFile;       // IN-OUT: Filename for inserts or links
  347.         UINT            cchFile;        // IN: Size of lpszFile buffer: MAX_PATH
  348.         UINT            cClsidExclude;  // IN: CLSIDs in lpClsidExclude
  349.         LPCLSID         lpClsidExclude; // IN: List of CLSIDs to exclude from listing.
  350.  
  351.         // Specific to create objects if flags say so
  352.         IID             iid;            // IN: Requested interface on creation.
  353.         DWORD           oleRender;      // IN: Rendering option
  354.         LPFORMATETC     lpFormatEtc;    // IN: Desired format
  355.         LPOLECLIENTSITE lpIOleClientSite;   // IN: Site to be use for the object.
  356.         LPSTORAGE       lpIStorage;     // IN: Storage used for the object
  357.         LPVOID FAR      *ppvObj;        // OUT: Where the object is returned.
  358.         SCODE           sc;             // OUT: Result of creation calls.
  359.         HGLOBAL         hMetaPict;      // OUT: metafile aspect (METAFILEPICT)
  360.  
  361. } OLEUIINSERTOBJECTA, *POLEUIINSERTOBJECTA, FAR *LPOLEUIINSERTOBJECTA;
  362.  
  363. STDAPI_(UINT) OleUIInsertObjectW(LPOLEUIINSERTOBJECTW);
  364. STDAPI_(UINT) OleUIInsertObjectA(LPOLEUIINSERTOBJECTA);
  365.  
  366. #ifdef UNICODE
  367. #define tagOLEUIINSERTOBJECT tagOLEUIINSERTOBJECTW
  368. #define OLEUIINSERTOBJECT OLEUIINSERTOBJECTW
  369. #define POLEUIINSERTOBJECT POLEUIINSERTOBJECTW
  370. #define LPOLEUIINSERTOBJECT LPOLEUIINSERTOBJECTW
  371. #define OleUIInsertObject OleUIInsertObjectW
  372. #else
  373. #define tagOLEUIINSERTOBJECT tagOLEUIINSERTOBJECTA
  374. #define OLEUIINSERTOBJECT OLEUIINSERTOBJECTA
  375. #define POLEUIINSERTOBJECT POLEUIINSERTOBJECTA
  376. #define LPOLEUIINSERTOBJECT LPOLEUIINSERTOBJECTA
  377. #define OleUIInsertObject OleUIInsertObjectA
  378. #endif
  379.  
  380. // Insert Object flags
  381. #define IOF_SHOWHELP                    0x00000001L
  382. #define IOF_SELECTCREATENEW             0x00000002L
  383. #define IOF_SELECTCREATEFROMFILE        0x00000004L
  384. #define IOF_CHECKLINK                   0x00000008L
  385. #define IOF_CHECKDISPLAYASICON          0x00000010L
  386. #define IOF_CREATENEWOBJECT             0x00000020L
  387. #define IOF_CREATEFILEOBJECT            0x00000040L
  388. #define IOF_CREATELINKOBJECT            0x00000080L
  389. #define IOF_DISABLELINK                 0x00000100L
  390. #define IOF_VERIFYSERVERSEXIST          0x00000200L
  391. #define IOF_DISABLEDISPLAYASICON        0x00000400L
  392. #define IOF_HIDECHANGEICON              0x00000800L
  393. #define IOF_SHOWINSERTCONTROL           0x00001000L
  394. #define IOF_SELECTCREATECONTROL         0x00002000L
  395.  
  396. // Insert Object specific error codes
  397. #define OLEUI_IOERR_LPSZFILEINVALID         (OLEUI_ERR_STANDARDMAX+0)
  398. #define OLEUI_IOERR_LPSZLABELINVALID        (OLEUI_ERR_STANDARDMAX+1)
  399. #define OLEUI_IOERR_HICONINVALID            (OLEUI_ERR_STANDARDMAX+2)
  400. #define OLEUI_IOERR_LPFORMATETCINVALID      (OLEUI_ERR_STANDARDMAX+3)
  401. #define OLEUI_IOERR_PPVOBJINVALID           (OLEUI_ERR_STANDARDMAX+4)
  402. #define OLEUI_IOERR_LPIOLECLIENTSITEINVALID (OLEUI_ERR_STANDARDMAX+5)
  403. #define OLEUI_IOERR_LPISTORAGEINVALID       (OLEUI_ERR_STANDARDMAX+6)
  404. #define OLEUI_IOERR_SCODEHASERROR           (OLEUI_ERR_STANDARDMAX+7)
  405. #define OLEUI_IOERR_LPCLSIDEXCLUDEINVALID   (OLEUI_ERR_STANDARDMAX+8)
  406. #define OLEUI_IOERR_CCHFILEINVALID          (OLEUI_ERR_STANDARDMAX+9)
  407.  
  408. /////////////////////////////////////////////////////////////////////////////
  409. // PASTE SPECIAL DIALOG
  410.  
  411. // The OLEUIPASTEFLAG enumeration is used by the OLEUIPASTEENTRY structure.
  412. //
  413. // OLEUIPASTE_ENABLEICON: If the container does not specify this flag for
  414. //      the entry in the OLEUIPASTEENTRY array passed as input to
  415. //      OleUIPasteSpecial, the DisplayAsIcon button will be unchecked and
  416. //      disabled when the the user selects the format that corresponds to
  417. //      the entry.
  418. //
  419. // OLEUIPASTE_PASTEONLY: Indicates that the entry in the OLEUIPASTEENTRY
  420. //      array is valid for pasting only.
  421. //
  422. // OLEUIPASTE_PASTE: Indicates that the entry in the OLEUIPASTEENTRY array
  423. //      is valid for pasting. It may also be valid for linking if any of
  424. //      the following linking flags are specified.
  425. //
  426. // If the entry in the OLEUIPASTEENTRY array is valid for linking, the
  427. // following flags indicate which link types are acceptable by OR'ing
  428. // together the appropriate OLEUIPASTE_LINKTYPE<#> values.
  429. //
  430. // These values correspond as follows to the array of link types passed to
  431. // OleUIPasteSpecial:
  432. //
  433. //   OLEUIPASTE_LINKTYPE1 = arrLinkTypes[0]
  434. //   OLEUIPASTE_LINKTYPE2 = arrLinkTypes[1]
  435. //   OLEUIPASTE_LINKTYPE3 = arrLinkTypes[2]
  436. //   OLEUIPASTE_LINKTYPE4 = arrLinkTypes[3]
  437. //   OLEUIPASTE_LINKTYPE5 = arrLinkTypes[4]
  438. //   OLEUIPASTE_LINKTYPE6 = arrLinkTypes[5]
  439. //   OLEUIPASTE_LINKTYPE7 = arrLinkTypes[6]
  440. //   OLEUIPASTE_LINKTYPE8 = arrLinkTypes[7]
  441. //
  442. // where,
  443. //   UINT arrLinkTypes[8] is an array of registered clipboard formats for
  444. //   linking. A maximium of 8 link types are allowed.
  445.  
  446. typedef enum tagOLEUIPASTEFLAG
  447. {
  448.    OLEUIPASTE_ENABLEICON    = 2048,     // enable display as icon
  449.    OLEUIPASTE_PASTEONLY     = 0,
  450.    OLEUIPASTE_PASTE         = 512,
  451.    OLEUIPASTE_LINKANYTYPE   = 1024,
  452.    OLEUIPASTE_LINKTYPE1     = 1,
  453.    OLEUIPASTE_LINKTYPE2     = 2,
  454.    OLEUIPASTE_LINKTYPE3     = 4,
  455.    OLEUIPASTE_LINKTYPE4     = 8,
  456.    OLEUIPASTE_LINKTYPE5     = 16,
  457.    OLEUIPASTE_LINKTYPE6     = 32,
  458.    OLEUIPASTE_LINKTYPE7     = 64,
  459.    OLEUIPASTE_LINKTYPE8     = 128
  460. } OLEUIPASTEFLAG;
  461.  
  462. // OLEUIPASTEENTRY structure
  463. //
  464. // An array of OLEUIPASTEENTRY entries is specified for the PasteSpecial
  465. // dialog box. Each entry includes a FORMATETC which specifies the
  466. // formats that are acceptable, a string that is to represent the format
  467. // in the  dialog's list box, a string to customize the result text of the
  468. // dialog and a set of flags from the OLEUIPASTEFLAG enumeration.  The
  469. // flags indicate if the entry is valid for pasting only, linking only or
  470. // both pasting and linking.
  471.  
  472. typedef struct tagOLEUIPASTEENTRYW
  473. {
  474.    FORMATETC        fmtetc;         // Format that is acceptable.
  475.    LPCWSTR          lpstrFormatName;// String that represents the format
  476.                                                                         // to the user. %s is replaced by the
  477.                                                                         // full user type name of the object.
  478.    LPCWSTR          lpstrResultText;// String to customize the result text
  479.                                                                         // of the dialog when the user
  480.                                                                         // selects the format correspoding to
  481.                                                                         // this entry. Any %s in this string
  482.                                                                         // is replaced by the the application
  483.                                                                         // name or FullUserTypeName of the
  484.                                                                         // object on the clipboard.
  485.    DWORD            dwFlags;        // Values from OLEUIPASTEFLAG enum
  486.    DWORD            dwScratchSpace; // Scratch space used internally.
  487.  
  488. } OLEUIPASTEENTRYW, *POLEUIPASTEENTRYW, FAR *LPOLEUIPASTEENTRYW;
  489. typedef struct tagOLEUIPASTEENTRYA
  490. {
  491.    FORMATETC        fmtetc;         // Format that is acceptable.
  492.    LPCSTR           lpstrFormatName;// String that represents the format
  493.                                                                         // to the user. %s is replaced by the
  494.                                                                         // full user type name of the object.
  495.    LPCSTR           lpstrResultText;// String to customize the result text
  496.                                                                         // of the dialog when the user
  497.                                                                         // selects the format correspoding to
  498.                                                                         // this entry. Any %s in this string
  499.                                                                         // is replaced by the the application
  500.                                                                         // name or FullUserTypeName of the
  501.                                                                         // object on the clipboard.
  502.    DWORD            dwFlags;        // Values from OLEUIPASTEFLAG enum
  503.    DWORD            dwScratchSpace; // Scratch space used internally.
  504.  
  505. } OLEUIPASTEENTRYA, *POLEUIPASTEENTRYA, FAR *LPOLEUIPASTEENTRYA;
  506. #ifdef UNICODE
  507. #define tagOLEUIPASTEENTRY tagOLEUIPASTEENTRYW
  508. #define OLEUIPASTEENTRY OLEUIPASTEENTRYW
  509. #define POLEUIPASTEENTRY POLEUIPASTEENTRYW
  510. #define LPOLEUIPASTEENTRY LPOLEUIPASTEENTRYW
  511. #else
  512. #define tagOLEUIPASTEENTRY tagOLEUIPASTEENTRYA
  513. #define OLEUIPASTEENTRY OLEUIPASTEENTRYA
  514. #define POLEUIPASTEENTRY POLEUIPASTEENTRYA
  515. #define LPOLEUIPASTEENTRY LPOLEUIPASTEENTRYA
  516. #endif
  517.  
  518. // Maximum number of link types
  519. #define PS_MAXLINKTYPES  8
  520.  
  521. typedef struct tagOLEUIPASTESPECIALW
  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.         LPCWSTR         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.         LPCWSTR         lpszTemplate;   // Customized template name
  532.         HRSRC           hResource;      // Customized template handle
  533.  
  534.         // Specifics for OLEUIPASTESPECIAL.
  535.         LPDATAOBJECT    lpSrcDataObj;   // IN-OUT: Source IDataObject* on the clipboard
  536.             // If lpSrcDataObj is NULL when OleUIPasteSpecial is called, then
  537.             // OleUIPasteSpecial will attempt to retrieve a pointer to an
  538.             // IDataObject from the clipboard.  If OleUIPasteSpecial succeeds
  539.             // then it is the caller's responsibility to free the IDataObject
  540.             // returned in lpSrcDataObj.
  541.         LPOLEUIPASTEENTRYW arrPasteEntries;// IN: Array of acceptable formats
  542.         int             cPasteEntries;  // IN: No. of OLEUIPASTEENTRY array entries
  543.         UINT FAR*       arrLinkTypes;   // IN: List of acceptable link types
  544.         int             cLinkTypes;     // IN: Number of link types
  545.         UINT            cClsidExclude;  // IN: Number of CLSIDs in lpClsidExclude
  546.         LPCLSID         lpClsidExclude; // IN: List of CLSIDs to exclude from list.
  547.         int             nSelectedIndex; // OUT: Index that the user selected
  548.         BOOL            fLink;          // OUT: Indicates if Paste or PasteLink
  549.         HGLOBAL         hMetaPict;      // OUT: Handle to Metafile containing icon
  550.         SIZEL           sizel;          // OUT: size of object/link in its source
  551.                                                                         //  may be 0,0 if different display
  552.                                                                         //  aspect is chosen.
  553.  
  554. } OLEUIPASTESPECIALW, *POLEUIPASTESPECIALW, FAR *LPOLEUIPASTESPECIALW;
  555. typedef struct tagOLEUIPASTESPECIALA
  556. {
  557.         // These IN fields are standard across all OLEUI dialog functions.
  558.         DWORD           cbStruct;       // Structure Size
  559.         DWORD           dwFlags;        // IN-OUT:  Flags
  560.         HWND            hWndOwner;      // Owning window
  561.         LPCSTR          lpszCaption;    // Dialog caption bar contents
  562.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  563.         LPARAM          lCustData;      // Custom data to pass to hook
  564.         HINSTANCE       hInstance;      // Instance for customized template name
  565.         LPCSTR          lpszTemplate;   // Customized template name
  566.         HRSRC           hResource;      // Customized template handle
  567.  
  568.         // Specifics for OLEUIPASTESPECIAL.
  569.         LPDATAOBJECT    lpSrcDataObj;   // IN-OUT: Source IDataObject* on the clipboard
  570.             // If lpSrcDataObj is NULL when OleUIPasteSpecial is called, then
  571.             // OleUIPasteSpecial will attempt to retrieve a pointer to an
  572.             // IDataObject from the clipboard.  If OleUIPasteSpecial succeeds
  573.             // then it is the caller's responsibility to free the IDataObject
  574.             // returned in lpSrcDataObj.
  575.         LPOLEUIPASTEENTRYA arrPasteEntries;// IN: Array of acceptable formats
  576.         int             cPasteEntries;  // IN: No. of OLEUIPASTEENTRY array entries
  577.         UINT FAR*       arrLinkTypes;   // IN: List of acceptable link types
  578.         int             cLinkTypes;     // IN: Number of link types
  579.         UINT            cClsidExclude;  // IN: Number of CLSIDs in lpClsidExclude
  580.         LPCLSID         lpClsidExclude; // IN: List of CLSIDs to exclude from list.
  581.         int             nSelectedIndex; // OUT: Index that the user selected
  582.         BOOL            fLink;          // OUT: Indicates if Paste or PasteLink
  583.         HGLOBAL         hMetaPict;      // OUT: Handle to Metafile containing icon
  584.         SIZEL           sizel;          // OUT: size of object/link in its source
  585.                                                                         //  may be 0,0 if different display
  586.                                                                         //  aspect is chosen.
  587.  
  588. } OLEUIPASTESPECIALA, *POLEUIPASTESPECIALA, FAR *LPOLEUIPASTESPECIALA;
  589. #ifdef UNICODE
  590.  
  591. #define tagOLEUIPASTESPECIAL tagOLEUIPASTESPECIALW
  592. #define OLEUIPASTESPECIAL OLEUIPASTESPECIALW
  593. #define POLEUIPASTESPECIAL POLEUIPASTESPECIALW
  594. #define LPOLEUIPASTESPECIAL LPOLEUIPASTESPECIALW
  595. #else
  596. #define tagOLEUIPASTESPECIAL tagOLEUIPASTESPECIALA
  597. #define OLEUIPASTESPECIAL OLEUIPASTESPECIALA
  598. #define POLEUIPASTESPECIAL POLEUIPASTESPECIALA
  599. #define LPOLEUIPASTESPECIAL LPOLEUIPASTESPECIALA
  600. #endif
  601.  
  602. STDAPI_(UINT) OleUIPasteSpecialW(LPOLEUIPASTESPECIALW);
  603. STDAPI_(UINT) OleUIPasteSpecialA(LPOLEUIPASTESPECIALA);
  604. #ifdef UNICODE
  605. #define OleUIPasteSpecial OleUIPasteSpecialW
  606. #else
  607. #define OleUIPasteSpecial OleUIPasteSpecialA
  608. #endif
  609.  
  610. // Paste Special specific flags
  611. #define PSF_SHOWHELP                    0x00000001L
  612. #define PSF_SELECTPASTE                 0x00000002L
  613. #define PSF_SELECTPASTELINK             0x00000004L
  614. // NOTE: PSF_CHECKDISPLAYASICON is strictly an output flag.
  615. //       It is ignored if set when calling OleUIPasteSpecial.
  616. #define PSF_CHECKDISPLAYASICON          0x00000008L
  617. #define PSF_DISABLEDISPLAYASICON        0x00000010L
  618. #define PSF_HIDECHANGEICON              0x00000020L
  619. #define PSF_STAYONCLIPBOARDCHANGE       0x00000040L
  620. #define PSF_NOREFRESHDATAOBJECT         0x00000080L
  621.  
  622. // Paste Special specific error codes
  623. #define OLEUI_IOERR_SRCDATAOBJECTINVALID    (OLEUI_ERR_STANDARDMAX+0)
  624. #define OLEUI_IOERR_ARRPASTEENTRIESINVALID  (OLEUI_ERR_STANDARDMAX+1)
  625. #define OLEUI_IOERR_ARRLINKTYPESINVALID     (OLEUI_ERR_STANDARDMAX+2)
  626. #define OLEUI_PSERR_CLIPBOARDCHANGED        (OLEUI_ERR_STANDARDMAX+3)
  627. #define OLEUI_PSERR_GETCLIPBOARDFAILED      (OLEUI_ERR_STANDARDMAX+4)
  628.  
  629. /////////////////////////////////////////////////////////////////////////////
  630. // EDIT LINKS DIALOG
  631.  
  632. // IOleUILinkContainer interface
  633. //
  634. //    This interface must be implemented by container applications that
  635. //    want to use the EditLinks dialog. the EditLinks dialog calls back
  636. //    to the container app to perform the OLE functions to manipulate
  637. //    the links within the container.
  638.  
  639. #undef  INTERFACE
  640. #define INTERFACE   IOleUILinkContainerW
  641.  
  642. DECLARE_INTERFACE_(IOleUILinkContainerW, IUnknown)
  643. {
  644.         // *** IUnknown methods *** //
  645.         STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  646.         STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  647.         STDMETHOD_(ULONG,Release) (THIS) PURE;
  648.  
  649.         // *** IOleUILinkContainer *** //
  650.         STDMETHOD_(DWORD,GetNextLink) (THIS_ DWORD dwLink) PURE;
  651.         STDMETHOD(SetLinkUpdateOptions) (THIS_ DWORD dwLink,
  652.                 DWORD dwUpdateOpt) PURE;
  653.         STDMETHOD(GetLinkUpdateOptions) (THIS_ DWORD dwLink,
  654.                 DWORD FAR* lpdwUpdateOpt) PURE;
  655.         STDMETHOD(SetLinkSource) (THIS_ DWORD dwLink, LPWSTR lpszDisplayName,
  656.                 ULONG lenFileName, ULONG FAR* pchEaten, BOOL fValidateSource) PURE;
  657.         STDMETHOD(GetLinkSource) (THIS_ DWORD dwLink,
  658.                 LPWSTR FAR* lplpszDisplayName, ULONG FAR* lplenFileName,
  659.                 LPWSTR FAR* lplpszFullLinkType, LPWSTR FAR* lplpszShortLinkType,
  660.                 BOOL FAR* lpfSourceAvailable, BOOL FAR* lpfIsSelected) PURE;
  661.         STDMETHOD(OpenLinkSource) (THIS_ DWORD dwLink) PURE;
  662.         STDMETHOD(UpdateLink) (THIS_ DWORD dwLink,
  663.                 BOOL fErrorMessage, BOOL fReserved) PURE;
  664.         STDMETHOD(CancelLink) (THIS_ DWORD dwLink) PURE;
  665. };
  666.  
  667. typedef IOleUILinkContainerW FAR* LPOLEUILINKCONTAINERW;
  668.  
  669. #undef  INTERFACE
  670. #define INTERFACE   IOleUILinkContainerA
  671.  
  672. DECLARE_INTERFACE_(IOleUILinkContainerA, IUnknown)
  673. {
  674.         // *** IUnknown methods *** //
  675.         STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  676.         STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  677.         STDMETHOD_(ULONG,Release) (THIS) PURE;
  678.  
  679.         // *** IOleUILinkContainer *** //
  680.         STDMETHOD_(DWORD,GetNextLink) (THIS_ DWORD dwLink) PURE;
  681.         STDMETHOD(SetLinkUpdateOptions) (THIS_ DWORD dwLink,
  682.                 DWORD dwUpdateOpt) PURE;
  683.         STDMETHOD(GetLinkUpdateOptions) (THIS_ DWORD dwLink,
  684.                 DWORD FAR* lpdwUpdateOpt) PURE;
  685.         STDMETHOD(SetLinkSource) (THIS_ DWORD dwLink, LPSTR lpszDisplayName,
  686.                 ULONG lenFileName, ULONG FAR* pchEaten, BOOL fValidateSource) PURE;
  687.         STDMETHOD(GetLinkSource) (THIS_ DWORD dwLink,
  688.                 LPSTR FAR* lplpszDisplayName, ULONG FAR* lplenFileName,
  689.                 LPSTR FAR* lplpszFullLinkType, LPSTR FAR* lplpszShortLinkType,
  690.                 BOOL FAR* lpfSourceAvailable, BOOL FAR* lpfIsSelected) PURE;
  691.         STDMETHOD(OpenLinkSource) (THIS_ DWORD dwLink) PURE;
  692.         STDMETHOD(UpdateLink) (THIS_ DWORD dwLink,
  693.                 BOOL fErrorMessage, BOOL fReserved) PURE;
  694.         STDMETHOD(CancelLink) (THIS_ DWORD dwLink) PURE;
  695. };
  696.  
  697. typedef IOleUILinkContainerA FAR* LPOLEUILINKCONTAINERA;
  698.  
  699. #ifdef UNICODE
  700. #define IOleUILinkContainer IOleUILinkContainerW
  701. #define IOleUILinkContainerVtbl IOleUILinkContainerWVtbl
  702. #define LPOLEUILINKCONTAINER LPOLEUILINKCONTAINERW
  703. #else
  704. #define IOleUILinkContainer IOleUILinkContainerA
  705. #define IOleUILinkContainerVtbl IOleUILinkContainerAVtbl
  706. #define LPOLEUILINKCONTAINER LPOLEUILINKCONTAINERA
  707. #endif
  708.  
  709. typedef struct tagOLEUIEDITLINKSW
  710. {
  711.         // These IN fields are standard across all OLEUI dialog functions.
  712.         DWORD           cbStruct;       // Structure Size
  713.         DWORD           dwFlags;        // IN-OUT: Flags
  714.         HWND            hWndOwner;      // Owning window
  715.         LPCWSTR         lpszCaption;    // Dialog caption bar contents
  716.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  717.         LPARAM          lCustData;      // Custom data to pass to hook
  718.         HINSTANCE       hInstance;      // Instance for customized template name
  719.         LPCWSTR         lpszTemplate;   // Customized template name
  720.         HRSRC           hResource;      // Customized template handle
  721.  
  722.         // Specifics for OLEUIEDITLINKS.
  723.         LPOLEUILINKCONTAINERW lpOleUILinkContainer;  // IN: Interface to manipulate
  724.                                                                                                 // links in the container
  725.  
  726. } OLEUIEDITLINKSW, *POLEUIEDITLINKSW, FAR *LPOLEUIEDITLINKSW;
  727.  
  728. typedef struct tagOLEUIEDITLINKSA
  729. {
  730.         // These IN fields are standard across all OLEUI dialog functions.
  731.         DWORD           cbStruct;       // Structure Size
  732.         DWORD           dwFlags;        // IN-OUT: Flags
  733.         HWND            hWndOwner;      // Owning window
  734.         LPCSTR          lpszCaption;    // Dialog caption bar contents
  735.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  736.         LPARAM          lCustData;      // Custom data to pass to hook
  737.         HINSTANCE       hInstance;      // Instance for customized template name
  738.         LPCSTR          lpszTemplate;   // Customized template name
  739.         HRSRC           hResource;      // Customized template handle
  740.  
  741.         // Specifics for OLEUIEDITLINKS.
  742.         LPOLEUILINKCONTAINERA lpOleUILinkContainer;  // IN: Interface to manipulate
  743.                                                                                                 // links in the container
  744.  
  745. } OLEUIEDITLINKSA, *POLEUIEDITLINKSA, FAR *LPOLEUIEDITLINKSA;
  746.  
  747. #ifdef UNICODE
  748. #define tagOLEUIEDITLINKS tagOLEUIEDITLINKSW
  749. #define OLEUIEDITLINKS OLEUIEDITLINKSW
  750. #define POLEUIEDITLINKS POLEUIEDITLINKSW
  751. #define LPOLEUIEDITLINKS LPOLEUIEDITLINKSW
  752. #else
  753. #define tagOLEUIEDITLINKS tagOLEUIEDITLINKSA
  754. #define OLEUIEDITLINKS OLEUIEDITLINKSA
  755. #define POLEUIEDITLINKS POLEUIEDITLINKSA
  756. #define LPOLEUIEDITLINKS LPOLEUIEDITLINKSA
  757. #endif
  758.  
  759. #define OLEUI_ELERR_LINKCNTRNULL        (OLEUI_ERR_STANDARDMAX+0)
  760. #define OLEUI_ELERR_LINKCNTRINVALID     (OLEUI_ERR_STANDARDMAX+1)
  761.  
  762. STDAPI_(UINT) OleUIEditLinksW(LPOLEUIEDITLINKSW);
  763. STDAPI_(UINT) OleUIEditLinksA(LPOLEUIEDITLINKSA);
  764.  
  765. #ifdef UNICODE
  766. #define OleUIEditLinks OleUIEditLinksW
  767. #else
  768. #define OleUIEditLinks OleUIEditLinksA
  769. #endif
  770.  
  771. // Edit Links flags
  772. #define ELF_SHOWHELP                    0x00000001L
  773. #define ELF_DISABLEUPDATENOW            0x00000002L
  774. #define ELF_DISABLEOPENSOURCE           0x00000004L
  775. #define ELF_DISABLECHANGESOURCE         0x00000008L
  776. #define ELF_DISABLECANCELLINK           0x00000010L
  777.  
  778. /////////////////////////////////////////////////////////////////////////////
  779. // CHANGE ICON DIALOG
  780.  
  781. typedef struct tagOLEUICHANGEICONW
  782. {
  783.         // These IN fields are standard across all OLEUI dialog functions.
  784.         DWORD           cbStruct;       // Structure Size
  785.         DWORD           dwFlags;        // IN-OUT:  Flags
  786.         HWND            hWndOwner;      // Owning window
  787.         LPCWSTR         lpszCaption;    // Dialog caption bar contents
  788.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  789.         LPARAM          lCustData;      // Custom data to pass to hook
  790.         HINSTANCE       hInstance;      // Instance for customized template name
  791.         LPCWSTR         lpszTemplate;   // Customized template name
  792.         HRSRC           hResource;      // Customized template handle
  793.  
  794.         // Specifics for OLEUICHANGEICON.
  795.         HGLOBAL         hMetaPict;      // IN-OUT: Current and final image.
  796.                                                                         //  Source of the icon is embedded in
  797.                                                                         //  the metafile itself.
  798.         CLSID           clsid;          // IN: class used to get Default icon
  799.         WCHAR           szIconExe[MAX_PATH];    // IN: exlicit icon source path
  800.         int             cchIconExe;     // IN: number of characters in szIconExe
  801.  
  802. } OLEUICHANGEICONW, *POLEUICHANGEICONW, FAR *LPOLEUICHANGEICONW;
  803.  
  804. typedef struct tagOLEUICHANGEICONA
  805. {
  806.         // These IN fields are standard across all OLEUI dialog functions.
  807.         DWORD           cbStruct;       // Structure Size
  808.         DWORD           dwFlags;        // IN-OUT:  Flags
  809.         HWND            hWndOwner;      // Owning window
  810.         LPCSTR          lpszCaption;    // Dialog caption bar contents
  811.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  812.         LPARAM          lCustData;      // Custom data to pass to hook
  813.         HINSTANCE       hInstance;      // Instance for customized template name
  814.         LPCSTR          lpszTemplate;   // Customized template name
  815.         HRSRC           hResource;      // Customized template handle
  816.  
  817.         // Specifics for OLEUICHANGEICON.
  818.         HGLOBAL         hMetaPict;      // IN-OUT: Current and final image.
  819.                                                                         //  Source of the icon is embedded in
  820.                                                                         //  the metafile itself.
  821.         CLSID           clsid;          // IN: class used to get Default icon
  822.         CHAR            szIconExe[MAX_PATH];    // IN: exlicit icon source path
  823.         int             cchIconExe;     // IN: number of characters in szIconExe
  824.  
  825. } OLEUICHANGEICONA, *POLEUICHANGEICONA, FAR *LPOLEUICHANGEICONA;
  826.  
  827. STDAPI_(UINT) OleUIChangeIconW(LPOLEUICHANGEICONW);
  828. STDAPI_(UINT) OleUIChangeIconA(LPOLEUICHANGEICONA);
  829.  
  830. #ifdef UNICODE
  831. #define tagOLEUICHANGEICON tagOLEUICHANGEICONW
  832. #define OLEUICHANGEICON OLEUICHANGEICONW
  833. #define POLEUICHANGEICON POLEUICHANGEICONW
  834. #define LPOLEUICHANGEICON LPOLEUICHANGEICONW
  835. #define OleUIChangeIcon OleUIChangeIconW
  836. #else
  837. #define tagOLEUICHANGEICON tagOLEUICHANGEICONA
  838. #define OLEUICHANGEICON OLEUICHANGEICONA
  839. #define POLEUICHANGEICON POLEUICHANGEICONA
  840. #define LPOLEUICHANGEICON LPOLEUICHANGEICONA
  841. #define OleUIChangeIcon OleUIChangeIconA
  842. #endif
  843.  
  844. // Change Icon flags
  845. #define CIF_SHOWHELP                    0x00000001L
  846. #define CIF_SELECTCURRENT               0x00000002L
  847. #define CIF_SELECTDEFAULT               0x00000004L
  848. #define CIF_SELECTFROMFILE              0x00000008L
  849. #define CIF_USEICONEXE                  0x00000010L
  850.  
  851. // Change Icon specific error codes
  852. #define OLEUI_CIERR_MUSTHAVECLSID           (OLEUI_ERR_STANDARDMAX+0)
  853. #define OLEUI_CIERR_MUSTHAVECURRENTMETAFILE (OLEUI_ERR_STANDARDMAX+1)
  854. #define OLEUI_CIERR_SZICONEXEINVALID        (OLEUI_ERR_STANDARDMAX+2)
  855.  
  856. // Property used by ChangeIcon dialog to give its parent window access to
  857. // its hDlg. The PasteSpecial dialog may need to force the ChgIcon dialog
  858. // down if the clipboard contents change underneath it. if so it will send
  859. // a IDCANCEL command to the ChangeIcon dialog.
  860. #define PROP_HWND_CHGICONDLG    TEXT("HWND_CIDLG")
  861.  
  862. /////////////////////////////////////////////////////////////////////////////
  863. // CONVERT DIALOG
  864.  
  865. typedef struct tagOLEUICONVERTW
  866. {
  867.         // These IN fields are standard across all OLEUI dialog functions.
  868.         DWORD           cbStruct;       // Structure Size
  869.         DWORD           dwFlags;        // IN-OUT:  Flags
  870.         HWND            hWndOwner;      // Owning window
  871.         LPCWSTR         lpszCaption;    // Dialog caption bar contents
  872.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  873.         LPARAM          lCustData;      // Custom data to pass to hook
  874.         HINSTANCE       hInstance;      // Instance for customized template name
  875.         LPCWSTR         lpszTemplate;   // Customized template name
  876.         HRSRC           hResource;      // Customized template handle
  877.  
  878.         // Specifics for OLEUICONVERT.
  879.         CLSID           clsid;          // IN: Class ID sent in to dialog: IN only
  880.         CLSID           clsidConvertDefault;    // IN: use as convert default: IN only
  881.         CLSID           clsidActivateDefault;   // IN: use as activate default: IN only
  882.  
  883.         CLSID           clsidNew;       // OUT: Selected Class ID
  884.         DWORD           dvAspect;       // IN-OUT: either DVASPECT_CONTENT or
  885.                                                                         //  DVASPECT_ICON
  886.         WORD            wFormat;        // IN" Original data format
  887.         BOOL            fIsLinkedObject;// IN: true if object is linked
  888.         HGLOBAL         hMetaPict;      // IN-OUT: metafile icon image
  889.         LPWSTR          lpszUserType;   // IN-OUT: user type name of original class.
  890.                                                                         //      We'll do lookup if NULL.
  891.                                                                         //      This gets freed on exit.
  892.         BOOL            fObjectsIconChanged; // OUT: TRUE == ChangeIcon was called
  893.         LPWSTR          lpszDefLabel;   //IN-OUT: default label to use for icon.
  894.                                                                         //  if NULL, the short user type name
  895.                                                                         //  will be used. if the object is a
  896.                                                                         //  link, the caller should pass the
  897.                                                                         //  DisplayName of the link source
  898.                                                                         //  This gets freed on exit.
  899.  
  900.         UINT            cClsidExclude;  //IN: No. of CLSIDs in lpClsidExclude
  901.         LPCLSID         lpClsidExclude; //IN: List of CLSIDs to exclude from list
  902.  
  903. } OLEUICONVERTW, *POLEUICONVERTW, FAR *LPOLEUICONVERTW;
  904.  
  905. typedef struct tagOLEUICONVERTA
  906. {
  907.         // These IN fields are standard across all OLEUI dialog functions.
  908.         DWORD           cbStruct;       // Structure Size
  909.         DWORD           dwFlags;        // IN-OUT:  Flags
  910.         HWND            hWndOwner;      // Owning window
  911.         LPCSTR          lpszCaption;    // Dialog caption bar contents
  912.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  913.         LPARAM          lCustData;      // Custom data to pass to hook
  914.         HINSTANCE       hInstance;      // Instance for customized template name
  915.         LPCSTR          lpszTemplate;   // Customized template name
  916.         HRSRC           hResource;      // Customized template handle
  917.  
  918.         // Specifics for OLEUICONVERT.
  919.         CLSID           clsid;          // IN: Class ID sent in to dialog: IN only
  920.         CLSID           clsidConvertDefault;    // IN: use as convert default: IN only
  921.         CLSID           clsidActivateDefault;   // IN: use as activate default: IN only
  922.  
  923.         CLSID           clsidNew;       // OUT: Selected Class ID
  924.         DWORD           dvAspect;       // IN-OUT: either DVASPECT_CONTENT or
  925.                                                                         //  DVASPECT_ICON
  926.         WORD            wFormat;        // IN" Original data format
  927.         BOOL            fIsLinkedObject;// IN: true if object is linked
  928.         HGLOBAL         hMetaPict;      // IN-OUT: metafile icon image
  929.         LPSTR           lpszUserType;   // IN-OUT: user type name of original class.
  930.                                                                         //      We'll do lookup if NULL.
  931.                                                                         //      This gets freed on exit.
  932.         BOOL            fObjectsIconChanged; // OUT: TRUE == ChangeIcon was called
  933.         LPSTR           lpszDefLabel;   //IN-OUT: default label to use for icon.
  934.                                                                         //  if NULL, the short user type name
  935.                                                                         //  will be used. if the object is a
  936.                                                                         //  link, the caller should pass the
  937.                                                                         //  DisplayName of the link source
  938.                                                                         //  This gets freed on exit.
  939.  
  940.         UINT            cClsidExclude;  //IN: No. of CLSIDs in lpClsidExclude
  941.         LPCLSID         lpClsidExclude; //IN: List of CLSIDs to exclude from list
  942.  
  943. } OLEUICONVERTA, *POLEUICONVERTA, FAR *LPOLEUICONVERTA;
  944.  
  945. STDAPI_(UINT) OleUIConvertW(LPOLEUICONVERTW);
  946. STDAPI_(UINT) OleUIConvertA(LPOLEUICONVERTA);
  947.  
  948. #ifdef UNICODE
  949. #define tagOLEUICONVERT tagOLEUICONVERTW
  950. #define OLEUICONVERT OLEUICONVERTW
  951. #define POLEUICONVERT POLEUICONVERTW
  952. #define LPOLEUICONVERT LPOLEUICONVERTW
  953. #define OleUIConvert OleUIConvertW
  954. #else
  955. #define tagOLEUICONVERT tagOLEUICONVERTA
  956. #define OLEUICONVERT OLEUICONVERTA
  957. #define POLEUICONVERT POLEUICONVERTA
  958. #define LPOLEUICONVERT LPOLEUICONVERTA
  959. #define OleUIConvert OleUIConvertA
  960. #endif
  961.  
  962. // Determine if there is at least one class that can Convert or ActivateAs
  963. // the given clsid.
  964. STDAPI_(BOOL) OleUICanConvertOrActivateAs(
  965.         REFCLSID rClsid, BOOL fIsLinkedObject, WORD wFormat);
  966.  
  967. // Convert Dialog flags
  968. #define CF_SHOWHELPBUTTON               0x00000001L
  969. #define CF_SETCONVERTDEFAULT            0x00000002L
  970. #define CF_SETACTIVATEDEFAULT           0x00000004L
  971. #define CF_SELECTCONVERTTO              0x00000008L
  972. #define CF_SELECTACTIVATEAS             0x00000010L
  973. #define CF_DISABLEDISPLAYASICON         0x00000020L
  974. #define CF_DISABLEACTIVATEAS            0x00000040L
  975. #define CF_HIDECHANGEICON               0x00000080L
  976. #define CF_CONVERTONLY                  0x00000100L
  977.  
  978. // Convert specific error codes
  979. #define OLEUI_CTERR_CLASSIDINVALID      (OLEUI_ERR_STANDARDMAX+1)
  980. #define OLEUI_CTERR_DVASPECTINVALID     (OLEUI_ERR_STANDARDMAX+2)
  981. #define OLEUI_CTERR_CBFORMATINVALID     (OLEUI_ERR_STANDARDMAX+3)
  982. #define OLEUI_CTERR_HMETAPICTINVALID    (OLEUI_ERR_STANDARDMAX+4)
  983. #define OLEUI_CTERR_STRINGINVALID       (OLEUI_ERR_STANDARDMAX+5)
  984.  
  985. /////////////////////////////////////////////////////////////////////////////
  986. // BUSY DIALOG
  987.  
  988. typedef struct tagOLEUIBUSYW
  989. {
  990.         // These IN fields are standard across all OLEUI dialog functions.
  991.         DWORD           cbStruct;       // Structure Size
  992.         DWORD           dwFlags;        // IN-OUT: see below
  993.         HWND            hWndOwner;      // Owning window
  994.         LPCWSTR         lpszCaption;    // Dialog caption bar contents
  995.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  996.         LPARAM          lCustData;      // Custom data to pass to hook
  997.         HINSTANCE       hInstance;      // Instance for customized template name
  998.         LPCWSTR         lpszTemplate;   // Customized template name
  999.         HRSRC           hResource;      // Customized template handle
  1000.  
  1001.         // Specifics for OLEUIBUSY.
  1002.         HTASK           hTask;          // IN: HTask which is blocking
  1003.         HWND FAR *      lphWndDialog;   // OUT: Dialog's HWND is placed here
  1004.  
  1005. } OLEUIBUSYW, *POLEUIBUSYW, FAR *LPOLEUIBUSYW;
  1006.  
  1007. typedef struct tagOLEUIBUSYA
  1008. {
  1009.         // These IN fields are standard across all OLEUI dialog functions.
  1010.         DWORD           cbStruct;       // Structure Size
  1011.         DWORD           dwFlags;        // IN-OUT: see below
  1012.         HWND            hWndOwner;      // Owning window
  1013.         LPCSTR          lpszCaption;    // Dialog caption bar contents
  1014.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  1015.         LPARAM          lCustData;      // Custom data to pass to hook
  1016.         HINSTANCE       hInstance;      // Instance for customized template name
  1017.         LPCSTR          lpszTemplate;   // Customized template name
  1018.         HRSRC           hResource;      // Customized template handle
  1019.  
  1020.         // Specifics for OLEUIBUSY.
  1021.         HTASK           hTask;          // IN: HTask which is blocking
  1022.         HWND FAR *      lphWndDialog;   // OUT: Dialog's HWND is placed here
  1023.  
  1024. } OLEUIBUSYA, *POLEUIBUSYA, FAR *LPOLEUIBUSYA;
  1025.  
  1026. STDAPI_(UINT) OleUIBusyW(LPOLEUIBUSYW);
  1027. STDAPI_(UINT) OleUIBusyA(LPOLEUIBUSYA);
  1028.  
  1029. #ifdef UNICODE
  1030. #define tagOLEUIBUSY tagOLEUIBUSYW
  1031. #define OLEUIBUSY OLEUIBUSYW
  1032. #define POLEUIBUSY POLEUIBUSYW
  1033. #define LPOLEUIBUSY LPOLEUIBUSYW
  1034. #define OleUIBusy OleUIBusyW
  1035. #else
  1036. #define tagOLEUIBUSY tagOLEUIBUSYA
  1037. #define OLEUIBUSY OLEUIBUSYA
  1038. #define POLEUIBUSY POLEUIBUSYA
  1039. #define LPOLEUIBUSY LPOLEUIBUSYA
  1040. #define OleUIBusy OleUIBusyA
  1041. #endif
  1042.  
  1043. // Flags for the Busy dialog
  1044. #define BZ_DISABLECANCELBUTTON          0x00000001L
  1045. #define BZ_DISABLESWITCHTOBUTTON        0x00000002L
  1046. #define BZ_DISABLERETRYBUTTON           0x00000004L
  1047.  
  1048. #define BZ_NOTRESPONDINGDIALOG          0x00000008L
  1049.  
  1050. // Busy specific error/return codes
  1051. #define OLEUI_BZERR_HTASKINVALID     (OLEUI_ERR_STANDARDMAX+0)
  1052. #define OLEUI_BZ_SWITCHTOSELECTED    (OLEUI_ERR_STANDARDMAX+1)
  1053. #define OLEUI_BZ_RETRYSELECTED       (OLEUI_ERR_STANDARDMAX+2)
  1054. #define OLEUI_BZ_CALLUNBLOCKED       (OLEUI_ERR_STANDARDMAX+3)
  1055.  
  1056. /////////////////////////////////////////////////////////////////////////////
  1057. // CHANGE SOURCE DIALOG
  1058.  
  1059. // Data to and from the ChangeSource dialog hook
  1060. typedef struct tagOLEUICHANGESOURCEW
  1061. {
  1062.         // These IN fields are standard across all OLEUI dialog functions.
  1063.         DWORD           cbStruct;       // Structure Size
  1064.         DWORD           dwFlags;        // IN-OUT:  Flags
  1065.         HWND            hWndOwner;      // Owning window
  1066.         LPCWSTR         lpszCaption;    // Dialog caption bar contents
  1067.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  1068.         LPARAM          lCustData;      // Custom data to pass to hook
  1069.         HINSTANCE       hInstance;      // Instance for customized template name
  1070.         LPCWSTR         lpszTemplate;   // Customized template name
  1071.         HRSRC           hResource;      // Customized template handle
  1072.  
  1073.         // INTERNAL ONLY: do not modify these members
  1074.         OPENFILENAMEW*  lpOFN;          // pointer OPENFILENAME struct
  1075.         DWORD           dwReserved1[4]; // (reserved for future use)
  1076.  
  1077.         // Specifics for OLEUICHANGESOURCE.
  1078.         LPOLEUILINKCONTAINERW lpOleUILinkContainer;  // IN: used to validate link sources
  1079.         DWORD           dwLink;         // IN: magic# for lpOleUILinkContainer
  1080.         LPWSTR          lpszDisplayName;// IN-OUT: complete source display name
  1081.         ULONG           nFileLength;    // IN-OUT: file moniker part of lpszDisplayName
  1082.         LPWSTR          lpszFrom;       // OUT: prefix of source changed from
  1083.         LPWSTR          lpszTo;         // OUT: prefix of source changed to
  1084.  
  1085. } OLEUICHANGESOURCEW, *POLEUICHANGESOURCEW, FAR *LPOLEUICHANGESOURCEW;
  1086.  
  1087. typedef struct tagOLEUICHANGESOURCEA
  1088. {
  1089.         // These IN fields are standard across all OLEUI dialog functions.
  1090.         DWORD           cbStruct;       // Structure Size
  1091.         DWORD           dwFlags;        // IN-OUT:  Flags
  1092.         HWND            hWndOwner;      // Owning window
  1093.         LPCSTR          lpszCaption;    // Dialog caption bar contents
  1094.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  1095.         LPARAM          lCustData;      // Custom data to pass to hook
  1096.         HINSTANCE       hInstance;      // Instance for customized template name
  1097.         LPCSTR          lpszTemplate;   // Customized template name
  1098.         HRSRC           hResource;      // Customized template handle
  1099.  
  1100.         // INTERNAL ONLY: do not modify these members
  1101.         OPENFILENAMEA*  lpOFN;          // pointer OPENFILENAME struct
  1102.         DWORD           dwReserved1[4]; // (reserved for future use)
  1103.  
  1104.         // Specifics for OLEUICHANGESOURCE.
  1105.         LPOLEUILINKCONTAINERA lpOleUILinkContainer;  // IN: used to validate link sources
  1106.         DWORD           dwLink;         // IN: magic# for lpOleUILinkContainer
  1107.         LPSTR           lpszDisplayName;// IN-OUT: complete source display name
  1108.         ULONG           nFileLength;    // IN-OUT: file moniker part of lpszDisplayName
  1109.         LPSTR           lpszFrom;       // OUT: prefix of source changed from
  1110.         LPSTR           lpszTo;         // OUT: prefix of source changed to
  1111.  
  1112. } OLEUICHANGESOURCEA, *POLEUICHANGESOURCEA, FAR *LPOLEUICHANGESOURCEA;
  1113.  
  1114. STDAPI_(UINT) OleUIChangeSourceW(LPOLEUICHANGESOURCEW);
  1115. STDAPI_(UINT) OleUIChangeSourceA(LPOLEUICHANGESOURCEA);
  1116.  
  1117. #ifdef UNICODE
  1118. #define tagOLEUICHANGESOURCE tagOLEUICHANGESOURCEW
  1119. #define OLEUICHANGESOURCE OLEUICHANGESOURCEW
  1120. #define POLEUICHANGESOURCE POLEUICHANGESOURCEW
  1121. #define LPOLEUICHANGESOURCE LPOLEUICHANGESOURCEW
  1122. #define OleUIChangeSource OleUIChangeSourceW
  1123. #else
  1124. #define tagOLEUICHANGESOURCE tagOLEUICHANGESOURCEA
  1125. #define OLEUICHANGESOURCE OLEUICHANGESOURCEA
  1126. #define POLEUICHANGESOURCE POLEUICHANGESOURCEA
  1127. #define LPOLEUICHANGESOURCE LPOLEUICHANGESOURCEA
  1128. #define OleUIChangeSource OleUIChangeSourceA
  1129. #endif
  1130.  
  1131. // Change Source Dialog flags
  1132. #define CSF_SHOWHELP                    0x00000001L // IN: enable/show help button
  1133. #define CSF_VALIDSOURCE                 0x00000002L // OUT: link was validated
  1134. #define CSF_ONLYGETSOURCE               0x00000004L // IN: disables validation of source
  1135. #define CSF_EXPLORER                    0x00000008L // IN: use new OFN_EXPLORER custom template behavior
  1136.  
  1137. // Change Source Dialog errors
  1138. #define OLEUI_CSERR_LINKCNTRNULL        (OLEUI_ERR_STANDARDMAX+0)
  1139. #define OLEUI_CSERR_LINKCNTRINVALID     (OLEUI_ERR_STANDARDMAX+1)
  1140. #define OLEUI_CSERR_FROMNOTNULL         (OLEUI_ERR_STANDARDMAX+2)
  1141. #define OLEUI_CSERR_TONOTNULL           (OLEUI_ERR_STANDARDMAX+3)
  1142. #define OLEUI_CSERR_SOURCENULL          (OLEUI_ERR_STANDARDMAX+4)
  1143. #define OLEUI_CSERR_SOURCEINVALID       (OLEUI_ERR_STANDARDMAX+5)
  1144. #define OLEUI_CSERR_SOURCEPARSERROR     (OLEUI_ERR_STANDARDMAX+6)
  1145. #define OLEUI_CSERR_SOURCEPARSEERROR    (OLEUI_ERR_STANDARDMAX+7)
  1146.  
  1147. /////////////////////////////////////////////////////////////////////////////
  1148. // OBJECT PROPERTIES DIALOG
  1149.  
  1150. #undef  INTERFACE
  1151. #define INTERFACE   IOleUIObjInfoW
  1152.  
  1153. DECLARE_INTERFACE_(IOleUIObjInfoW, IUnknown)
  1154. {
  1155.         // *** IUnknown methods *** //
  1156.         STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  1157.         STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1158.         STDMETHOD_(ULONG,Release) (THIS) PURE;
  1159.  
  1160.         // *** extra for General Properties *** //
  1161.         STDMETHOD(GetObjectInfo) (THIS_ DWORD dwObject,
  1162.                 DWORD FAR* lpdwObjSize, LPWSTR FAR* lplpszLabel,
  1163.                 LPWSTR FAR* lplpszType, LPWSTR FAR* lplpszShortType,
  1164.                 LPWSTR FAR* lplpszLocation) PURE;
  1165.         STDMETHOD(GetConvertInfo) (THIS_ DWORD dwObject,
  1166.                 CLSID FAR* lpClassID, WORD FAR* lpwFormat,
  1167.                 CLSID FAR* lpConvertDefaultClassID,
  1168.                 LPCLSID FAR* lplpClsidExclude, UINT FAR* lpcClsidExclude) PURE;
  1169.         STDMETHOD(ConvertObject) (THIS_ DWORD dwObject, REFCLSID clsidNew) PURE;
  1170.  
  1171.         // *** extra for View Properties *** //
  1172.         STDMETHOD(GetViewInfo) (THIS_ DWORD dwObject,
  1173.                 HGLOBAL FAR* phMetaPict, DWORD* pdvAspect, int* pnCurrentScale) PURE;
  1174.         STDMETHOD(SetViewInfo) (THIS_ DWORD dwObject,
  1175.                 HGLOBAL hMetaPict, DWORD dvAspect,
  1176.                 int nCurrentScale, BOOL bRelativeToOrig) PURE;
  1177. };
  1178.  
  1179. typedef IOleUIObjInfoW FAR* LPOLEUIOBJINFOW;
  1180.  
  1181. #undef  INTERFACE
  1182. #define INTERFACE   IOleUIObjInfoA
  1183.  
  1184. DECLARE_INTERFACE_(IOleUIObjInfoA, IUnknown)
  1185. {
  1186.         // *** IUnknown methods *** //
  1187.         STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  1188.         STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1189.         STDMETHOD_(ULONG,Release) (THIS) PURE;
  1190.  
  1191.         // *** extra for General Properties *** //
  1192.         STDMETHOD(GetObjectInfo) (THIS_ DWORD dwObject,
  1193.                 DWORD FAR* lpdwObjSize, LPSTR FAR* lplpszLabel,
  1194.                 LPSTR FAR* lplpszType, LPSTR FAR* lplpszShortType,
  1195.                 LPSTR FAR* lplpszLocation) PURE;
  1196.         STDMETHOD(GetConvertInfo) (THIS_ DWORD dwObject,
  1197.                 CLSID FAR* lpClassID, WORD FAR* lpwFormat,
  1198.                 CLSID FAR* lpConvertDefaultClassID,
  1199.                 LPCLSID FAR* lplpClsidExclude, UINT FAR* lpcClsidExclude) PURE;
  1200.         STDMETHOD(ConvertObject) (THIS_ DWORD dwObject, REFCLSID clsidNew) PURE;
  1201.  
  1202.         // *** extra for View Properties *** //
  1203.         STDMETHOD(GetViewInfo) (THIS_ DWORD dwObject,
  1204.                 HGLOBAL FAR* phMetaPict, DWORD* pdvAspect, int* pnCurrentScale) PURE;
  1205.         STDMETHOD(SetViewInfo) (THIS_ DWORD dwObject,
  1206.                 HGLOBAL hMetaPict, DWORD dvAspect,
  1207.                 int nCurrentScale, BOOL bRelativeToOrig) PURE;
  1208. };
  1209.  
  1210. typedef IOleUIObjInfoA FAR* LPOLEUIOBJINFOA;
  1211.  
  1212. #ifdef UNICODE
  1213. #define IOleUIObjInfo IOleUIObjInfoW
  1214. #define IOleUIObjInfoVtbl IOleUIObjInfoWVtbl
  1215. #define LPOLEUIOBJINFO LPOLEUIOBJINFOW
  1216. #else
  1217. #define IOleUIObjInfo IOleUIObjInfoA
  1218. #define IOleUIObjInfoVtbl IOleUIObjInfoAVtbl
  1219. #define LPOLEUIOBJINFO LPOLEUIOBJINFOA
  1220. #endif
  1221.  
  1222. #undef  INTERFACE
  1223. #define INTERFACE   IOleUILinkInfoW
  1224.  
  1225. DECLARE_INTERFACE_(IOleUILinkInfoW, IOleUILinkContainerW)
  1226. {
  1227.         // *** IUnknown methods *** //
  1228.         STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  1229.         STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1230.         STDMETHOD_(ULONG,Release) (THIS) PURE;
  1231.  
  1232.         // *** IOleUILinkContainer *** //
  1233.         STDMETHOD_(DWORD,GetNextLink) (THIS_ DWORD dwLink) PURE;
  1234.         STDMETHOD(SetLinkUpdateOptions) (THIS_ DWORD dwLink,
  1235.                 DWORD dwUpdateOpt) PURE;
  1236.         STDMETHOD(GetLinkUpdateOptions) (THIS_ DWORD dwLink,
  1237.                 DWORD FAR* lpdwUpdateOpt) PURE;
  1238.         STDMETHOD(SetLinkSource) (THIS_ DWORD dwLink, LPWSTR lpszDisplayName,
  1239.                 ULONG lenFileName, ULONG FAR* pchEaten, BOOL fValidateSource) PURE;
  1240.         STDMETHOD(GetLinkSource) (THIS_ DWORD dwLink,
  1241.                 LPWSTR FAR* lplpszDisplayName, ULONG FAR* lplenFileName,
  1242.                 LPWSTR FAR* lplpszFullLinkType, LPWSTR FAR* lplpszShortLinkType,
  1243.                 BOOL FAR* lpfSourceAvailable, BOOL FAR* lpfIsSelected) PURE;
  1244.         STDMETHOD(OpenLinkSource) (THIS_ DWORD dwLink) PURE;
  1245.         STDMETHOD(UpdateLink) (THIS_ DWORD dwLink,
  1246.                 BOOL fErrorMessage, BOOL fReserved) PURE;
  1247.         STDMETHOD(CancelLink) (THIS_ DWORD dwLink) PURE;
  1248.  
  1249.         // *** extra for Link Properties *** //
  1250.         STDMETHOD(GetLastUpdate) (THIS_ DWORD dwLink,
  1251.                 FILETIME FAR* lpLastUpdate) PURE;
  1252. };
  1253.  
  1254. typedef IOleUILinkInfoW FAR* LPOLEUILINKINFOW;
  1255.  
  1256. #undef  INTERFACE
  1257. #define INTERFACE   IOleUILinkInfoA
  1258.  
  1259. DECLARE_INTERFACE_(IOleUILinkInfoA, IOleUILinkContainerA)
  1260. {
  1261.         // *** IUnknown methods *** //
  1262.         STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  1263.         STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1264.         STDMETHOD_(ULONG,Release) (THIS) PURE;
  1265.  
  1266.         // *** IOleUILinkContainer *** //
  1267.         STDMETHOD_(DWORD,GetNextLink) (THIS_ DWORD dwLink) PURE;
  1268.         STDMETHOD(SetLinkUpdateOptions) (THIS_ DWORD dwLink,
  1269.                 DWORD dwUpdateOpt) PURE;
  1270.         STDMETHOD(GetLinkUpdateOptions) (THIS_ DWORD dwLink,
  1271.                 DWORD FAR* lpdwUpdateOpt) PURE;
  1272.         STDMETHOD(SetLinkSource) (THIS_ DWORD dwLink, LPSTR lpszDisplayName,
  1273.                 ULONG lenFileName, ULONG FAR* pchEaten, BOOL fValidateSource) PURE;
  1274.         STDMETHOD(GetLinkSource) (THIS_ DWORD dwLink,
  1275.                 LPSTR FAR* lplpszDisplayName, ULONG FAR* lplenFileName,
  1276.                 LPSTR FAR* lplpszFullLinkType, LPSTR FAR* lplpszShortLinkType,
  1277.                 BOOL FAR* lpfSourceAvailable, BOOL FAR* lpfIsSelected) PURE;
  1278.         STDMETHOD(OpenLinkSource) (THIS_ DWORD dwLink) PURE;
  1279.         STDMETHOD(UpdateLink) (THIS_ DWORD dwLink,
  1280.                 BOOL fErrorMessage, BOOL fReserved) PURE;
  1281.         STDMETHOD(CancelLink) (THIS_ DWORD dwLink) PURE;
  1282.  
  1283.         // *** extra for Link Properties *** //
  1284.         STDMETHOD(GetLastUpdate) (THIS_ DWORD dwLink,
  1285.                 FILETIME FAR* lpLastUpdate) PURE;
  1286. };
  1287.  
  1288. typedef IOleUILinkInfoA FAR* LPOLEUILINKINFOA;
  1289.  
  1290. #ifdef UNICODE
  1291. #define IOleUILinkInfo IOleUILinkInfoW
  1292. #define IOleUILinkInfoVtbl IOleUILinkInfoWVtbl
  1293. #define LPOLEUILINKINFO LPOLEUILINKINFOW
  1294. #else
  1295. #define IOleUILinkInfo IOleUILinkInfoA
  1296. #define IOleUILinkInfoVtbl IOleUILinkInfoAVtbl
  1297. #define LPOLEUILINKINFO LPOLEUILINKINFOA
  1298. #endif
  1299.  
  1300. struct tagOLEUIOBJECTPROPSW;
  1301. struct tagOLEUIOBJECTPROPSA;
  1302.  
  1303. typedef struct tagOLEUIGNRLPROPSW
  1304. {
  1305.         // These IN fields are standard across all OLEUI property pages.
  1306.         DWORD           cbStruct;       // Structure Size
  1307.         DWORD           dwFlags;        // IN-OUT: flags specific to general page
  1308.         DWORD           dwReserved1[2];
  1309.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  1310.         LPARAM          lCustData;      // Custom data to pass to hook
  1311.         DWORD           dwReserved2[3];
  1312.  
  1313.         struct tagOLEUIOBJECTPROPSW* lpOP;   // (used internally)
  1314.  
  1315. } OLEUIGNRLPROPSW, *POLEUIGNRLPROPSW, FAR* LPOLEUIGNRLPROPSW;
  1316.  
  1317. typedef struct tagOLEUIGNRLPROPSA
  1318. {
  1319.         // These IN fields are standard across all OLEUI property pages.
  1320.         DWORD           cbStruct;       // Structure Size
  1321.         DWORD           dwFlags;        // IN-OUT: flags specific to general page
  1322.         DWORD           dwReserved1[2];
  1323.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback
  1324.         LPARAM          lCustData;      // Custom data to pass to hook
  1325.         DWORD           dwReserved2[3];
  1326.  
  1327.         struct tagOLEUIOBJECTPROPSA* lpOP;   // (used internally)
  1328.  
  1329. } OLEUIGNRLPROPSA, *POLEUIGNRLPROPSA, FAR* LPOLEUIGNRLPROPSA;
  1330.  
  1331. #ifdef UNICODE
  1332. #define tagOLEUIGNRLPROPS tagOLEUIGNRLPROPSW
  1333. #define OLEUIGNRLPROPS OLEUIGNRLPROPSW
  1334. #define POLEUIGNRLPROPS POLEUIGNRLPROPSW
  1335. #define LPOLEUIGNRLPROPS LPOLEUIGNRLPROPSW
  1336. #else
  1337. #define tagOLEUIGNRLPROPS tagOLEUIGNRLPROPSA
  1338. #define OLEUIGNRLPROPS OLEUIGNRLPROPSA
  1339. #define POLEUIGNRLPROPS POLEUIGNRLPROPSA
  1340. #define LPOLEUIGNRLPROPS LPOLEUIGNRLPROPSA
  1341. #endif
  1342.  
  1343. typedef struct tagOLEUIVIEWPROPSW
  1344. {
  1345.         // These IN fields are standard across all OLEUI property pages.
  1346.         DWORD           cbStruct;       // Structure Size
  1347.         DWORD           dwFlags;        // IN-OUT: flags specific to view page
  1348.         DWORD           dwReserved1[2];
  1349.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback (not used in this dialog)
  1350.         LPARAM          lCustData;      // Custom data to pass to hook
  1351.         DWORD           dwReserved2[3];
  1352.  
  1353.         struct tagOLEUIOBJECTPROPSW* lpOP; // (used internally)
  1354.  
  1355.         int             nScaleMin;      // scale range
  1356.         int             nScaleMax;
  1357.  
  1358. } OLEUIVIEWPROPSW, *POLEUIVIEWPROPSW, FAR* LPOLEUIVIEWPROPSW;
  1359.  
  1360. typedef struct tagOLEUIVIEWPROPSA
  1361. {
  1362.         // These IN fields are standard across all OLEUI property pages.
  1363.         DWORD           cbStruct;       // Structure Size
  1364.         DWORD           dwFlags;        // IN-OUT: flags specific to view page
  1365.         DWORD           dwReserved1[2];
  1366.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback (not used in this dialog)
  1367.         LPARAM          lCustData;      // Custom data to pass to hook
  1368.         DWORD           dwReserved2[3];
  1369.  
  1370.         struct tagOLEUIOBJECTPROPSA* lpOP; // (used internally)
  1371.  
  1372.         int             nScaleMin;      // scale range
  1373.         int             nScaleMax;
  1374.  
  1375. } OLEUIVIEWPROPSA, *POLEUIVIEWPROPSA, FAR* LPOLEUIVIEWPROPSA;
  1376.  
  1377. #ifdef UNICODE
  1378. #define tagOLEUIVIEWPROPS tagOLEUIVIEWPROPSW
  1379. #define OLEUIVIEWPROPS OLEUIVIEWPROPSW
  1380. #define POLEUIVIEWPROPS POLEUIVIEWPROPSW
  1381. #define LPOLEUIVIEWPROPS LPOLEUIVIEWPROPSW
  1382. #else
  1383. #define tagOLEUIVIEWPROPS tagOLEUIVIEWPROPSA
  1384. #define OLEUIVIEWPROPS OLEUIVIEWPROPSA
  1385. #define POLEUIVIEWPROPS POLEUIVIEWPROPSA
  1386. #define LPOLEUIVIEWPROPS LPOLEUIVIEWPROPSA
  1387. #endif
  1388.  
  1389. // Flags for OLEUIVIEWPROPS
  1390. #define VPF_SELECTRELATIVE          0x00000001L // IN: relative to orig
  1391. #define VPF_DISABLERELATIVE         0x00000002L // IN: disable relative to orig
  1392. #define VPF_DISABLESCALE            0x00000004L // IN: disable scale option
  1393.  
  1394. typedef struct tagOLEUILINKPROPSW
  1395. {
  1396.         // These IN fields are standard across all OLEUI property pages.
  1397.         DWORD           cbStruct;       // Structure Size
  1398.         DWORD           dwFlags;        // IN-OUT: flags specific to links page
  1399.         DWORD           dwReserved1[2];
  1400.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback (not used in this dialog)
  1401.         LPARAM          lCustData;      // Custom data to pass to hook
  1402.         DWORD           dwReserved2[3];
  1403.  
  1404.         struct tagOLEUIOBJECTPROPSW* lpOP; // (used internally)
  1405.  
  1406. } OLEUILINKPROPSW, *POLEUILINKPROPSW, FAR* LPOLEUILINKPROPSW;
  1407.  
  1408. typedef struct tagOLEUILINKPROPSA
  1409. {
  1410.         // These IN fields are standard across all OLEUI property pages.
  1411.         DWORD           cbStruct;       // Structure Size
  1412.         DWORD           dwFlags;        // IN-OUT: flags specific to links page
  1413.         DWORD           dwReserved1[2];
  1414.         LPFNOLEUIHOOK   lpfnHook;       // Hook callback (not used in this dialog)
  1415.         LPARAM          lCustData;      // Custom data to pass to hook
  1416.         DWORD           dwReserved2[3];
  1417.  
  1418.         struct tagOLEUIOBJECTPROPSA* lpOP; // (used internally)
  1419.  
  1420. } OLEUILINKPROPSA, *POLEUILINKPROPSA, FAR* LPOLEUILINKPROPSA;
  1421.  
  1422. #ifdef UNICODE
  1423. #define tagOLEUILINKPROPS tagOLEUILINKPROPSW
  1424. #define OLEUILINKPROPS OLEUILINKPROPSW
  1425. #define POLEUILINKPROPS POLEUILINKPROPSW
  1426. #define LPOLEUILINKPROPS LPOLEUILINKPROPSW
  1427. #else
  1428. #define tagOLEUILINKPROPS tagOLEUILINKPROPSA
  1429. #define OLEUILINKPROPS OLEUILINKPROPSA
  1430. #define POLEUILINKPROPS POLEUILINKPROPSA
  1431. #define LPOLEUILINKPROPS LPOLEUILINKPROPSA
  1432. #endif
  1433.  
  1434. #if (WINVER >= 0x400)
  1435. // Under Windows 95 prsht.h is NOT a part of the normal Windows
  1436. // environment, so we explicitly include it here to be safe.
  1437. #include <prsht.h>
  1438.  
  1439. #ifndef PSM_SETFINISHTEXTA
  1440. // We are building under Windows 95.
  1441. //
  1442. // Under Windows 95 there are no wide-character definitions
  1443. // for the property sheet code.
  1444. //
  1445. // Since the UNICODE version of our API is not implemented on Windows 95,
  1446. // this only creates a semantic problem.  The entry points will still
  1447. // look the same and the code will still work the same if we define
  1448. // LPPROPSHEETHEADERW to be the narrow version of the structure.
  1449.  
  1450. typedef struct _PROPSHEETHEADER FAR* LPPROPSHEETHEADERW;
  1451. typedef struct _PROPSHEETHEADER FAR* LPPROPSHEETHEADERA;
  1452.  
  1453. #else
  1454. // We are building under Windows NT.
  1455.  
  1456. // Go ahead and define LPPROPSHEETHEADERW as it should be defined!
  1457.  
  1458. typedef struct _PROPSHEETHEADERW FAR* LPPROPSHEETHEADERW;
  1459. typedef struct _PROPSHEETHEADERA FAR* LPPROPSHEETHEADERA;
  1460.  
  1461. #ifdef UNICODE
  1462. #define LPPROPSHEETHEADER LPPROPSHEETHEADERW
  1463. #else
  1464. #define LPPROPSHEETHEADER LPPROPSHEETHEADERA
  1465. #endif
  1466.  
  1467. #endif // PSM_SETFINISHTEXTA
  1468.  
  1469. #else // WINVER
  1470.  
  1471. // If WINVER < 0x400, then PROPSHEETHEADER stuff isn't defined.
  1472. // The user won't be able to use the prop-sheet code, so we just define the
  1473. // necessary structures to be void pointers to enable to header file to
  1474. // at least compile correctly.
  1475.  
  1476. typedef void FAR* LPPROPSHEETHEADERW;
  1477. typedef void FAR* LPPROPSHEETHEADERA;
  1478.  
  1479. #ifdef UNICODE
  1480. #define LPPROPSHEETHEADER LPPROPSHEETHEADERW
  1481. #else
  1482. #define LPPROPSHEETHEADER LPPROPSHEETHEADERA
  1483. #endif
  1484.  
  1485. #endif // WINVER
  1486.  
  1487. typedef struct tagOLEUIOBJECTPROPSW
  1488. {
  1489.         // These IN fields are standard across all OLEUI property sheets.
  1490.         DWORD           cbStruct;       // Structure Size
  1491.         DWORD           dwFlags;        // IN-OUT: global flags for the sheet
  1492.  
  1493.         // Standard PROPSHEETHEADER used for extensibility
  1494.         LPPROPSHEETHEADERW   lpPS;         // IN: property sheet header
  1495.  
  1496.         // Data which allows manipulation of the object
  1497.         DWORD           dwObject;       // IN: identifier for the object
  1498.         LPOLEUIOBJINFOW lpObjInfo;      // IN: interface to manipulate object
  1499.  
  1500.         // Data which allows manipulation of the link
  1501.         DWORD           dwLink;         // IN: identifier for the link
  1502.         LPOLEUILINKINFOW lpLinkInfo;     // IN: interface to manipulate link
  1503.  
  1504.         // Data specfic to each page
  1505.         LPOLEUIGNRLPROPSW lpGP;          // IN: general page
  1506.         LPOLEUIVIEWPROPSW lpVP;          // IN: view page
  1507.         LPOLEUILINKPROPSW lpLP;          // IN: link page
  1508.  
  1509. } OLEUIOBJECTPROPSW, *POLEUIOBJECTPROPSW, FAR* LPOLEUIOBJECTPROPSW;
  1510.  
  1511. typedef struct tagOLEUIOBJECTPROPSA
  1512. {
  1513.         // These IN fields are standard across all OLEUI property sheets.
  1514.         DWORD           cbStruct;       // Structure Size
  1515.         DWORD           dwFlags;        // IN-OUT: global flags for the sheet
  1516.  
  1517.         // Standard PROPSHEETHEADER used for extensibility
  1518.         LPPROPSHEETHEADERA  lpPS;         // IN: property sheet header
  1519.  
  1520.         // Data which allows manipulation of the object
  1521.         DWORD           dwObject;       // IN: identifier for the object
  1522.         LPOLEUIOBJINFOA lpObjInfo;      // IN: interface to manipulate object
  1523.  
  1524.         // Data which allows manipulation of the link
  1525.         DWORD           dwLink;         // IN: identifier for the link
  1526.         LPOLEUILINKINFOA lpLinkInfo;     // IN: interface to manipulate link
  1527.  
  1528.         // Data specfic to each page
  1529.         LPOLEUIGNRLPROPSA lpGP;          // IN: general page
  1530.         LPOLEUIVIEWPROPSA lpVP;          // IN: view page
  1531.         LPOLEUILINKPROPSA lpLP;          // IN: link page
  1532.  
  1533. } OLEUIOBJECTPROPSA, *POLEUIOBJECTPROPSA, FAR* LPOLEUIOBJECTPROPSA;
  1534.  
  1535. STDAPI_(UINT) OleUIObjectPropertiesW(LPOLEUIOBJECTPROPSW);
  1536. STDAPI_(UINT) OleUIObjectPropertiesA(LPOLEUIOBJECTPROPSA);
  1537.  
  1538. #ifdef UNICODE
  1539. #define tagOLEUIOBJECTPROPS tagOLEUIOBJECTPROPSW
  1540. #define OLEUIOBJECTPROPS OLEUIOBJECTPROPSW
  1541. #define POLEUIOBJECTPROPS POLEUIOBJECTPROPSW
  1542. #define LPOLEUIOBJECTPROPS LPOLEUIOBJECTPROPSW
  1543. #define OleUIObjectProperties OleUIObjectPropertiesW
  1544. #else
  1545. #define tagOLEUIOBJECTPROPS tagOLEUIOBJECTPROPSA
  1546. #define OLEUIOBJECTPROPS OLEUIOBJECTPROPSA
  1547. #define POLEUIOBJECTPROPS POLEUIOBJECTPROPSA
  1548. #define LPOLEUIOBJECTPROPS LPOLEUIOBJECTPROPSA
  1549. #define OleUIObjectProperties OleUIObjectPropertiesA
  1550. #endif
  1551.  
  1552. // Flags for OLEUIOBJECTPROPS
  1553. #define OPF_OBJECTISLINK                0x00000001L
  1554. #define OPF_NOFILLDEFAULT               0x00000002L
  1555. #define OPF_SHOWHELP                    0x00000004L
  1556. #define OPF_DISABLECONVERT              0x00000008L
  1557.  
  1558. // Errors for OleUIObjectProperties
  1559. #define OLEUI_OPERR_SUBPROPNULL         (OLEUI_ERR_STANDARDMAX+0)
  1560. #define OLEUI_OPERR_SUBPROPINVALID      (OLEUI_ERR_STANDARDMAX+1)
  1561. #define OLEUI_OPERR_PROPSHEETNULL       (OLEUI_ERR_STANDARDMAX+2)
  1562. #define OLEUI_OPERR_PROPSHEETINVALID    (OLEUI_ERR_STANDARDMAX+3)
  1563. #define OLEUI_OPERR_SUPPROP             (OLEUI_ERR_STANDARDMAX+4)
  1564. #define OLEUI_OPERR_PROPSINVALID        (OLEUI_ERR_STANDARDMAX+5)
  1565. #define OLEUI_OPERR_PAGESINCORRECT      (OLEUI_ERR_STANDARDMAX+6)
  1566. #define OLEUI_OPERR_INVALIDPAGES        (OLEUI_ERR_STANDARDMAX+7)
  1567. #define OLEUI_OPERR_NOTSUPPORTED        (OLEUI_ERR_STANDARDMAX+8)
  1568. #define OLEUI_OPERR_DLGPROCNOTNULL      (OLEUI_ERR_STANDARDMAX+9)
  1569. #define OLEUI_OPERR_LPARAMNOTZERO       (OLEUI_ERR_STANDARDMAX+10)
  1570.  
  1571. #define OLEUI_GPERR_STRINGINVALID       (OLEUI_ERR_STANDARDMAX+11)
  1572. #define OLEUI_GPERR_CLASSIDINVALID      (OLEUI_ERR_STANDARDMAX+12)
  1573. #define OLEUI_GPERR_LPCLSIDEXCLUDEINVALID   (OLEUI_ERR_STANDARDMAX+13)
  1574. #define OLEUI_GPERR_CBFORMATINVALID     (OLEUI_ERR_STANDARDMAX+14)
  1575. #define OLEUI_VPERR_METAPICTINVALID     (OLEUI_ERR_STANDARDMAX+15)
  1576. #define OLEUI_VPERR_DVASPECTINVALID     (OLEUI_ERR_STANDARDMAX+16)
  1577. #define OLEUI_LPERR_LINKCNTRNULL        (OLEUI_ERR_STANDARDMAX+17)
  1578. #define OLEUI_LPERR_LINKCNTRINVALID     (OLEUI_ERR_STANDARDMAX+18)
  1579.  
  1580. #define OLEUI_OPERR_PROPERTYSHEET       (OLEUI_ERR_STANDARDMAX+19)
  1581. #define OLEUI_OPERR_OBJINFOINVALID      (OLEUI_ERR_STANDARDMAX+20)
  1582. #define OLEUI_OPERR_LINKINFOINVALID     (OLEUI_ERR_STANDARDMAX+21)
  1583.  
  1584. // wParam used by PSM_QUERYSIBLINGS
  1585. #define OLEUI_QUERY_GETCLASSID          0xFF00  // override class id for icon
  1586. #define OLEUI_QUERY_LINKBROKEN          0xFF01  // after link broken
  1587.  
  1588. /////////////////////////////////////////////////////////////////////////////
  1589. // PROMPT USER DIALOGS
  1590.  
  1591. int EXPORT FAR CDECL OleUIPromptUserW(int nTemplate, HWND hwndParent, ...);
  1592. int EXPORT FAR CDECL OleUIPromptUserA(int nTemplate, HWND hwndParent, ...);
  1593.  
  1594. #ifdef UNICODE
  1595. #define OleUIPromptUser OleUIPromptUserW
  1596. #else
  1597. #define OleUIPromptUser OleUIPromptUserA
  1598. #endif
  1599.  
  1600. STDAPI_(BOOL) OleUIUpdateLinksW(LPOLEUILINKCONTAINERW lpOleUILinkCntr,
  1601.         HWND hwndParent, LPWSTR lpszTitle, int cLinks);
  1602. STDAPI_(BOOL) OleUIUpdateLinksA(LPOLEUILINKCONTAINERA lpOleUILinkCntr,
  1603.         HWND hwndParent, LPSTR lpszTitle, int cLinks);
  1604.  
  1605. #ifdef UNICODE
  1606. #define OleUIUpdateLinks OleUIUpdateLinksW
  1607. #else
  1608. #define OleUIUpdateLinks OleUIUpdateLinksA
  1609. #endif
  1610.  
  1611. /////////////////////////////////////////////////////////////////////////////
  1612.  
  1613. #pragma pack(pop)
  1614.  
  1615. #ifdef __cplusplus
  1616. }
  1617. #endif
  1618.  
  1619. #endif // RC_INVOKED
  1620.  
  1621. #endif  //_OLEDLG_H_
  1622.  
  1623. /////////////////////////////////////////////////////////////////////////////
  1624.