Annotation of mstools/ole20/h/ole2ui.h, revision 1.1.1.1

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.