home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / oledlg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  72.9 KB  |  1,632 lines

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