' ########################################################################################
' Microsoft Windows
' File: OleDlg.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_OleDlg_PBI)
#DEFINE PBX_OleDlg_PBI
%EQUATE `OLEDLG_INC = 1
'Copyright (c) Microsoft Corporation. All rights reserved.
'Module Name:
' oledlg.h
'Abstract:
' Include file for the OLE common dialogs.
' The following dialog implementations are provided:
' - Insert Object Dialog
' - Convert Object Dialog
' - Paste Special Dialog
' - Change Icon Dialog
' - Edit Links Dialog
' - Update Links Dialog
' - Change Source Dialog
' - Busy Dialog
' - User Error Message Dialog
' - Object Properties Dialog
'--*/
#INCLUDE ONCE "Legacy/COM/Ole2.inc"
'#ifndef _INC_SHELLAPI
'#include <shellapi.h>
'#endif
#INCLUDE ONCE "Legacy/COM/CommDlg.inc"
'#include <string.h>
'#include <tchar.h>
#INCLUDE ONCE "Legacy/UI/Dlgs.inc" ' // common dialog IDs
'//Maximum path size (not defined in any header)
%EQUATE `OLEUI_CCHPATHMAX = 256
'// Help Button Identifier
%EQUATE `IDC_OLEUIHELP = 99
'// Insert Object Dialog identifiers
%EQUATE `IDC_IO_CREATENEW = 2100
%EQUATE `IDC_IO_CREATEFROMFILE = 2101
%EQUATE `IDC_IO_LINKFILE = 2102
%EQUATE `IDC_IO_OBJECTTYPELIST = 2103
%EQUATE `IDC_IO_DISPLAYASICON = 2104
%EQUATE `IDC_IO_CHANGEICON = 2105
%EQUATE `IDC_IO_FILE = 2106
%EQUATE `IDC_IO_FILEDISPLAY = 2107
%EQUATE `IDC_IO_RESULTIMAGE = 2108
%EQUATE `IDC_IO_RESULTTEXT = 2109
%EQUATE `IDC_IO_ICONDISPLAY = 2110
%EQUATE `IDC_IO_OBJECTTYPETEXT = 2111 ' //{{NOHELP}}
%EQUATE `IDC_IO_FILETEXT = 2112 ' //{{NOHELP}}
%EQUATE `IDC_IO_FILETYPE = 2113
%EQUATE `IDC_IO_INSERTCONTROL = 2114
%EQUATE `IDC_IO_ADDCONTROL = 2115
%EQUATE `IDC_IO_CONTROLTYPELIST = 2116
'// Paste Special Dialog identifiers
%EQUATE `IDC_PS_PASTE = 500
%EQUATE `IDC_PS_PASTELINK = 501
%EQUATE `IDC_PS_SOURCETEXT = 502
%EQUATE `IDC_PS_PASTELIST = 503 ' //{{NOHELP}}
%EQUATE `IDC_PS_PASTELINKLIST = 504 ' //{{NOHELP}}
%EQUATE `IDC_PS_DISPLAYLIST = 505
%EQUATE `IDC_PS_DISPLAYASICON = 506
%EQUATE `IDC_PS_ICONDISPLAY = 507
%EQUATE `IDC_PS_CHANGEICON = 508
%EQUATE `IDC_PS_RESULTIMAGE = 509
%EQUATE `IDC_PS_RESULTTEXT = 510
'// Change Icon Dialog identifiers
%EQUATE `IDC_CI_GROUP = 120 ' //{{NOHELP}}
%EQUATE `IDC_CI_CURRENT = 121
%EQUATE `IDC_CI_CURRENTICON = 122
%EQUATE `IDC_CI_DEFAULT = 123
%EQUATE `IDC_CI_DEFAULTICON = 124
%EQUATE `IDC_CI_FROMFILE = 125
%EQUATE `IDC_CI_FROMFILEEDIT = 126
%EQUATE `IDC_CI_ICONLIST = 127
%EQUATE `IDC_CI_LABEL = 128 ' //{{NOHELP}
%EQUATE `IDC_CI_LABELEDIT = 129
%EQUATE `IDC_CI_BROWSE = 130
%EQUATE `IDC_CI_ICONDISPLAY = 131
'// Convert Dialog identifiers
%EQUATE `IDC_CV_OBJECTTYPE = 150
%EQUATE `IDC_CV_DISPLAYASICON = 152
%EQUATE `IDC_CV_CHANGEICON = 153
%EQUATE `IDC_CV_ACTIVATELIST = 154
%EQUATE `IDC_CV_CONVERTTO = 155
%EQUATE `IDC_CV_ACTIVATEAS = 156
%EQUATE `IDC_CV_RESULTTEXT = 157
%EQUATE `IDC_CV_CONVERTLIST = 158
%EQUATE `IDC_CV_ICONDISPLAY = 165
'// Edit Links Dialog identifiers
%EQUATE `IDC_EL_CHANGESOURCE = 201
%EQUATE `IDC_EL_AUTOMATIC = 202
%EQUATE `IDC_EL_CANCELLINK = 209
%EQUATE `IDC_EL_UPDATENOW = 210
%EQUATE `IDC_EL_OPENSOURCE = 211
%EQUATE `IDC_EL_MANUAL = 212
%EQUATE `IDC_EL_LINKSOURCE = 216
%EQUATE `IDC_EL_LINKTYPE = 217
%EQUATE `IDC_EL_LINKSLISTBOX = 206
%EQUATE `IDC_EL_COL1 = 220 ' //{{NOHELP}}
%EQUATE `IDC_EL_COL2 = 221 ' //{{NOHELP}}
%EQUATE `IDC_EL_COL3 = 222 ' //{{NOHELP}}
'// Busy dialog identifiers
%EQUATE `IDC_BZ_RETRY = 600
%EQUATE `IDC_BZ_ICON = 601
%EQUATE `IDC_BZ_MESSAGE1 = 602 ' //{{NOHELP}}
%EQUATE `IDC_BZ_SWITCHTO = 604
'// Update Links dialog identifiers
%EQUATE `IDC_UL_METER = 1029 ' //{{NOHELP}}
%EQUATE `IDC_UL_STOP = 1030 ' //{{NOHELP}}
%EQUATE `IDC_UL_PERCENT = 1031 ' //{{NOHELP}}
%EQUATE `IDC_UL_PROGRESS = 1032 ' //{{NOHELP}}
'// User Prompt dialog identifiers
%EQUATE `IDC_PU_LINKS = 900 ' //{{NOHELP}}
%EQUATE `IDC_PU_TEXT = 901 ' //{{NOHELP}}
%EQUATE `IDC_PU_CONVERT = 902 ' //{{NOHELP}}
%EQUATE `IDC_PU_ICON = 908 ' //{{NOHELP}}
'// General Properties identifiers
%EQUATE `IDC_GP_OBJECTNAME = 1009
%EQUATE `IDC_GP_OBJECTTYPE = 1010
%EQUATE `IDC_GP_OBJECTSIZE = 1011
%EQUATE `IDC_GP_CONVERT = 1013
%EQUATE `IDC_GP_OBJECTICON = 1014 ' //{{NOHELP}}
%EQUATE `IDC_GP_OBJECTLOCATION = 1022
'// View Properties identifiers
%EQUATE `IDC_VP_PERCENT = 1000
%EQUATE `IDC_VP_CHANGEICON = 1001
%EQUATE `IDC_VP_EDITABLE = 1002
%EQUATE `IDC_VP_ASICON = 1003
%EQUATE `IDC_VP_RELATIVE = 1005
%EQUATE `IDC_VP_SPIN = 1006
%EQUATE `IDC_VP_SCALETXT = 1034
%EQUATE `IDC_VP_ICONDISPLAY = 1021
%EQUATE `IDC_VP_RESULTIMAGE = 1033
'// Link Properties identifiers
%EQUATE `IDC_LP_OPENSOURCE = 1006
%EQUATE `IDC_LP_UPDATENOW = 1007
%EQUATE `IDC_LP_BREAKLINK = 1008
%EQUATE `IDC_LP_LINKSOURCE = 1012
%EQUATE `IDC_LP_CHANGESOURCE = 1015
%EQUATE `IDC_LP_AUTOMATIC = 1016
%EQUATE `IDC_LP_MANUAL = 1017
%EQUATE `IDC_LP_DATE = 1018
%EQUATE `IDC_LP_TIME = 1019
'// Dialog Identifiers as passed in Help messages to identify the source.
%EQUATE `IDD_INSERTOBJECT = 1000
%EQUATE `IDD_CHANGEICON = 1001
%EQUATE `IDD_CONVERT = 1002
%EQUATE `IDD_PASTESPECIAL = 1003
%EQUATE `IDD_EDITLINKS = 1004
%EQUATE `IDD_BUSY = 1006
%EQUATE `IDD_UPDATELINKS = 1007
%EQUATE `IDD_CHANGESOURCE = 1009
%EQUATE `IDD_INSERTFILEBROWSE = 1010
%EQUATE `IDD_CHANGEICONBROWSE = 1011
%EQUATE `IDD_CONVERTONLY = 1012
%EQUATE `IDD_CHANGESOURCE4 = 1013
%EQUATE `IDD_GNRLPROPS = 1100
%EQUATE `IDD_VIEWPROPS = 1101
%EQUATE `IDD_LINKPROPS = 1102
%EQUATE `IDD_CONVERT4 = 1103
%EQUATE `IDD_CONVERTONLY4 = 1104
%EQUATE `IDD_EDITLINKS4 = 1105
%EQUATE `IDD_GNRLPROPS4 = 1106
%EQUATE `IDD_LINKPROPS4 = 1107
%EQUATE `IDD_PASTESPECIAL4 = 1108
'// The following Dialogs are message dialogs used by OleUIPromptUser API
%EQUATE `IDD_CANNOTUPDATELINK = 1008
%EQUATE `IDD_LINKSOURCEUNAVAILABLE = 1020
%EQUATE `IDD_SERVERNOTFOUND = 1023
%EQUATE `IDD_OUTOFMEMORY = 1024
%EQUATE `IDD_SERVERNOTREGW = 1021
%EQUATE `IDD_LINKTYPECHANGEDW = 1022
%EQUATE `IDD_SERVERNOTREGA = 1025
%EQUATE `IDD_LINKTYPECHANGEDA = 1026
'#pragma pack(push, 8)
'// Delimeter used to separate ItemMoniker pieces of a composite moniker
'#ifdef _MAC
' #define OLESTDDELIM ":"
'#else
' #define OLESTDDELIM TEXT("\\")
'#endif
$OLESTDDELIM = "\"
'// Hook type used in all structures.
'typedef UINT (CALLBACK *LPFNOLEUIHOOK)(HWND, UINT, WPARAM, LPARAM);
'// Strings for registered messages
'#define SZOLEUI_MSG_HELP TEXT("OLEUI_MSG_HELP")
'#define SZOLEUI_MSG_ENDDIALOG TEXT("OLEUI_MSG_ENDDIALOG")
'#define SZOLEUI_MSG_BROWSE TEXT("OLEUI_MSG_BROWSE")
'#define SZOLEUI_MSG_CHANGEICON TEXT("OLEUI_MSG_CHANGEICON")
'#define SZOLEUI_MSG_CLOSEBUSYDIALOG TEXT("OLEUI_MSG_CLOSEBUSYDIALOG")
'#define SZOLEUI_MSG_CONVERT TEXT("OLEUI_MSG_CONVERT")
'#define SZOLEUI_MSG_CHANGESOURCE TEXT("OLEUI_MSG_CHANGESOURCE")
'#define SZOLEUI_MSG_ADDCONTROL TEXT("OLEUI_MSG_ADDCONTROL")
'#define SZOLEUI_MSG_BROWSE_OFN TEXT("OLEUI_MSG_BROWSE_OFN")
$SZOLEUI_MSG_HELP = "OLEUI_MSG_HELP"
$SZOLEUI_MSG_ENDDIALOG = "OLEUI_MSG_ENDDIALOG"
$SZOLEUI_MSG_BROWSE = "OLEUI_MSG_BROWSE"
$SZOLEUI_MSG_CHANGEICON = "OLEUI_MSG_CHANGEICON"
$SZOLEUI_MSG_CLOSEBUSYDIALOG = "OLEUI_MSG_CLOSEBUSYDIALOG"
$SZOLEUI_MSG_CONVERT = "OLEUI_MSG_CONVERT"
$SZOLEUI_MSG_CHANGESOURCE = "OLEUI_MSG_CHANGESOURCE"
$SZOLEUI_MSG_ADDCONTROL = "OLEUI_MSG_ADDCONTROL"
$SZOLEUI_MSG_BROWSE_OFN = "OLEUI_MSG_BROWSE_OFN"
'// Identifiers for SZOLEUI_MSG_BROWSE_OFN (in wParam)
%EQUATE `ID_BROWSE_CHANGEICON = 1
%EQUATE `ID_BROWSE_INSERTFILE = 2
%EQUATE `ID_BROWSE_ADDCONTROL = 3
%EQUATE `ID_BROWSE_CHANGESOURCE = 4
'// Standard success/error definitions
%EQUATE `OLEUI_FALSE = 0
%EQUATE `OLEUI_SUCCESS = 1 ' // No error, same as OLEUI_OK
%EQUATE `OLEUI_OK = 1 ' // OK button pressed
%EQUATE `OLEUI_CANCEL = 2 ' // Cancel button pressed
%EQUATE `OLEUI_ERR_STANDARDMIN = 100
%EQUATE `OLEUI_ERR_OLEMEMALLOC = 100
%EQUATE `OLEUI_ERR_STRUCTURENULL = 101 ' // Standard field validation
%EQUATE `OLEUI_ERR_STRUCTUREINVALID = 102
%EQUATE `OLEUI_ERR_CBSTRUCTINCORRECT = 103
%EQUATE `OLEUI_ERR_HWNDOWNERINVALID = 104
%EQUATE `OLEUI_ERR_LPSZCAPTIONINVALID = 105
%EQUATE `OLEUI_ERR_LPFNHOOKINVALID = 106
%EQUATE `OLEUI_ERR_HINSTANCEINVALID = 107
%EQUATE `OLEUI_ERR_LPSZTEMPLATEINVALID = 108
%EQUATE `OLEUI_ERR_HRESOURCEINVALID = 109
%EQUATE `OLEUI_ERR_FINDTEMPLATEFAILURE = 110 ' // Initialization errors
%EQUATE `OLEUI_ERR_LOADTEMPLATEFAILURE = 111
%EQUATE `OLEUI_ERR_DIALOGFAILURE = 112
%EQUATE `OLEUI_ERR_LOCALMEMALLOC = 113
%EQUATE `OLEUI_ERR_GLOBALMEMALLOC = 114
%EQUATE `OLEUI_ERR_LOADSTRING = 115
%EQUATE `OLEUI_ERR_STANDARDMAX = 116 ' // Start here for specific errors.
'// Miscellaneous utility functions.
DECLARE FUNCTION OleUIAddVerbMenuW LIB "oledlg.dll" ALIAS "OleUIAddVerbMenuW" ( BYVAL lpOleObj AS IOleObject , BYREF lpszShortType AS WSTRINGZ , BYVAL hMenu AS QUAD , BYVAL uPos AS QUAD , BYVAL uIDVerbMin AS QUAD , BYVAL uIDVerbMax AS QUAD , BYVAL bAddConvert AS LONG , BYVAL idConvert AS QUAD , BYREF lphMenu AS QUAD ) AS LONG
DECLARE FUNCTION OleUIAddVerbMenuA LIB "oledlg.dll" ALIAS "OleUIAddVerbMenu" ( BYVAL lpOleObj AS IOleObject
 , BYREF lpszShortType AS ASCIIZ
 , BYVAL hMenu AS DWORD
 , BYVAL uPos AS DWORD
 , BYVAL uIDVerbMin AS DWORD
 , BYVAL uIDVerbMax AS DWORD
 , BYVAL bAddConvert AS LONG
 , BYVAL idConvert AS DWORD
 , BYREF lphMenu AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO OleUIAddVerbMenu = OleUIAddVerbMenuW
#ELSE
 MACRO OleUIAddVerbMenu = OleUIAddVerbMenuA
#ENDIF
'/////////////////////////////////////////////////////////////////////////////
'// INSERT OBJECT DIALOG
' // Size = 112 bytes
TYPE tagOLEUIINSERTOBJECTW
 ' // These IN fields are standard across all OLEUI dialog box functions.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: Flags
 hWndOwner AS DWORD ' HWND hWndOwner; // Owning window
 lpszCaption AS WSTRINGZ PTR ' LPCWSTR lpszCaption; // Dialog caption bar contents
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook; // Hook callback
 lCustData AS LONG ' LPARAM lCustData; // Custom data to pass to hook
 hInstance AS DWORD ' HINSTANCE hInstance; // Instance for customized template name
 lpszTemplate AS WSTRINGZ PTR ' LPCWSTR lpszTemplate; // Customized template name
 hResource AS DWORD ' HRSRC hResource; // Customized template handle
 ' // Specifics for tagOLEUIINSERTOBJECTW.
 clsid AS GUID ' CLSID clsid; // OUT: Return space for class ID
 lpszFile AS WSTRINGZ PTR ' LPWSTR lpszFile; // IN-OUT: Filename for inserts or links
 chFile AS DWORD ' UINT cchFile; // IN: Size of lpszFile buffer: MAX_PATH
 cClsidExclude AS DWORD ' UINT cClsidExclude; // IN: CLSIDs in lpClsidExclude
 lpClsidExclude AS GUID PTR ' LPCLSID lpClsidExclude; // IN: List of CLSIDs to exclude from listing.
 ' // Specific to create objects if flags say so
 iid AS GUID ' IID iid; // IN: Requested interface on creation.
 oleRender AS DWORD ' DWORD oleRender; // IN: Rendering option
 lpFormatEtc AS FORMATETC PTR ' LPFORMATETC lpFormatEtc; // IN: Desired format
 lpIOleClientSite AS DWORD PTR ' LPOLECLIENTSITE lpIOleClientSite; // IN: Site to be use for the object.
 lpIStorage AS DWORD PTR ' LPSTORAGE lpIStorage; // IN: Storage used for the object
 ppvObj AS DWORD PTR ' LPVOID *ppvObj; // OUT: Where the object is returned.
 sc AS LONG ' SCODE sc; // OUT: Result of creation calls.
 hMetaPict AS DWORD ' HGLOBAL hMetaPict; // OUT: metafile aspect (METAFILEPICT)
END TYPE
' // Size = 112 bytes
TYPE tagOLEUIINSERTOBJECTA
 ' // These IN fields are standard across all OLEUI dialog box functions.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: Flags
 hWndOwner AS DWORD ' HWND hWndOwner; // Owning window
 lpszCaption AS ASCIIZ PTR ' LPCSTR lpszCaption; // Dialog caption bar contents
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook; // Hook callback
 lCustData AS LONG ' LPARAM lCustData; // Custom data to pass to hook
 hInstance AS DWORD ' HINSTANCE hInstance; // Instance for customized template name
 lpszTemplate AS ASCIIZ PTR ' LPCSTR lpszTemplate; // Customized template name
 hResource AS DWORD ' HRSRC hResource; // Customized template handle
 ' // Specifics for tagOLEUIINSERTOBJECTW.
 clsid AS GUID ' CLSID clsid; // OUT: Return space for class ID
 lpszFile AS ASCIIZ PTR ' LPSTR lpszFile; // IN-OUT: Filename for inserts or links
 chFile AS DWORD ' UINT cchFile; // IN: Size of lpszFile buffer: MAX_PATH
 cClsidExclude AS DWORD ' UINT cClsidExclude; // IN: CLSIDs in lpClsidExclude
 lpClsidExclude AS GUID PTR ' LPCLSID lpClsidExclude; // IN: List of CLSIDs to exclude from listing.
 ' // Specific to create objects if flags say so
 iid AS GUID ' IID iid; // IN: Requested interface on creation.
 oleRender AS DWORD ' DWORD oleRender; // IN: Rendering option
 lpFormatEtc AS FORMATETC PTR ' LPFORMATETC lpFormatEtc; // IN: Desired format
 lpIOleClientSite AS DWORD PTR ' LPOLECLIENTSITE lpIOleClientSite; // IN: Site to be use for the object.
 lpIStorage AS DWORD PTR ' LPSTORAGE lpIStorage; // IN: Storage used for the object
 ppvObj AS DWORD PTR ' LPVOID *ppvObj; // OUT: Where the object is returned.
 sc AS LONG ' SCODE sc; // OUT: Result of creation calls.
 hMetaPict AS DWORD ' HGLOBAL hMetaPict; // OUT: metafile aspect (METAFILEPICT)
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagOLEUIINSERTOBJECT = tagOLEUIINSERTOBJECTW
#ELSE
 MACRO tagOLEUIINSERTOBJECT = tagOLEUIINSERTOBJECTA
#ENDIF
DECLARE FUNCTION OleUIInsertObjectA LIB "oledlg.dll" ALIAS "OleUIInsertObjectA" ( BYREF lpIO AS tagOLEUIINSERTOBJECTA ) AS QUAD ' UINT
DECLARE FUNCTION OleUIInsertObjectW LIB "oledlg.dll" ALIAS "OleUIInsertObjectW" ( BYREF lpIO AS tagOLEUIINSERTOBJECTW ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO OleUIInsertObject = OleUIInsertObjectW
#ELSE
 MACRO OleUIInsertObject = OleUIInsertObjectA
#ENDIF
'// Insert Object flags
%EQUATE `IOF_SHOWHELP = &H00000001
%EQUATE `IOF_SELECTCREATENEW = &H00000002
%EQUATE `IOF_SELECTCREATEFROMFILE = &H00000004
%EQUATE `IOF_CHECKLINK = &H00000008
%EQUATE `IOF_CHECKDISPLAYASICON = &H00000010
%EQUATE `IOF_CREATENEWOBJECT = &H00000020
%EQUATE `IOF_CREATEFILEOBJECT = &H00000040
%EQUATE `IOF_CREATELINKOBJECT = &H00000080
%EQUATE `IOF_DISABLELINK = &H00000100
%EQUATE `IOF_VERIFYSERVERSEXIST = &H00000200
%EQUATE `IOF_DISABLEDISPLAYASICON = &H00000400
%EQUATE `IOF_HIDECHANGEICON = &H00000800
%EQUATE `IOF_SHOWINSERTCONTROL = &H00001000
%EQUATE `IOF_SELECTCREATECONTROL = &H00002000
'// Insert Object specific error codes
%EQUATE `OLEUI_IOERR_LPSZFILEINVALID = %OLEUI_ERR_STANDARDMAX + 0
%EQUATE `OLEUI_IOERR_LPSZLABELINVALID = %OLEUI_ERR_STANDARDMAX + 1
%EQUATE `OLEUI_IOERR_HICONINVALID = %OLEUI_ERR_STANDARDMAX + 2
%EQUATE `OLEUI_IOERR_LPFORMATETCINVALID = %OLEUI_ERR_STANDARDMAX + 3
%EQUATE `OLEUI_IOERR_PPVOBJINVALID = %OLEUI_ERR_STANDARDMAX + 4
%EQUATE `OLEUI_IOERR_LPIOLECLIENTSITEINVALID = %OLEUI_ERR_STANDARDMAX + 5
%EQUATE `OLEUI_IOERR_LPISTORAGEINVALID = %OLEUI_ERR_STANDARDMAX + 6
%EQUATE `OLEUI_IOERR_SCODEHASERROR = %OLEUI_ERR_STANDARDMAX + 7
%EQUATE `OLEUI_IOERR_LPCLSIDEXCLUDEINVALID = %OLEUI_ERR_STANDARDMAX + 8
%EQUATE `OLEUI_IOERR_CCHFILEINVALID = %OLEUI_ERR_STANDARDMAX + 9
'/////////////////////////////////////////////////////////////////////////////
'// PASTE SPECIAL DIALOG
'// The OLEUIPASTEFLAG enumeration is used by the OLEUIPASTEENTRY structure.
'//
'// OLEUIPASTE_ENABLEICON: If the container does not specify this flag for
'// the entry in the OLEUIPASTEENTRY array passed as input to
'// OleUIPasteSpecial, the DisplayAsIcon button will be unchecked and
'// disabled when the the user selects the format that corresponds to
'// the entry.
'//
'// OLEUIPASTE_PASTEONLY: Indicates that the entry in the OLEUIPASTEENTRY
'// array is valid for pasting only.
'//
'// OLEUIPASTE_PASTE: Indicates that the entry in the OLEUIPASTEENTRY array
'// is valid for pasting. It may also be valid for linking if any of
'// the following linking flags are specified.
'//
'// If the entry in the OLEUIPASTEENTRY array is valid for linking, the
'// following flags indicate which link types are acceptable by OR'ing
'// together the appropriate OLEUIPASTE_LINKTYPE<#> values.
'//
'// These values correspond as follows to the array of link types passed to
'// OleUIPasteSpecial:
'//
'// OLEUIPASTE_LINKTYPE1 = arrLinkTypes[0]
'// OLEUIPASTE_LINKTYPE2 = arrLinkTypes[1]
'// OLEUIPASTE_LINKTYPE3 = arrLinkTypes[2]
'// OLEUIPASTE_LINKTYPE4 = arrLinkTypes[3]
'// OLEUIPASTE_LINKTYPE5 = arrLinkTypes[4]
'// OLEUIPASTE_LINKTYPE6 = arrLinkTypes[5]
'// OLEUIPASTE_LINKTYPE7 = arrLinkTypes[6]
'// OLEUIPASTE_LINKTYPE8 = arrLinkTypes[7]
'//
'// where,
'// UINT arrLinkTypes[8] is an array of registered clipboard formats for
'// linking. A maximium of 8 link types are allowed.
' OLEUIPASTEFLAG enum
%EQUATE `OLEUIPASTE_ENABLEICON = 2048 ' // enable display as icon
%EQUATE `OLEUIPASTE_PASTEONLY = 0
%EQUATE `OLEUIPASTE_PASTE = 512
%EQUATE `OLEUIPASTE_LINKANYTYPE = 1024
%EQUATE `OLEUIPASTE_LINKTYPE1 = 1
%EQUATE `OLEUIPASTE_LINKTYPE2 = 2
%EQUATE `OLEUIPASTE_LINKTYPE3 = 4
%EQUATE `OLEUIPASTE_LINKTYPE4 = 8
%EQUATE `OLEUIPASTE_LINKTYPE5 = 16
%EQUATE `OLEUIPASTE_LINKTYPE6 = 32
%EQUATE `OLEUIPASTE_LINKTYPE7 = 64
%EQUATE `OLEUIPASTE_LINKTYPE8 = 128
'// OLEUIPASTEENTRY structure
'//
'// An array of OLEUIPASTEENTRY entries is specified for the PasteSpecial
'// dialog box. Each entry includes a FORMATETC which specifies the
'// formats that are acceptable, a string that is to represent the format
'// in the dialog's list box, a string to customize the result text of the
'// dialog and a set of flags from the OLEUIPASTEFLAG enumeration. The
'// flags indicate if the entry is valid for pasting only, linking only or
'// both pasting and linking.
' // Size = 36 bytes
TYPE tagOLEUIPASTEENTRYW
 fmtetc AS FORMATETC ' FORMATETC fmtetc; // Format that is acceptable.
 lpstrFormatName AS WSTRINGZ PTR ' LPCWSTR lpstrFormatName // String that represents the format
 ' // to the user. %s is replaced by the
 ' // full user type name of the object.
 lpstrResultText AS WSTRINGZ PTR ' LPCWSTR lpstrResultText // String to customize the result text
 ' // of the dialog when the user
 ' // selects the format correspoding to
 ' // this entry. Any %s in this string
 ' // is replaced by the the application
 ' // name or FullUserTypeName of the
 ' // object on the clipboard.
 dwFlags AS DWORD ' DWORD dwFlags; // Values from OLEUIPASTEFLAG enum
 dwScratchSpace AS DWORD ' DWORD dwScratchSpace; // Scratch space used internally.
END TYPE
' // Size = 36 bytes
TYPE tagOLEUIPASTEENTRYA
 fmtetc AS FORMATETC ' FORMATETC fmtetc; // Format that is acceptable.
 lpstrFormatName AS ASCIIZ PTR ' LPCSTR lpstrFormatName // String that represents the format
 ' // to the user. %s is replaced by the
 ' // full user type name of the object.
 lpstrResultText AS ASCIIZ PTR ' LPCSTR lpstrResultText // String to customize the result text
 ' // of the dialog when the user
 ' // selects the format correspoding to
 ' // this entry. Any %s in this string
 ' // is replaced by the the application
 ' // name or FullUserTypeName of the
 ' // object on the clipboard.
 dwFlags AS DWORD ' DWORD dwFlags; // Values from OLEUIPASTEFLAG enum
 dwScratchSpace AS DWORD ' DWORD dwScratchSpace; // Scratch space used internally.
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagOLEUIPASTEENTRY = tagOLEUIPASTEENTRYW
#ELSE
 MACRO tagOLEUIPASTEENTRY = tagOLEUIPASTEENTRYA
#ENDIF
'// Maximum number of link types
%EQUATE `PS_MAXLINKTYPES = 8
' // Size = 84 bytes
TYPE tagOLEUIPASTESPECIALW
 ' // These IN fields are standard across all OLEUI dialog box functions.
 cbStruct AS DWORD ' DWORD cbStruct // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags // IN-OUT: Flags
 hWndOwner AS DWORD ' HWND hWndOwner // Owning window
 lpszCaption AS WSTRINGZ PTR ' LPCWSTR lpszCaption // Dialog caption bar contents
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook // Hook callback
 lCustData AS DWORD ' LPARAM lCustData // Custom data to pass to hook
 hInstance AS DWORD ' HINSTANCE hInstance // Instance for customized template name
 lpszTemplate AS WSTRINGZ PTR ' LPCWSTR lpszTemplate // Customized template name
 hResource AS DWORD ' HRSRC hResource // Customized template handle
 ' // Specifics for tagOLEUIPASTESPECIALW.
 lpSrcDataObj AS DWORD PTR ' LPDATAOBJECT lpSrcDataObj // IN-OUT: Source IDataObject* on the clipboard
 ' // If lpSrcDataObj is NULL when OleUIPasteSpecial is called, then
 ' // OleUIPasteSpecial will attempt to retrieve a pointer to an
 ' // IDataObject from the clipboard. If OleUIPasteSpecial succeeds
 ' // then it is the caller's responsibility to free the IDataObject
 ' // returned in lpSrcDataObj.
 arrPasteEntries AS tagOLEUIPASTEENTRYW PTR ' LPOLEUIPASTEENTRYW arrPasteEntries // IN: Array of acceptable formats
 cPasteEntries AS LONG ' int cPasteEntries // IN: No. of OLEUIPASTEENTRY array entries
 arrLinkTypes AS DWORD PTR ' UINT FAR* arrLinkTypes // IN: List of acceptable link types
 cLinkTypes AS LONG ' int cLinkTypes // IN: Number of link types
 cClsidExclude AS DWORD ' UINT cClsidExclude // IN: Number of CLSIDs in lpClsidExclude
 lpClsidExclude AS GUID PTR ' LPCLSID lpClsidExclude // IN: List of CLSIDs to exclude from list.
 nSelectedIndex AS LONG ' int nSelectedIndex // OUT: Index that the user selected
 fLink AS LONG ' BOOL fLink // OUT: Indicates if Paste or PasteLink
 hMetaPict AS DWORD ' HGLOBAL hMetaPict // OUT: Handle to Metafile containing icon
 sizel AS SIZEL ' SIZEL sizel // OUT: size of object/link in its source
 ' // may be 0,0 if different display
 ' // aspect is chosen.
