home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / oledlg.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  74KB  |  1,626 lines

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