END TYPE
' // Size = 84 bytes
TYPE tagOLEUIPASTESPECIALA
 ' // These IN fields are standard across all OLEUI dialog box functions.
 cbStruct AS DWORD ' DWORD cbStruct // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags // IN-OUT: Flags
 hWndOwner AS DWORD ' HWND hWndOwner // Owning window
 lpszCaption AS ASCIIZ PTR ' LPCSTR lpszCaption // Dialog caption bar contents
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook // Hook callback
 lCustData AS DWORD ' LPARAM lCustData // Custom data to pass to hook
 hInstance AS DWORD ' HINSTANCE hInstance // Instance for customized template name
 lpszTemplate AS ASCIIZ PTR ' LPCSTR lpszTemplate // Customized template name
 hResource AS DWORD ' HRSRC hResource // Customized template handle
 ' // Specifics for tagOLEUIPASTESPECIALW.
 lpSrcDataObj AS DWORD PTR ' LPDATAOBJECT lpSrcDataObj // IN-OUT: Source IDataObject* on the clipboard
 ' // If lpSrcDataObj is NULL when OleUIPasteSpecial is called, then
 ' // OleUIPasteSpecial will attempt to retrieve a pointer to an
 ' // IDataObject from the clipboard. If OleUIPasteSpecial succeeds
 ' // then it is the caller's responsibility to free the IDataObject
 ' // returned in lpSrcDataObj.
 arrPasteEntries AS tagOLEUIPASTEENTRYA PTR ' LPOLEUIPASTEENTRYA arrPasteEntries // IN: Array of acceptable formats
 cPasteEntries AS LONG ' int cPasteEntries // IN: No. of OLEUIPASTEENTRY array entries
 arrLinkTypes AS DWORD PTR ' UINT FAR* arrLinkTypes // IN: List of acceptable link types
 cLinkTypes AS LONG ' int cLinkTypes // IN: Number of link types
 cClsidExclude AS DWORD ' UINT cClsidExclude // IN: Number of CLSIDs in lpClsidExclude
 lpClsidExclude AS GUID PTR ' LPCLSID lpClsidExclude // IN: List of CLSIDs to exclude from list.
 nSelectedIndex AS LONG ' int nSelectedIndex // OUT: Index that the user selected
 fLink AS LONG ' BOOL fLink // OUT: Indicates if Paste or PasteLink
 hMetaPict AS DWORD ' HGLOBAL hMetaPict // OUT: Handle to Metafile containing icon
 sizel AS SIZEL ' SIZEL sizel // OUT: size of object/link in its source
 ' // may be 0,0 if different display
 ' // aspect is chosen.
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagOLEUIPASTESPECIAL = tagOLEUIPASTESPECIALW
#ELSE
 MACRO tagOLEUIPASTESPECIAL = tagOLEUIPASTESPECIALA
#ENDIF
DECLARE FUNCTION OleUIPasteSpecialA LIB "oledlg.dll" ALIAS "OleUIPasteSpecialA" ( BYREF lpPS AS tagOLEUIPASTESPECIALA ) AS QUAD ' UINT
DECLARE FUNCTION OleUIPasteSpecialW LIB "oledlg.dll" ALIAS "OleUIPasteSpecialW" ( BYREF lpPS AS tagOLEUIPASTESPECIALW ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO OleUIPasteSpecial = OleUIPasteSpecialW
#ELSE
 MACRO OleUIPasteSpecial = OleUIPasteSpecialA
#ENDIF
'// Paste Special specific flags
%EQUATE `PSF_SHOWHELP = &H00000001
%EQUATE `PSF_SELECTPASTE = &H00000002
%EQUATE `PSF_SELECTPASTELINK = &H00000004
'// NOTE: PSF_CHECKDISPLAYASICON is strictly an output flag.
'// It is ignored if set when calling OleUIPasteSpecial.
%EQUATE `PSF_CHECKDISPLAYASICON = &H00000008
%EQUATE `PSF_DISABLEDISPLAYASICON = &H00000010
%EQUATE `PSF_HIDECHANGEICON = &H00000020
%EQUATE `PSF_STAYONCLIPBOARDCHANGE = &H00000040
%EQUATE `PSF_NOREFRESHDATAOBJECT = &H00000080
'// Paste Special specific error codes
%EQUATE `OLEUI_IOERR_SRCDATAOBJECTINVALID = %OLEUI_ERR_STANDARDMAX + 0
%EQUATE `OLEUI_IOERR_ARRPASTEENTRIESINVALID = %OLEUI_ERR_STANDARDMAX + 1
%EQUATE `OLEUI_IOERR_ARRLINKTYPESINVALID = %OLEUI_ERR_STANDARDMAX + 2
%EQUATE `OLEUI_PSERR_CLIPBOARDCHANGED = %OLEUI_ERR_STANDARDMAX + 3
%EQUATE `OLEUI_PSERR_GETCLIPBOARDFAILED = %OLEUI_ERR_STANDARDMAX + 4
'/////////////////////////////////////////////////////////////////////////////
'// EDIT LINKS DIALOG
'// IOleUILinkContainer interface
'//
'// This interface must be implemented by container applications that
'// want to use the EditLinks dialog. the EditLinks dialog calls back
'// to the container app to perform the OLE functions to manipulate
'// the links within the container.
' ########################################################################################
' IOleUILinkContainerW interface
' Inherited interface = IUnknown
' Note: Microsoft doesn't provide a GUID for this interface.
' ########################################################################################
'INTERFACE IOleUILinkContainerW $IID_IOleUILinkContainerW
' INHERIT IUnknown
' ' =====================================================================================
' METHOD GetNextLink ( ' VTable offset = 12
' BYVAL dwLink AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD SetLinkUpdateOptions ( ' VTable offset = 16
' BYVAL dwLink AS DWORD
' , BYVAL dwUpdateOpt AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD GetLinkUpdateOptions ( ' VTable offset = 20
' BYVAL dwLink AS DWORD
' , BYREF lpdwUpdateOpt AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD SetLinkSource ( ' VTable offset = 24
' BYVAL dwLink AS DWORD
' , BYREF lpszDisplayName AS WSTRINGZ
' , BYVAL lenFileName AS DWORD
' , BYREF pchEaten AS DWORD
' , BYVAL fValidateSource AS LONG
' ) AS LONG
' ' =====================================================================================
' METHOD GetLinkSource ( ' VTable offset = 28
' BYVAL dwLink AS DWORD
' , BYREF lplpszDisplayName AS DWORD
' , BYREF lplenFileName AS DWORD
' , BYREF lplpszFullLinkType AS DWORD
' , BYREF lplpszShortLinkType AS DWORD
' , BYREF lpfSourceAvailable AS LONG
' , BYREF lpfIsSelected AS LONG
' ) AS LONG
' ' =====================================================================================
' METHOD OpenLinkSource ( ' VTable offset = 32
' BYVAL dwLink AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD UpdateLink ( ' VTable offset = 36
' BYVAL dwLink AS DWORD
' , BYVAL fErrorMessage AS LONG
' , BYVAL fReserved AS LONG
' ) AS LONG
' ' =====================================================================================
' METHOD CancelLink ( ' VTable offset = 40
' BYVAL dwLink AS DWORD
' ) AS LONG
' ' =====================================================================================
'END INTERFACE
' ########################################################################################
' IOleUILinkContainerA interface
' Inherited interface = IUnknown
' Note: Microsoft doesn't provide a GUID for this interface.
' ########################################################################################
'INTERFACE IOleUILinkContainerA $IID_IOleUILinkContainerA
' INHERIT IUnknown
' ' =====================================================================================
' METHOD GetNextLink ( ' VTable offset = 12
' BYVAL dwLink AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD SetLinkUpdateOptions ( ' VTable offset = 16
' BYVAL dwLink AS DWORD
' , BYVAL DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD GetLinkUpdateOptions ( ' VTable offset = 20
' BYVAL dwLink AS DWORD
' , BYREF lpdwUpdateOpt AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD SetLinkSource ( ' VTable offset = 24
' BYVAL dwLink AS DWORD
' , BYREF lpszDisplayName AS ASCIIZ
' , BYVAL lenFileName AS DWORD
' , BYREF pchEaten AS DWORD
' , BYVAL fValidateSource AS LONG
' ) AS LONG
' ' =====================================================================================
' METHOD GetLinkSource ( ' VTable offset = 28
' BYVAL dwLink AS DWORD
' , BYREF lplpszDisplayName AS ASCIIZ
' , BYREF lplenFileName AS DWORD
' , BYREF lplpszFullLinkType AS ASCIIZ
' , BYREF lplpszShortLinkType AS ASCIIZ
' , BYREF lpfSourceAvailable AS LONG
' , BYREF lpfIsSelected AS LONG
' ) AS LONG
' ' =====================================================================================
' METHOD OpenLinkSource ( ' VTable offset = 32
' BYVAL dwLink AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD UpdateLink ( ' VTable offset = 36
' BYVAL dwLink AS DWORD
' , BYVAL fErrorMessage AS LONG
' , BYVAL fReserved AS LONG
' ) AS LONG
' ' =====================================================================================
' METHOD CancelLink ( ' VTable offset = 40
' BYVAL dwLink AS DWORD
' ) AS LONG
' ' =====================================================================================
'END INTERFACE
' // Size = 40 bytes
TYPE tagOLEUIEDITLINKSW
 ' // These IN fields are standard across all OLEUI dialog box functions.
 cbStruct AS DWORD ' DWORD cbStruct // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags // IN-OUT: Flags
 hWndOwner AS DWORD ' HWND hWndOwner // Owning window
 lpszCaption AS WSTRINGZ PTR ' LPCWSTR lpszCaption // Dialog caption bar contents
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook // Hook callback
 lCustData AS DWORD ' LPARAM lCustData // Custom data to pass to hook
 hInstance AS DWORD ' HINSTANCE hInstance // Instance for customized template name
 lpszTemplate AS WSTRINGZ PTR ' LPCWSTR lpszTemplate // Customized template name
 hResource AS DWORD ' HRSRC hResource // Customized template handle
 ' // Specifics for tagOLEUIEDITLINKS.
 lpOleUILinkContainer AS DWORD PTR ' LPOLEUILINKCONTAINERW lpOleUILinkContainer // IN: Interface to manipulate
END TYPE
' // Size = 40 bytes
TYPE tagOLEUIEDITLINKSA
 ' // These IN fields are standard across all OLEUI dialog box functions.
 cbStruct AS DWORD ' DWORD cbStruct // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags // IN-OUT: Flags
 hWndOwner AS DWORD ' HWND hWndOwner // Owning window
 lpszCaption AS ASCIIZ PTR ' LPCSTR lpszCaption // Dialog caption bar contents
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook // Hook callback
 lCustData AS DWORD ' LPARAM lCustData // Custom data to pass to hook
 hInstance AS DWORD ' HINSTANCE hInstance // Instance for customized template name
 lpszTemplate AS ASCIIZ PTR ' LPCSTR lpszTemplate // Customized template name
 hResource AS DWORD ' HRSRC hResource // Customized template handle
 ' // Specifics for tagOLEUIEDITLINKS.
 lpOleUILinkContainer AS DWORD PTR ' LPOLEUILINKCONTAINERW lpOleUILinkContainer // IN: Interface to manipulate
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagOLEUIEDITLINKS = tagOLEUIEDITLINKSW
#ELSE
 MACRO tagOLEUIEDITLINKS = tagOLEUIEDITLINKSA
#ENDIF
%EQUATE `OLEUI_ELERR_LINKCNTRNULL = %OLEUI_ERR_STANDARDMAX + 0
%EQUATE `OLEUI_ELERR_LINKCNTRINVALID = %OLEUI_ERR_STANDARDMAX + 1
DECLARE FUNCTION OleUIEditLinksA LIB "oledlg.dll" ALIAS "OleUIEditLinksA" ( BYREF lpEL AS tagOLEUIEDITLINKSA ) AS QUAD ' UINT
DECLARE FUNCTION OleUIEditLinksW LIB "oledlg.dll" ALIAS "OleUIEditLinksW" ( BYREF lpEL AS tagOLEUIEDITLINKSW ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO OleUIEditLinks = OleUIEditLinksW
#ELSE
 MACRO OleUIEditLinks = OleUIEditLinksA
#ENDIF
'// Edit Links flags
%EQUATE `ELF_SHOWHELP = &H00000001
%EQUATE `ELF_DISABLEUPDATENOW = &H00000002
%EQUATE `ELF_DISABLEOPENSOURCE = &H00000004
%EQUATE `ELF_DISABLECHANGESOURCE = &H00000008
%EQUATE `ELF_DISABLECANCELLINK = &H00000010
'/////////////////////////////////////////////////////////////////////////////
'// CHANGE ICON DIALOG
' // Size = 580 bytes
TYPE tagOLEUICHANGEICONW
 ' // These IN fields are standard across all OLEUI dialog box functions.
 cbStruct AS DWORD ' DWORD cbStruct // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags // IN-OUT: Flags
 hWndOwner AS DWORD ' HWND hWndOwner // Owning window
 lpszCaption AS WSTRINGZ PTR ' LPCWSTR lpszCaption // Dialog caption bar contents
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook // Hook callback
 lCustData AS DWORD ' LPARAM lCustData // Custom data to pass to hook
 hInstance AS DWORD ' HINSTANCE hInstance // Instance for customized template name
 lpszTemplate AS WSTRINGZ PTR ' LPCWSTR lpszTemplate // Customized template name
 hResource AS DWORD ' HRSRC hResource // Customized template handle
 ' // Specifics for tagOLEUICHANGEICONW.
 hMetaPict AS DWORD ' HGLOBAL hMetaPict // IN-OUT: Current and final image.
 ' // Source of the icon is embedded in
 ' // the metafile itself.
 clsid AS GUID ' CLSID clsid // IN: class used to get Default icon
 szIconExe AS WSTRINGZ * %MAX_PATH ' WCHAR szIconExe[MAX_PATH] // IN: explicit icon source path
 cchIconExe AS LONG ' int cchIconExe // IN: number of characters in szIconExe
END TYPE
' // Size = 320 bytes
TYPE tagOLEUICHANGEICONA
 ' // These IN fields are standard across all OLEUI dialog box functions.
 cbStruct AS DWORD ' DWORD cbStruct // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags // IN-OUT: Flags
 hWndOwner AS DWORD ' HWND hWndOwner // Owning window
 lpszCaption AS ASCIIZ PTR ' LPCSTR lpszCaption // Dialog caption bar contents
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook // Hook callback
 lCustData AS DWORD ' LPARAM lCustData // Custom data to pass to hook
 hInstance AS DWORD ' HINSTANCE hInstance // Instance for customized template name
 lpszTemplate AS ASCIIZ PTR ' LPCSTR lpszTemplate // Customized template name
 hResource AS DWORD ' HRSRC hResource // Customized template handle
 ' // Specifics for tagOLEUICHANGEICONW.
 hMetaPict AS DWORD ' HGLOBAL hMetaPict // IN-OUT: Current and final image.
 ' // Source of the icon is embedded in
 ' // the metafile itself.
 clsid AS GUID ' CLSID clsid // IN: class used to get Default icon
 szIconExe AS ASCIIZ * %MAX_PATH ' char szIconExe[MAX_PATH] // IN: explicit icon source path
 cchIconExe AS LONG ' int cchIconExe // IN: number of characters in szIconExe
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagOLEUICHANGEICON = tagOLEUICHANGEICONW
#ELSE
 MACRO tagOLEUICHANGEICON = tagOLEUICHANGEICONA
#ENDIF
DECLARE FUNCTION OleUIChangeIconA LIB "oledlg.dll" ALIAS "OleUIChangeIconA" ( BYREF lpCI AS tagOLEUICHANGEICONA ) AS QUAD ' UINT
DECLARE FUNCTION OleUIChangeIconW LIB "oledlg.dll" ALIAS "OleUIChangeIconW" ( BYREF lpCI AS tagOLEUICHANGEICONW ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO OleUIChangeIcon = OleUIChangeIconW
#ELSE
 MACRO OleUIChangeIcon = OleUIChangeIconA
#ENDIF
'// Change Icon flags
%EQUATE `CIF_SHOWHELP = &H00000001
%EQUATE `CIF_SELECTCURRENT = &H00000002
%EQUATE `CIF_SELECTDEFAULT = &H00000004
%EQUATE `CIF_SELECTFROMFILE = &H00000008
%EQUATE `CIF_USEICONEXE = &H00000010
'// Change Icon specific error codes
%EQUATE `OLEUI_CIERR_MUSTHAVECLSID = %OLEUI_ERR_STANDARDMAX + 0
%EQUATE `OLEUI_CIERR_MUSTHAVECURRENTMETAFILE = %OLEUI_ERR_STANDARDMAX + 1
%EQUATE `OLEUI_CIERR_SZICONEXEINVALID = %OLEUI_ERR_STANDARDMAX + 2
'// Property used by ChangeIcon dialog to give its parent window access to
'// its hDlg. The PasteSpecial dialog may need to force the ChgIcon dialog
'// down if the clipboard contents change underneath it. if so it will send
'// a IDCANCEL command to the ChangeIcon dialog.
'#define PROP_HWND_CHGICONDLG TEXT("HWND_CIDLG")
$PROP_HWND_CHGICONDLG = "HWND_CIDLG"
'/////////////////////////////////////////////////////////////////////////////
'// CONVERT DIALOG
' // Size = 136 bytes
TYPE tagOLEUICONVERTW
 ' // These IN fields are standard across all OLEUI dialog box functions.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: Flags
 hWndOwner AS DWORD ' HWND hWndOwner; // Owning window
 lpszCaption AS WSTRINGZ PTR ' LPCWSTR lpszCaption; // Dialog caption bar contents
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook; // Hook callback
 lCustData AS DWORD ' LPARAM lCustData; // Custom data to pass to hook
 hInstance AS DWORD ' HINSTANCE hInstance; // Instance for customized template name
 lpszTemplate AS WSTRINGZ PTR ' LPCWSTR lpszTemplate; // Customized template name
 hResource AS DWORD ' HRSRC hResource; // Customized template handle
 ' // Specifics for tagOLEUICONVERTW.
 clsid AS GUID ' CLSID clsid; // IN: Class ID sent in to dialog: IN only
 clsidConvertDefault AS GUID ' CLSID clsidConvertDefault; // IN: use as convert default: IN only
 clsidActivateDefault AS GUID ' CLSID clsidActivateDefault; // IN: use as activate default: IN only
 clsidNew AS GUID ' CLSID clsidNew; // OUT: Selected Class ID
 dvAspect AS DWORD ' DWORD dvAspect; // IN-OUT: either DVASPECT_CONTENT or DVASPECT_ICON
 wFormat AS WORD ' WORD wFormat; // IN" Original data format
 wFiller AS WORD
 fIsLinkedObject AS LONG ' BOOL fIsLinkedObject;// IN: true if object is linked
 hMetaPict AS DWORD ' HGLOBAL hMetaPict; // IN-OUT: metafile icon image
 lpszUserType AS WSTRINGZ PTR ' LPWSTR lpszUserType; // IN-OUT: user type name of original class.
 ' // We'll do lookup if NULL.
 ' // This gets freed on exit.
 fObjectsIconChanged AS LONG ' BOOL fObjectsIconChanged; // OUT: TRUE == ChangeIcon was called
 lpszDefLabel AS WSTRINGZ PTR ' LPWSTR lpszDefLabel; // IN-OUT: default label to use for icon.
 ' // if NULL, the short user type name
 ' // will be used. if the object is a
 ' // link, the caller should pass the
 ' // DisplayName of the link source
 ' // This gets freed on exit.
 cClsidExclude AS DWORD ' UINT cClsidExclude; //IN: No. of CLSIDs in lpClsidExclude
 lpClsidExclude AS GUID PTR ' LPCLSID lpClsidExclude; //IN: List of CLSIDs to exclude from list
END TYPE
' // Size = 136 bytes
TYPE tagOLEUICONVERTA
 ' // These IN fields are standard across all OLEUI dialog box functions.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: Flags
 hWndOwner AS DWORD ' HWND hWndOwner; // Owning window
 lpszCaption AS ASCIIZ PTR ' LPCSTR lpszCaption; // Dialog caption bar contents
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook; // Hook callback
 lCustData AS DWORD ' LPARAM lCustData; // Custom data to pass to hook
 hInstance AS DWORD ' HINSTANCE hInstance; // Instance for customized template name
 lpszTemplate AS ASCIIZ PTR ' LPCSTR lpszTemplate; // Customized template name
 hResource AS DWORD ' HRSRC hResource; // Customized template handle
 ' // Specifics for tagOLEUICONVERTW.
 clsid AS GUID ' CLSID clsid; // IN: Class ID sent in to dialog: IN only
 clsidConvertDefault AS GUID ' CLSID clsidConvertDefault; // IN: use as convert default: IN only
 clsidActivateDefault AS GUID ' CLSID clsidActivateDefault; // IN: use as activate default: IN only
 clsidNew AS GUID ' CLSID clsidNew; // OUT: Selected Class ID
 dvAspect AS DWORD ' DWORD dvAspect; // IN-OUT: either DVASPECT_CONTENT or DVASPECT_ICON
 wFormat AS WORD ' WORD wFormat; // IN" Original data format
 wFiller AS WORD
 fIsLinkedObject AS LONG ' BOOL fIsLinkedObject;// IN: true if object is linked
 hMetaPict AS DWORD ' HGLOBAL hMetaPict; // IN-OUT: metafile icon image
 lpszUserType AS ASCIIZ PTR ' LPSTR lpszUserType; // IN-OUT: user type name of original class.
 ' // We'll do lookup if NULL.
 ' // This gets freed on exit.
 fObjectsIconChanged AS LONG ' BOOL fObjectsIconChanged; // OUT: TRUE == ChangeIcon was called
 lpszDefLabel AS ASCIIZ PTR ' LPSTR lpszDefLabel; // IN-OUT: default label to use for icon.
 ' // if NULL, the short user type name
 ' // will be used. if the object is a
 ' // link, the caller should pass the
 ' // DisplayName of the link source
 ' // This gets freed on exit.
 cClsidExclude AS DWORD ' UINT cClsidExclude; //IN: No. of CLSIDs in lpClsidExclude
 lpClsidExclude AS GUID PTR ' LPCLSID lpClsidExclude; //IN: List of CLSIDs to exclude from list
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagOLEUICONVERT = tagOLEUICONVERTW
#ELSE
 MACRO tagOLEUICONVERT = tagOLEUICONVERTA
#ENDIF
DECLARE FUNCTION OleUIConvertA LIB "oledlg.dll" ALIAS "OleUIConvertA" ( BYREF lpCV AS tagOLEUICONVERTA ) AS QUAD ' UINT
DECLARE FUNCTION OleUIConvertW LIB "oledlg.dll" ALIAS "OleUIConvertW" ( BYREF lpCV AS tagOLEUICONVERTW ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO OleUIConvert = OleUIConvertW
#ELSE
 MACRO OleUIConvert = OleUIConvertA
#ENDIF
'// Determine if there is at least one class that can Convert or ActivateAs
'// the given clsid.
DECLARE FUNCTION OleUICanConvertOrActivateAs LIB "oledlg.dll" ALIAS "OleUICanConvertOrActivateAs" ( BYREF rClsid AS GUID , BYVAL fIsLinkedObject AS LONG , BYVAL wFormat AS WORD ) AS LONG
'// Convert Dialog flags
%EQUATE `CF_SHOWHELPBUTTON = &H00000001
%EQUATE `CF_SETCONVERTDEFAULT = &H00000002
%EQUATE `CF_SETACTIVATEDEFAULT = &H00000004
%EQUATE `CF_SELECTCONVERTTO = &H00000008
%EQUATE `CF_SELECTACTIVATEAS = &H00000010
%EQUATE `CF_DISABLEDISPLAYASICON = &H00000020
%EQUATE `CF_DISABLEACTIVATEAS = &H00000040
%EQUATE `CF_HIDECHANGEICON = &H00000080
%EQUATE `CF_CONVERTONLY = &H00000100
'// Convert specific error codes
%EQUATE `OLEUI_CTERR_CLASSIDINVALID = %OLEUI_ERR_STANDARDMAX + 1
%EQUATE `OLEUI_CTERR_DVASPECTINVALID = %OLEUI_ERR_STANDARDMAX + 2
%EQUATE `OLEUI_CTERR_CBFORMATINVALID = %OLEUI_ERR_STANDARDMAX + 3
%EQUATE `OLEUI_CTERR_HMETAPICTINVALID = %OLEUI_ERR_STANDARDMAX + 4
%EQUATE `OLEUI_CTERR_STRINGINVALID = %OLEUI_ERR_STANDARDMAX + 5
'/////////////////////////////////////////////////////////////////////////////
'// BUSY DIALOG
' // Size = 44 bytes
TYPE tagOLEUIBUSYW
 ' // These IN fields are standard across all OLEUI dialog box functions.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: see below
 hWndOwner AS DWORD ' HWND hWndOwner; // Owning window
 lpszCaption AS WSTRINGZ PTR ' LPCWSTR lpszCaption; // Dialog caption bar contents
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook; // Hook callback
 lCustData AS DWORD ' LPARAM lCustData; // Custom data to pass to hook
 hInstance AS DWORD ' HINSTANCE hInstance; // Instance for customized template name
 lpszTemplate AS WSTRINGZ PTR ' LPCWSTR lpszTemplate; // Customized template name
 hResource AS DWORD ' HRSRC hResource; // Customized template handle
 ' // Specifics for tagOLEUIBUSY.
 hTask AS DWORD ' HTASK hTask; // IN: HTask which is blocking
 lphWndDialog AS DWORD ' HWND * lphWndDialog; // OUT: Dialog's HWND is placed here
END TYPE
' // Size = 44 bytes
TYPE tagOLEUIBUSYA
 ' // These IN fields are standard across all OLEUI dialog box functions.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: see below
 hWndOwner AS DWORD ' HWND hWndOwner; // Owning window
 lpszCaption AS ASCIIZ PTR ' LPCSTR lpszCaption; // Dialog caption bar contents
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook; // Hook callback
 lCustData AS DWORD ' LPARAM lCustData; // Custom data to pass to hook
 hInstance AS DWORD ' HINSTANCE hInstance; // Instance for customized template name
 lpszTemplate AS ASCIIZ PTR ' LPCSTR lpszTemplate; // Customized template name
 hResource AS DWORD ' HRSRC hResource; // Customized template handle
 ' // Specifics for tagOLEUIBUSY.
 hTask AS DWORD ' HTASK hTask; // IN: HTask which is blocking
 lphWndDialog AS DWORD ' HWND * lphWndDialog; // OUT: Dialog's HWND is placed here
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagOLEUIBUSY = tagOLEUIBUSYW
#ELSE
 MACRO tagOLEUIBUSY = tagOLEUIBUSYA
#ENDIF
DECLARE FUNCTION OleUIBusyA LIB "oledlg.dll" ALIAS "OleUIBusyA" ( BYREF lpBZ AS tagOLEUIBUSYA ) AS QUAD ' UINT
DECLARE FUNCTION OleUIBusyW LIB "oledlg.dll" ALIAS "OleUIBusyW" ( BYREF lpBZ AS tagOLEUIBUSYW ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO OleUIBusy = OleUIBusyW
#ELSE
 MACRO OleUIBusy = OleUIBusyA
#ENDIF
'// Flags for the Busy dialog
%EQUATE `BZ_DISABLECANCELBUTTON = &H00000001
%EQUATE `BZ_DISABLESWITCHTOBUTTON = &H00000002
%EQUATE `BZ_DISABLERETRYBUTTON = &H00000004
%EQUATE `BZ_NOTRESPONDINGDIALOG = &H00000008
'// Busy specific error/return codes
%EQUATE `OLEUI_BZERR_HTASKINVALID = %OLEUI_ERR_STANDARDMAX + 0
%EQUATE `OLEUI_BZ_SWITCHTOSELECTED = %OLEUI_ERR_STANDARDMAX + 1
%EQUATE `OLEUI_BZ_RETRYSELECTED = %OLEUI_ERR_STANDARDMAX + 2
%EQUATE `OLEUI_BZ_CALLUNBLOCKED = %OLEUI_ERR_STANDARDMAX + 3
'/////////////////////////////////////////////////////////////////////////////
'// CHANGE SOURCE DIALOG
'// Data to and from the ChangeSource dialog hook
' // Size = 80 bytes
TYPE tagOLEUICHANGESOURCEW
 ' // These IN fields are standard across all OLEUI dialog box functions.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: Flags
 hWndOwner AS DWORD ' HWND hWndOwner; // Owning window
 lpszCaption AS WSTRINGZ PTR ' LPCWSTR lpszCaption; // Dialog caption bar contents
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook; // Hook callback
 lCustData AS DWORD ' LPARAM lCustData; // Custom data to pass to hook
 hInstance AS DWORD ' HINSTANCE hInstance; // Instance for customized template name
 lpszTemplate AS WSTRINGZ PTR ' LPCWSTR lpszTemplate; // Customized template name
 hResource AS DWORD ' HRSRC hResource; // Customized template handle
 ' // INTERNAL ONLY: do not modify these members
 lpOFN AS OPENFILENAMEW PTR ' OPENFILENAMEW* lpOFN; // pointer OPENFILENAME struct
 dwReserved1(3) AS DWORD ' DWORD dwReserved1[4]; // (reserved for future use)
 ' // Specifics for tagOLEUICHANGESOURCE.
 lpOleUILinkContainer AS DWORD PTR ' LPOLEUILINKCONTAINERA lpOleUILinkContainer; // IN: used to validate link sources
 dwLink AS DWORD ' DWORD dwLink; // IN: magic# for lpOleUILinkContainer
 lpszDisplayName AS WSTRINGZ PTR ' LPWSTR lpszDisplayName;// IN-OUT: complete source display name
 nFileLength AS DWORD ' ULONG nFileLength; // IN-OUT: file moniker part of lpszDisplayName
 lpszFrom AS WSTRINGZ PTR ' LPWSTR lpszFrom; // OUT: prefix of source changed from
 lpszTo AS WSTRINGZ PTR ' LPWSTR lpszTo; // OUT: prefix of source changed to
END TYPE
' // Size = 80 bytes
TYPE tagOLEUICHANGESOURCEA
 ' // These IN fields are standard across all OLEUI dialog box functions.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: Flags
 hWndOwner AS DWORD ' HWND hWndOwner; // Owning window
 lpszCaption AS ASCIIZ PTR ' LPCSTR lpszCaption; // Dialog caption bar contents
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook; // Hook callback
 lCustData AS DWORD ' LPARAM lCustData; // Custom data to pass to hook
 hInstance AS DWORD ' HINSTANCE hInstance; // Instance for customized template name
 lpszTemplate AS ASCIIZ PTR ' LPCSTR lpszTemplate; // Customized template name
 hResource AS DWORD ' HRSRC hResource; // Customized template handle
 ' // INTERNAL ONLY: do not modify these members
 lpOFN AS OPENFILENAME PTR ' OPENFILENAMEA* lpOFN; // pointer OPENFILENAME struct
 dwReserved1(3) AS DWORD ' DWORD dwReserved1[4]; // (reserved for future use)
 ' // Specifics for tagOLEUICHANGESOURCE.
 lpOleUILinkContainer AS DWORD PTR ' LPOLEUILINKCONTAINERA lpOleUILinkContainer; // IN: used to validate link sources
 dwLink AS DWORD ' DWORD dwLink; // IN: magic# for lpOleUILinkContainer
 lpszDisplayName AS ASCIIZ PTR ' LPSTR lpszDisplayName;// IN-OUT: complete source display name
 nFileLength AS DWORD ' ULONG nFileLength; // IN-OUT: file moniker part of lpszDisplayName
 lpszFrom AS ASCIIZ PTR ' LPSTR lpszFrom; // OUT: prefix of source changed from
 lpszTo AS ASCIIZ PTR ' LPSTR lpszTo; // OUT: prefix of source changed to
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagOLEUICHANGESOURCE = tagOLEUICHANGESOURCEW
#ELSE
 MACRO tagOLEUICHANGESOURCE = tagOLEUICHANGESOURCEA
#ENDIF
DECLARE FUNCTION OleUIChangeSourceA LIB "oledlg.dll" ALIAS "OleUIChangeSourceA" ( BYREF lpCS AS tagOLEUICHANGESOURCEA ) AS QUAD ' UINT
DECLARE FUNCTION OleUIChangeSourceW LIB "oledlg.dll" ALIAS "OleUIChangeSourceW" ( BYREF lpCS AS tagOLEUICHANGESOURCEW ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO OleUIChangeSource = OleUIChangeSourceW
#ELSE
 MACRO OleUIChangeSource = OleUIChangeSourceA
#ENDIF
'// Change Source Dialog flags
%EQUATE `CSF_SHOWHELP = &H00000001 ' // IN: enable/show help button
%EQUATE `CSF_VALIDSOURCE = &H00000002 ' // OUT: link was validated
%EQUATE `CSF_ONLYGETSOURCE = &H00000004 ' // IN: disables validation of source
%EQUATE `CSF_EXPLORER = &H00000008 ' // IN: use new OFN_EXPLORER custom template behavior
'// Change Source Dialog errors
%EQUATE `OLEUI_CSERR_LINKCNTRNULL = %OLEUI_ERR_STANDARDMAX + 0
%EQUATE `OLEUI_CSERR_LINKCNTRINVALID = %OLEUI_ERR_STANDARDMAX + 1
%EQUATE `OLEUI_CSERR_FROMNOTNULL = %OLEUI_ERR_STANDARDMAX + 2
%EQUATE `OLEUI_CSERR_TONOTNULL = %OLEUI_ERR_STANDARDMAX + 3
%EQUATE `OLEUI_CSERR_SOURCENULL = %OLEUI_ERR_STANDARDMAX + 4
%EQUATE `OLEUI_CSERR_SOURCEINVALID = %OLEUI_ERR_STANDARDMAX + 5
%EQUATE `OLEUI_CSERR_SOURCEPARSERROR = %OLEUI_ERR_STANDARDMAX + 6
%EQUATE `OLEUI_CSERR_SOURCEPARSEERROR = %OLEUI_ERR_STANDARDMAX + 6
'/////////////////////////////////////////////////////////////////////////////
'// OBJECT PROPERTIES DIALOG
' ########################################################################################
' IOleUIObjInfoW interface
' Inherited interface = IUnknown
' Note: Microsoft doesn't provide a GUID for this interface.
' ########################################################################################
'INTERFACE IOleUIObjInfoW $IID_IOleUIObjInfoW
' INHERIT IUnknown
' ' =====================================================================================
' METHOD GetObjectInfo ( ' VTable offset = 12
' BYVAL dwObject AS DWORD
' , BYREF lpdwObjSize AS DWORD
' , BYREF lplpszLabel AS WSTRINGZ
' , BYREF lplpszType AS WSTRINGZ
' , BYREF lplpszShortType AS WSTRINGZ
' , BYREF lplpszLocation AS WSTRINGZ
' ) AS LONG
' ' =====================================================================================
' METHOD GetConvertInfo ( ' VTable offset = 16
' BYVAL dwObject AS DWORD
' , BYREF lpClassID AS GUID
' , BYREF lpwFormat AS WORD
' , BYREF lpConvertDefaultClassID AS GUID
' , BYREF lplpClsidExclude AS GUID
' , BYREF lpcClsidExclude AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD ConvertObject ( ' VTable offset = 20
' BYVAL dwObject AS DWORD
' , BYREF clsidNew AS GUID
' ) AS LONG
' ' =====================================================================================
' METHOD GetViewInfo ( ' VTable offset = 24
' BYVAL dwObject AS DWORD
' , BYREF phMetaPict AS DWORD
' , BYREF pdvAspect AS DWORD
' , BYREF pnCurrentScale AS LONG ?_
' ) AS LONG
' ' =====================================================================================
' METHOD SetViewInfo ( ' VTable offset = 28
' BYVAL dwObject AS DWORD
' , BYVAL hMetaPict AS DWORD
' , BYVAL dvAspect AS DWORD
' , BYVAL nCurrentScale AS LONG ?_
' , BYVAL bRelativeToOrig AS LONG
' ) AS LONG
' ' =====================================================================================
'END INTERFACE
' ########################################################################################
' IOleUIObjInfoA interface
' Inherited interface = IUnknown
' Note: Microsoft doesn't provide a GUID for this interface.
' ########################################################################################
'INTERFACE IOleUIObjInfoA $IID_IOleUIObjInfoA
' INHERIT IUnknown
' ' =====================================================================================
' METHOD GetObjectInfo ( ' VTable offset = 12
' BYVAL dwObject AS DWORD
' , BYREF lpdwObjSize AS DWORD
' , BYREF lplpszLabel AS ASCIIZ
' , BYREF lplpszType AS ASCIIZ
' , BYREF lplpszShortType AS ASCIIZ
' , BYREF lplpszLocation ASASCIIZ
' ) AS LONG
' ' =====================================================================================
' METHOD GetConvertInfo ( ' VTable offset = 16
' BYVAL dwObject AS DWORD
' , BYREF lpClassID AS GUID
' , BYREF lpwFormat AS WORD
' , BYREF lpConvertDefaultClassID AS GUID
' , BYREF lplpClsidExclude AS GUID
' , BYREF lpcClsidExclude AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD ConvertObject ( ' VTable offset = 20
' BYVAL dwObject AS DWORD
' , BYREF clsidNew AS GUID
' ) AS LONG
' ' =====================================================================================
' METHOD GetViewInfo ( ' VTable offset = 24
' BYVAL dwObject AS DWORD
' , BYREF phMetaPict AS DWORD
' , BYREF pdvAspect AS DWORD
' , BYREF pnCurrentScale AS LONG ?_
' ) AS LONG
' ' =====================================================================================
' METHOD SetViewInfo ( ' VTable offset = 28
' BYVAL dwObject AS DWORD
' , BYVAL hMetaPict AS DWORD
' , BYVAL dvAspect AS DWORD
' , BYVAL nCurrentScale AS LONG ?_
' , BYVAL bRelativeToOrig AS LONG
' ) AS LONG
' ' =====================================================================================
'END INTERFACE
' ########################################################################################
' IOleUILinkInfoW interface
' Inherited interface = IOleUILinkContainerW
' Note: Microsoft doesn't provide a GUID for this interface.
' ########################################################################################
'INTERFACE IOleUILinkInfoW $IID_IOleUILinkInfoW
' INHERIT IUnknown
' ' =====================================================================================
' ' IOleUILinkContainerW Methods
' ' =====================================================================================
' METHOD GetNextLink ( ' VTable offset = 12
' BYVAL dwLink AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD SetLinkUpdateOptions ( ' VTable offset = 16
' BYVAL dwLink AS DWORD
' , BYVAL dwUpdateOpt AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD GetLinkUpdateOptions ( ' VTable offset = 20
' BYVAL dwLink AS DWORD
' , BYREF lpdwUpdateOpt AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD SetLinkSource ( ' VTable offset = 24
' BYVAL dwLink AS DWORD
' , BYREF lpszDisplayName AS WSTRINGZ
' , BYVAL lenFileName AS DWORD
' , BYREF pchEaten AS DWORD
' , BYVAL fValidateSource AS LONG
' ) AS LONG
' ' =====================================================================================
' METHOD GetLinkSource ( ' VTable offset = 28
' BYVAL dwLink AS DWORD
' , BYREF lplpszDisplayName AS DWORD
' , BYREF lplenFileName AS DWORD
' , BYREF lplpszFullLinkType AS DWORD
' , BYREF lplpszShortLinkType AS DWORD
' , BYREF lpfSourceAvailable AS LONG
' , BYREF lpfIsSelected AS LONG
' ) AS LONG
' ' =====================================================================================
' METHOD OpenLinkSource ( ' VTable offset = 32
' BYVAL dwLink AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD UpdateLink ( ' VTable offset = 36
' BYVAL dwLink AS DWORD
' , BYVAL fErrorMessage AS LONG
' , BYVAL fReserved AS LONG
' ) AS LONG
' ' =====================================================================================
' METHOD CancelLink ( ' VTable offset = 40
' BYVAL dwLink AS DWORD
' ) AS LONG
' ' =====================================================================================
' ' =====================================================================================
' ' IOleUILinkInfoW Methods
' ' =====================================================================================
' METHOD GetLastUpdate ( ' VTable offset = 44
' BYVAL DWORD
' , BYREF FILETIME
' ) AS LONG
' ' =====================================================================================
'END INTERFACE
' ########################################################################################
' IOleUILinkInfoA interface
' Inherited interface = IOleUILinkContainerA
' Note: Microsoft doesn't provide a GUID for this interface.
' ########################################################################################
'INTERFACE IOleUILinkInfoA $IID_IOleUILinkInfoA
' INHERIT IUnknown
' ' =====================================================================================
' ' IOleUILinkContainerA Methods
' ' =====================================================================================
' METHOD GetNextLink ( ' VTable offset = 12
' BYVAL dwLink AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD SetLinkUpdateOptions ( ' VTable offset = 16
' BYVAL dwLink AS DWORD
' , BYVAL DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD GetLinkUpdateOptions ( ' VTable offset = 20
' BYVAL dwLink AS DWORD
' , BYREF lpdwUpdateOpt AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD SetLinkSource ( ' VTable offset = 24
' BYVAL dwLink AS DWORD
' , BYREF lpszDisplayName AS ASCIIZ
' , BYVAL lenFileName AS DWORD
' , BYREF pchEaten AS DWORD
' , BYVAL fValidateSource AS LONG
' ) AS LONG
' ' =====================================================================================
' METHOD GetLinkSource ( ' VTable offset = 28
' BYVAL dwLink AS DWORD
' , BYREF lplpszDisplayName AS ASCIIZ
' , BYREF lplenFileName AS DWORD
' , BYREF lplpszFullLinkType AS ASCIIZ
' , BYREF lplpszShortLinkType AS ASCIIZ
' , BYREF lpfSourceAvailable AS LONG
' , BYREF lpfIsSelected AS LONG
' ) AS LONG
' ' =====================================================================================
' METHOD OpenLinkSource ( ' VTable offset = 32
' BYVAL dwLink AS DWORD
' ) AS LONG
' ' =====================================================================================
' METHOD UpdateLink ( ' VTable offset = 36
' BYVAL dwLink AS DWORD
' , BYVAL fErrorMessage AS LONG
' , BYVAL fReserved AS LONG
' ) AS LONG
' ' =====================================================================================
' METHOD CancelLink ( ' VTable offset = 40
' BYVAL dwLink AS DWORD
' ) AS LONG
' ' =====================================================================================
' ' =====================================================================================
' ' IOleUILinkInfoA Methods
' ' =====================================================================================
' METHOD GetLastUpdate ( ' VTable offset = 44
' BYVAL DWORD
' , BYREF FILETIME
' ) AS LONG
' ' =====================================================================================
'END INTERFACE
' // Size = 40 bytes
TYPE tagOLEUIGNRLPROPSW
 ' // These IN fields are standard across all OLEUI property pages.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: flags specific to general page
 dwReserved1(1) AS DWORD ' DWORD dwReserved1[2];
 lpfnHook AS DWORD PTR ' LPFNOLEUIHOOK lpfnHook; // Hook callback
 lCustData AS LONG ' LPARAM lCustData; // Custom data to pass to hook
 dwReserved2(2) AS DWORD ' DWORD dwReserved2[3];
 lpOP AS DWORD ' struct tagOLEUIOBJECTPROPSW* lpOP; // (used internally)
END TYPE
' // Size = 40 bytes
TYPE tagOLEUIGNRLPROPSA
 ' // These IN fields are standard across all OLEUI property pages.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: flags specific to general page
 dwReserved1(1) AS DWORD ' DWORD dwReserved1[2];
 lpfnHook AS DWORD PTR ' LPFNOLEUIHOOK lpfnHook; // Hook callback
 lCustData AS LONG ' LPARAM lCustData; // Custom data to pass to hook
 dwReserved2(2) AS DWORD ' DWORD dwReserved2[3];
 lpOP AS DWORD ' struct tagOLEUIOBJECTPROPSA* lpOP; // (used internally)
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagOLEUIGNRLPROPS = tagOLEUIGNRLPROPSW
#ELSE
 MACRO tagOLEUIGNRLPROPS = tagOLEUIGNRLPROPSA
#ENDIF
' // Size = 48 bytes
TYPE tagOLEUIVIEWPROPSW
 ' // These IN fields are standard across all OLEUI property pages.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: flags specific to view page
 dwReserved1(1) AS DWORD ' DWORD dwReserved1[2];
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook; // Hook callback (not used in this dialog)
 lCustData AS LONG ' LPARAM lCustData; // Custom data to pass to hook
 dwReserved2(2) AS DWORD ' DWORD dwReserved2[3];
 lpOP AS DWORD ' struct tagOLEUIOBJECTPROPSW* lpOP; // (used internally)
 nScaleMin AS LONG ' int nScaleMin; // scale range
 nScaleMax AS LONG ' int nScaleMax;
END TYPE
' // Size = 48 bytes
TYPE tagOLEUIVIEWPROPSA
 ' // These IN fields are standard across all OLEUI property pages.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: flags specific to view page
 dwReserved1(1) AS DWORD ' DWORD dwReserved1[2];
 lpfnHook AS DWORD ' LPFNOLEUIHOOK lpfnHook; // Hook callback (not used in this dialog)
 lCustData AS LONG ' LPARAM lCustData; // Custom data to pass to hook
 dwReserved2(2) AS DWORD ' DWORD dwReserved2[3];
 lpOP AS DWORD ' struct tagOLEUIOBJECTPROPSA* lpOP; // (used internally)
 nScaleMin AS LONG ' int nScaleMin; // scale range
 nScaleMax AS LONG ' int nScaleMax;
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagOLEUIVIEWPROPS = tagOLEUIVIEWPROPSW
#ELSE
 MACRO tagOLEUIVIEWPROPS = tagOLEUIVIEWPROPSA
#ENDIF
'// Flags for OLEUIVIEWPROPS
%EQUATE `VPF_SELECTRELATIVE = &H00000001 ' // IN: relative to orig
%EQUATE `VPF_DISABLERELATIVE = &H00000002 ' // IN: disable relative to orig
%EQUATE `VPF_DISABLESCALE = &H00000004 ' // IN: disable scale option
' // Size = 40 bytes
TYPE tagOLEUILINKPROPSW
 ' // These IN fields are standard across all OLEUI property pages.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: flags specific to links page
 dwReserved1(1) AS DWORD ' DWORD dwReserved1[2];
 lpfnHook AS DWORD PTR ' LPFNOLEUIHOOK lpfnHook; // Hook callback (not used in this dialog)
 lCustData AS LONG ' LPARAM lCustData; // Custom data to pass to hook
 dwReserved2(2) AS DWORD ' DWORD dwReserved2[3];
 lpOP AS DWORD ' struct tagOLEUIOBJECTPROPSW* lpOP; // (used internally)
END TYPE
' // Size = 40 bytes
TYPE tagOLEUILINKPROPSA
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 ' // These IN fields are standard across all OLEUI property pages.
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: flags specific to links page
 dwReserved1(1) AS DWORD ' DWORD dwReserved1[2];
 lpfnHook AS DWORD PTR ' LPFNOLEUIHOOK lpfnHook; // Hook callback (not used in this dialog)
 lCustData AS LONG ' LPARAM lCustData; // Custom data to pass to hook
 dwReserved2(2) AS DWORD ' DWORD dwReserved2[3];
 lpOP AS DWORD ' struct tagOLEUIOBJECTPROPSA* lpOP; // (used internally)
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagOLEUILINKPROPS = tagOLEUILINKPROPSW
#ELSE
 MACRO tagOLEUILINKPROPS = tagOLEUILINKPROPSA
#ENDIF
#INCLUDE ONCE "prsht.inc
' // Size = 40 bytes
TYPE tagOLEUIOBJECTPROPSW
 ' // These IN fields are standard across all OLEUI property sheets.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: global flags for the sheet
 ' // Standard PROPSHEETHEADER used for extensibility
 lpPS AS PROPSHEETHEADERW PTR ' LPPROPSHEETHEADERW lpPS; // IN: property sheet header
 ' // Data which allows manipulation of the object
 dwObject AS DWORD ' DWORD dwObject; // IN: identifier for the object
 lpObjInfo AS DWORD PTR ' LPOLEUIOBJINFOW lpObjInfo; // IN: interface to manipulate object
 ' // Data which allows manipulation of the link
 dwLink AS DWORD ' DWORD dwLink; // IN: identifier for the link
 lpLinkInfo AS DWORD PTR ' LPOLEUILINKINFOW lpLinkInfo; // IN: interface to manipulate link
 ' // Data specific to each page
 lpGP AS tagOLEUIGNRLPROPSW PTR ' LPOLEUIGNRLPROPSW lpGP; // IN: general page
 lpVP AS tagOLEUIVIEWPROPSW PTR ' LPOLEUIVIEWPROPSW lpVP; // IN: view page
 lpLP AS tagOLEUILINKPROPSW PTR ' LPOLEUILINKPROPSW lpLP; // IN: link page
END TYPE
' // Size = 40 bytes
TYPE tagOLEUIOBJECTPROPSA
 ' // These IN fields are standard across all OLEUI property sheets.
 cbStruct AS DWORD ' DWORD cbStruct; // Structure Size
 dwFlags AS DWORD ' DWORD dwFlags; // IN-OUT: global flags for the sheet
 ' // Standard PROPSHEETHEADER used for extensibility
 lpPS AS PROPSHEETHEADERA PTR ' LPPROPSHEETHEADERA lpPS; // IN: property sheet header
 ' // Data which allows manipulation of the object
 dwObject AS DWORD ' DWORD dwObject; // IN: identifier for the object
 lpObjInfo AS DWORD PTR ' LPOLEUIOBJINFOA lpObjInfo; // IN: interface to manipulate object
 ' // Data which allows manipulation of the link
 dwLink AS DWORD ' DWORD dwLink; // IN: identifier for the link
 lpLinkInfo AS DWORD PTR ' LPOLEUILINKINFOA lpLinkInfo; // IN: interface to manipulate link
 ' // Data specific to each page
 lpGP AS tagOLEUIGNRLPROPSA PTR ' LPOLEUIGNRLPROPSA lpGP; // IN: general page
 lpVP AS tagOLEUIVIEWPROPSA PTR ' LPOLEUIVIEWPROPSA lpVP; // IN: view page
 lpLP AS tagOLEUILINKPROPSA PTR ' LPOLEUILINKPROPSA lpLP; // IN: link page
END TYPE
#IF %DEF(%UNICODE)
 MACRO tagOLEUIOBJECTPROPS = tagOLEUIOBJECTPROPSW
#ELSE
 MACRO tagOLEUIOBJECTPROPS = tagOLEUIOBJECTPROPSA
#ENDIF
DECLARE FUNCTION OleUIObjectPropertiesA LIB "oledlg.dll" ALIAS "OleUIObjectPropertiesA" ( BYREF lpOP AS tagOLEUIOBJECTPROPSA ) AS QUAD ' UINT
DECLARE FUNCTION OleUIObjectPropertiesW LIB "oledlg.dll" ALIAS "OleUIObjectPropertiesW" ( BYREF lpOP AS tagOLEUIOBJECTPROPSW ) AS QUAD ' UINT
#IF %DEF(%UNICODE)
 MACRO OleUIObjectProperties = OleUIObjectPropertiesW
#ELSE
 MACRO OleUIObjectProperties = OleUIObjectPropertiesA
#ENDIF
'// Flags for OLEUIOBJECTPROPS
%EQUATE `OPF_OBJECTISLINK = &H00000001
%EQUATE `OPF_NOFILLDEFAULT = &H00000002
%EQUATE `OPF_SHOWHELP = &H00000004
%EQUATE `OPF_DISABLECONVERT = &H00000008
'' // Errors for OleUIObjectProperties
%EQUATE `OLEUI_OPERR_SUBPROPNULL = %OLEUI_ERR_STANDARDMAX + 0
%EQUATE `OLEUI_OPERR_SUBPROPINVALID = %OLEUI_ERR_STANDARDMAX + 1
%EQUATE `OLEUI_OPERR_PROPSHEETNULL = %OLEUI_ERR_STANDARDMAX + 2
%EQUATE `OLEUI_OPERR_PROPSHEETINVALID = %OLEUI_ERR_STANDARDMAX + 3
%EQUATE `OLEUI_OPERR_SUPPROP = %OLEUI_ERR_STANDARDMAX + 4
%EQUATE `OLEUI_OPERR_PROPSINVALID = %OLEUI_ERR_STANDARDMAX + 5
%EQUATE `OLEUI_OPERR_PAGESINCORRECT = %OLEUI_ERR_STANDARDMAX + 6
%EQUATE `OLEUI_OPERR_INVALIDPAGES = %OLEUI_ERR_STANDARDMAX + 7
%EQUATE `OLEUI_OPERR_NOTSUPPORTED = %OLEUI_ERR_STANDARDMAX + 8
%EQUATE `OLEUI_OPERR_DLGPROCNOTNULL = %OLEUI_ERR_STANDARDMAX + 9
%EQUATE `OLEUI_OPERR_LPARAMNOTZERO = %OLEUI_ERR_STANDARDMAX + 10
%EQUATE `OLEUI_GPERR_STRINGINVALID = %OLEUI_ERR_STANDARDMAX + 11
%EQUATE `OLEUI_GPERR_CLASSIDINVALID = %OLEUI_ERR_STANDARDMAX + 12
%EQUATE `OLEUI_GPERR_LPCLSIDEXCLUDEINVALID = %OLEUI_ERR_STANDARDMAX + 13
%EQUATE `OLEUI_GPERR_CBFORMATINVALID = %OLEUI_ERR_STANDARDMAX + 14
%EQUATE `OLEUI_VPERR_METAPICTINVALID = %OLEUI_ERR_STANDARDMAX + 15
%EQUATE `OLEUI_VPERR_DVASPECTINVALID = %OLEUI_ERR_STANDARDMAX + 16
%EQUATE `OLEUI_LPERR_LINKCNTRNULL = %OLEUI_ERR_STANDARDMAX + 17
%EQUATE `OLEUI_LPERR_LINKCNTRINVALID = %OLEUI_ERR_STANDARDMAX + 18
%EQUATE `OLEUI_OPERR_PROPERTYSHEET = %OLEUI_ERR_STANDARDMAX + 19
%EQUATE `OLEUI_OPERR_OBJINFOINVALID = %OLEUI_ERR_STANDARDMAX + 20
%EQUATE `OLEUI_OPERR_LINKINFOINVALID = %OLEUI_ERR_STANDARDMAX + 21
'' // wParam used by PSM_QUERYSIBLINGS
%EQUATE `OLEUI_QUERY_GETCLASSID = &HFF00 ' // override class id for icon
%EQUATE `OLEUI_QUERY_LINKBROKEN = &HFF01 ' // after link broken
'/////////////////////////////////////////////////////////////////////////////
'// PROMPT USER DIALOGS
'int __cdecl OleUIPromptUserW(int nTemplate, HWND hwndParent, ...);
'int __cdecl OleUIPromptUserA(int nTemplate, HWND hwndParent, ...);
DECLARE FUNCTION OleUIPromptUserA CDECL LIB "oledlg.dll" ALIAS "OleUIPromptUserA" ( BYVAL nTemplate AS LONG , BYVAL hwndParent AS QUAD , OPTIONAL BYREF ANY ' optional parameters , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY ) AS LONG ' int
DECLARE FUNCTION OleUIPromptUserW CDECL LIB "oledlg.dll" ALIAS "OleUIPromptUserW" ( BYVAL nTemplate AS LONG , BYVAL hwndParent AS QUAD , OPTIONAL BYREF ANY ' optional parameters , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY , OPTIONAL BYREF ANY ) AS LONG ' int
#IF %DEF(%UNICODE)
 MACRO OleUIPromptUser = OleUIPromptUserW
#ELSE
 MACRO OleUIPromptUser = OleUIPromptUserA
#ENDIF
DECLARE FUNCTION OleUIUpdateLinksA LIB "oledlg.dll" ALIAS "OleUIUpdateLinksA" ( BYVAL lpOleUILinkCntr AS IUnknown , BYVAL hwndParent AS QUAD , BYREF lpszTitle AS ASCIIZ , BYVAL cLinks AS LONG ) AS LONG
DECLARE FUNCTION OleUIUpdateLinksW LIB "oledlg.dll" ALIAS "OleUIUpdateLinksW" ( BYVAL lpOleUILinkCntr AS IUnknown
 , BYVAL hwndParent AS DWORD
 , BYREF lpszTitle AS WSTRINGZ
 , BYVAL cLinks AS LONG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO OleUIUpdateLinks = OleUIUpdateLinksW
#ELSE
 MACRO OleUIUpdateLinks = OleUIUpdateLinksA
#ENDIF
'/////////////////////////////////////////////////////////////////////////////
'#pragma pack(pop)
'/////////////////////////////////////////////////////////////////////////////
#ENDIF
