#ifndef __WEBSTERDLLWRAP_H__ #define __WEBSTERDLLWRAP_H__ ///////////////////////////////////////////////////////////////////////////// // // Definitions and constants // typedef long ObjectHandle; // // // Property LoadStatus, BeforeNavigate parameter Status etc enum enumLoadStatus { Unknown = -1, LoadComplete = 0, AttemptingConnection = 1, WaitingForResponse = 2, LoadingText = 3, LoadingImages = 4, Failed = 5, Canceled = 6, LoadingFrames = 7, }; // Bevel styles (BevelStyleInner, BevelStyleOuter properties) enum {BEVEL_NONE, BEVEL_INDENT, BEVEL_OUTDENT, BEVEL_SHADOW}; // Cookies support (CookieControl property) enum enumCookieSupportStyle {CookiesSubmitAll, CookiesSubmitNone, CookiesSubmitFresh}; // Animated image support (AnimationControl property) enum AnimationControls {PlayOff = 0, PlayOn = 1, PlayStop = 2, PlayNever = 3}; // LayoutControl property settings enum LayoutControls {SuppressLayout = 0, AllowLayout = 1}; // Selection states (SelectionState property, TextSelectionChange event parameter State) enum enumSelectionStates {SEL_IS_INACTIVE = 0, SEL_IS_IN_PROGRESS, SEL_IS_PRESENT}; // TextCopyMode property settings enum enumTextCopyModes {COPYMODE_SPACE_ONLY = 0, COPYMODE_WITH_HARD_NEWLINES, COPYMODE_HARD_EXPANDED}; // StatusDisplay property settings enum StatusDisplayStyles {StatusDisplayBarOnly = 0, StatusDisplayShowPage = 1, StatusDisplayPopupDialog = 2}; // AnchorUnderline property settings enum AnchorUnderlineStyles {AnchorUnderlineNever = 0, AnchorUnderlineAlways = 1, AnchorUnderlineOnHover = 2}; // Navigation flags (Navigate method, BeforeNavigate event) enum NavFlagMasks { NAV_GET = 0x00000000L, NAV_POST = 0x00000001L, NAV_HEAD = 0x00000002L, NAV_HIDDENLOAD = 0x00000004L, NAV_NOREADFROMCACHE = 0x00000008L, NAV_FOUNDINCACHE = 0x00000010L, NAV_INFRAMECONTEXT = 0x00000020L, NAV_FORMSUBMIT = 0x00000040L, NAV_CONTAINERACTION = 0x00000080L, NAV_BACK = 0x00000100L, NAV_FORTH = 0x00000200L, NAV_DONTMAKECURRENT = 0x00000400L, NAV_METAREFRESH = 0x00000800L, NAV_USERHYPERLINK = 0x00001000L, NAV_CREATEFROMTEXT = 0x00002000L, }; // // These are used inernally with the FONT properties (dispidFontHeading1 ... dispidFontAddress) // enum { FONTPROP_NAME = 0, FONTPROP_SIZE = 1, FONTPROP_WEIGHT = 2, FONTPROP_CHARSET = 3, FONTPROP_ITALIC = 4, FONTPROP_UNDERLINE = 5, FONTPROP_STRIKETHROUGH = 6, }; // // Used internally to access Collection objects: // enum { COLLECT_GetCount = 0, COLLECT_Add = 1, COLLECT_Find = 2, COLLECT_Remove = 3, COLLECT_RemoveAll = 4, COLLECT_GetItem = 5, COLLECT_SetItem = 6, }; // // The object type masks returned by GetObjectAtXY // enum {OTM_EMPTY = 0x0001L, OTM_HYPERLINK = 0x0002L, OTM_TEXT = 0x0004L, OTM_IMAGE = 0x0008L, OTM_IMAGEMAP = 0x0010L, OTM_IMAGEINPUT = 0x0020L, OTM_CONTROL = 0x0040L, OTM_TABLE = 0x0080L, OTM_USEMAP = 0x0100L, }; // Printing of backgrounds: the PrintBackgroundColors property enum {PBK_TABLE_COLOR_OFF = 0, PBK_TABLE_COLOR_ON = 1, PBK_TABLE_COLOR_AUTO = 2, PBK_COLOR_ON = 3, PKG_COLOR_AUTO = 4, }; // ToolTipStyle property enum {TOOLTIPS_OFF = 0, TOOLTIPS_BUTTONS = 1, TOOLTIPS_ALT_TEXT = 2, TOOLTIPS_LINK_TITLE = 4, TOOLTIPS_ALL = 7, }; // URL / Status window settings (UrlWindowStyle) enum {URLWIN_NONE = 0, URLWIN_TOP = 1, URLWIN_BOTTOM = 2, }; // Title / Toolbar window settings (TitleWindowStyle) enum {TITLE_NONE = 0, TITLE_TOP = 1, TITLE_BOTTOM = 2, }; // Scrollbar settings (ScrollbarStyleVertical, ScrollbarStyleHorizontal) enum {SCROLLBAR_OFF = 0, SCROLLBAR_ON = 1, SCROLLBAR_AUTO = 2, }; ///////////////////////////////////////////////////////////////////////////// // // These represent the Webster Pro properties, events and methods. // // Not all are used in the DLL (unused ordinals return an error code of -4). // // The property and event ordinals are mostly used by the helper functions defined // in this file, but the font functions use dispid ordinals and the // SetEventHandlerAddress function uses eventid ordinals. // // enum { dispidAboutBox = -1L, dispidForeColor = -2L, dispidBackColor = -3L, dispidRefresh = -4L, dispidBevelStyleInner = 1L, dispidBevelStyleOuter = 2L, dispidBevelWidth = 3L, dispidFontHeading1 = 30L, dispidFontHeading2 = 31L, dispidFontHeading3 = 32L, dispidFontHeading4 = 33L, dispidFontHeading5 = 34L, dispidFontHeading6 = 35L, dispidFontMenu = 36L, dispidFontDir = 37L, dispidFontBlockQuote = 38L, dispidFontExample = 39L, dispidFontPreformatted = 40L, dispidFontListing = 41L, dispidFontNormal = 42L, dispidFontAddress = 43L, dispidBevelColorTop = 4L, dispidBevelColorDark = 5L, dispidBevelColorLight = 6L, dispidUrlWindowStyle = 7L, dispidTitleWindowStyle = 8L, dispidPageURL = 9L, dispidPageTitle = 10L, dispidAnchorColor = 11L, dispidHomePage = 12L, dispidDownloadDir = 13L, dispidPagesToCache = 14L, dispidIgnoreBaseInFile = 15L, dispidLoadStatus = 44L, dispidMaxSockets = 16L, dispidMaxPageLoads = 17L, dispidMarginHorizontal = 18L, dispidMarginVertical = 19L, dispidLoadImages = 20L, dispidShowReferer = 21L, dispidAuthenticName = 22L, dispidAuthenticPassword = 23L, dispidFromName = 24L, dispidBrowserName = 25L, dispidButtonMask = 26L, dispidProxyServerHTTP = 27L, dispidProxyPortHTTP = 28L, dispidImageCacheKB = 29L, dispidSaveToDisk = 45L, dispidCancel = 46L, dispidGetContentSize = 47L, dispidGetContentSizeRead = 48L, dispidGetContentType = 49L, dispidGetRedirectedURL = 50L, dispidGetHiddenFlag = 51L, dispidSetHiddenFlag = 52L, dispidDismissPage = 53L, dispidGetLinkCount = 54L, dispidGetLinkURL = 55L, dispidGetContent = 56L, dispidGetStatus = 57L, dispidGetTitle = 58L, dispidGetText = 59L, dispidLoadPage = 60L, dispidGetTextSize = 61L, dispidGoHome = 62L, dispidShowHistory = 63L, dispidShowStatus = 64L, dispidPageBack = 65L, dispidPageForth = 66L, dispidReload = 67L, dispidShowDir = 68L, dispidShowOpenFileDialog = 69L, dispidShowURLDialog = 70L, dispidPrintToDC = 71L, dispidPaginate = 72L, dispidEndPrint = 73L, dispidDoPrint = 74L, dispidShortcutDir = 75L, dispidGetHTTPHeader = 76, dispidAddToFavorites = 77, dispidShowFavoritesDialog = 78, dispidLoadHeader = 79, dispidPostText = 80, dispidProxyExclusionsHTTP = 81L, dispidScrollbarStyleVertical = 82L, dispidScrollbarStyleHorizontal = 83L, dispidScrollPosVertical = 84L, dispidScrollPosHorizontal = 85L, dispidPageWidth = 86L, dispidPageHeight = 87L, dispidDisplayLeft = 88L, dispidDisplayTop = 89L, dispidDisplayWidth = 90L, dispidDisplayHeight = 91L, dispidCachedPages = 92L, dispidHistoryPages = 93L, dispidEmbeddedObjectURLs = 94L, dispidGetObjectAtXY = 95, dispidReloadIncludesObjects = 96, dispidPaletteForceBackground = 97, dispidKeepForwardHistory = 98, dispidLanguageAndCharacterSet = 99, dispidCookiesDir = 100L, dispidCookieControl = 101, dispidFindString = 102, dispidSelectText = 103, dispidSelectAllText = 104, dispidCopySelectedText = 105, dispidClearTextSelection = 106, dispidScrollToSelectedText = 107, dispidSelectionState = 108, dispidSelectionStartOffset = 109, dispidSelectionLength = 110, dispidProxyServerUserNameHTTP = 111L, dispidProxyServerPasswordHTTP = 112L, dispidSaveObjectToFile = 113L, dispidNoFrames = 114L, dispidGetFrameURLs = 115L, dispidGetSingleObjectHandle = 116L, dispidGetURLByObjectHandle = 117L, dispidGetObjecthWnd = 118L, dispidGethWndByObjectHandle = 119L, dispidGetFrameObjectHandles = 120L, dispidPageObjectHandle = 121L, dispidFocusPageObjectHandle = 122L, dispidNavigate = 123L, dispidButtonEnabledMask = 124L, dispidMenuControl = 125L, dispidAnimationControl = 126L, dispidLayoutControl = 127L, dispidPaletteHandle = 128L, dispidPrintBackgroundColors = 129L, dispidPaginate2 = 130L, dispidToolTipStyle = 131L, dispidCursorHandle = 132L, dispidPrintPageBreakForImages = 133L, dispidPrintPageBreakForTables = 134L, dispidTextCopyMode = 135L, dispidVisitedColor = 136L, dispidStatusDisplay = 137L, dispidActiveColor = 138L, dispidHoverColor = 139L, dispidAnchorUnderline = 140L, dispidSocketTimeout = 141L, dispidlfClipPrecision = 142L, dispidMaxPostTextInKey = 143L, dispidGetVerticalPosInLayout = 144L, dispidGetHorizontalPosInLayout = 145L, dispidEventEnableMask = 146L, dispidGetFormCount = 147L, dispidGetFormString = 148L, dispidPrintHeader = 149L, dispidPrintFooter = 150L, dispidImageZoomFactor = 151L, eventidKeyDown = -1L, eventidKeyUp = -2L, eventidMouseDown = -3L, eventidMouseMove = -4L, eventidMouseUp = -5L, eventidHyperlinkTransition = 3L, eventidDoGetImage = 4L, eventidPageShowing = 7L, eventidPageStatusChange = 8L, eventidObjectStatusChange = 9L, eventidTextSelectionChange = 10, eventidFocusPageChange = 11, eventidBeforeNavigate = 12, eventidLayoutComputed = 13, }; ///////////////////////////////////////////////////////////////////////////// // // Externals // // ///////////////////////////////////////////////////////////////////////////// // Exposed DLL interface // #ifdef __cplusplus extern "C" { #endif // __cplusplus #if !defined (_WIN32) # define EXPORT __export # define EXPORT32 #else # define EXPORT # if defined _WINDLL # define EXPORT32 __declspec(dllexport) # else # define EXPORT32 __declspec(dllimport) # endif #endif // // These functions are exported from the DLL typedef EXPORT32 HANDLE EXPORT (FAR* MY_CREATE)(DWORD dwStyle, int left, int top, int width, int height, HWND pParent, DWORD pCode); // 2 DWORD ByVal, 4 String ByVal typedef EXPORT32 DWORD EXPORT (FAR* MY_DOMETHOD)(HANDLE hControl, DWORD actionCode1, DWORD actionCode2, DWORD actionCode3, char* string1, char* string2, char* string3, char* string4); // 3 DWORD ByVal, 1 String ByVal, 1 DWORD ByRef, 1 String ByRef typedef EXPORT32 DWORD EXPORT (FAR* MY_DOMETHOD2)(HANDLE hControl, DWORD actionCode1, DWORD actionCode2, DWORD actionCode3, DWORD actionCode4, LPSTR string1, DWORD* pDWORD, LPSTR* ppString2); // 5 DWORD ByVal, 1 String ByVal, 1 DWORD ByRef, 4 String ByRef typedef EXPORT32 DWORD EXPORT (FAR* MY_DOMETHOD3)(HANDLE hControl, DWORD actionCode1, DWORD actionCode2, DWORD actionCode3, DWORD actionCode4, DWORD actionCode5, DWORD actionCode6, LPSTR string1, DWORD* pDWORD, const char** ppString2, const char** ppString3, const char** ppString4, const char** ppString5); typedef EXPORT32 DWORD EXPORT (FAR* MY_GETPROPERTY)(HANDLE hControl, DWORD actionCode1, DWORD actionCode2, DWORD* pDWORD, char** ppString1); typedef EXPORT32 DWORD EXPORT (FAR* MY_SETPROPERTY)(HANDLE hControl, DWORD actionCode1, DWORD actionCode2, DWORD dwValue, char* pString1); typedef EXPORT32 DWORD EXPORT (FAR* MY_REPLACEOBJECT)(HANDLE hControl, LPSTR* ppObject, LPCTSTR lpszNewSource, DWORD length); typedef EXPORT32 DWORD EXPORT (FAR* MY_FREEOBJECT)(HANDLE hControl, LPSTR lpObject); typedef EXPORT32 DWORD EXPORT (FAR* MY_FREEALLOBJECTS)(HANDLE hControl); typedef EXPORT32 DWORD EXPORT (FAR* MY_GETOBJECTLENGTH)(HANDLE hControl, LPSTR lpObject); typedef EXPORT32 DWORD EXPORT (FAR* MY_SETEVENTHANDLERADDRESS)(HANDLE hControl, DWORD dispatchID, void* pEventHandler); typedef EXPORT32 void* EXPORT (FAR* MY_GETEVENTHANDLERADDRESS)(HANDLE hControl, DWORD dispatchID); ///////////////////////////////////////////////////////////////////////////// // // Event handlers: prototypes for incoming function calls (from the DLL to the application) // // Implement any event handlers required by your application by using the declarations // below, then use the SetEventHandlerAddress function at runtime to notify the // control of the address of your event handlers. e.g: // // m_WebsterPro.SetEventHandlerAddress(eventidBeforeNavigate, ::gfEventBeforeNavigate); // // // __declspec(dllexport) DWORD gfEventBeforeNavigate(HANDLE hControl, LPSTR* plpszHyperlinkUrl, DWORD dwNavFlags, DWORD dwContextHandle, LPSTR* plpszTargetName, LPSTR* plpszTextToPost, LPSTR* plpszExtraHeaders, DWORD* pdwContainerCancel); __declspec(dllexport) DWORD gfEventDoGetImage(HANDLE hControl, LPSTR* plpszURL, DWORD* pdwContainerCancel); __declspec(dllexport) DWORD gfEventFocusPageChange(HANDLE hControl, LPSTR* plpszURL, DWORD dwObjectHandle); __declspec(dllexport) DWORD gfEventHyperlinkTransition(HANDLE hControl, LPSTR* plpszURL, DWORD dwIsOverLink); __declspec(dllexport) DWORD gfEventKeyDown(HANDLE hControl, DWORD* pdwKeyCode, DWORD dwShift); __declspec(dllexport) DWORD gfEventKeyUp(HANDLE hControl, DWORD* pdwKeyCode, DWORD dwShift); __declspec(dllexport) DWORD gfEventLayoutComputed(HANDLE hControl, LPSTR* plpszURL, DWORD dwObjectHandle, DWORD dwPartial); __declspec(dllexport) DWORD gfEventMouseDown(HANDLE hControl, DWORD dwButton, DWORD dwShift, DWORD dwXpixel, DWORD dwYpixel); __declspec(dllexport) DWORD gfEventMouseMove(HANDLE hControl, DWORD dwButton, DWORD dwShift, DWORD dwXpixel, DWORD dwYpixel); __declspec(dllexport) DWORD gfEventMouseUp(HANDLE hControl, DWORD dwButton, DWORD dwShift, DWORD dwXpixel, DWORD dwYpixel); __declspec(dllexport) DWORD gfEventObjectStatusChange(HANDLE hControl, LPSTR* plpszURL, DWORD dwStatus); __declspec(dllexport) DWORD gfEventPageShowing(HANDLE hControl, LPSTR* plpszURL, DWORD dwIsStatusPage); __declspec(dllexport) DWORD gfEventPageStatusChange(HANDLE hControl, LPSTR* plpszURL, DWORD dwStatus); __declspec(dllexport) DWORD gfEventTextSelectionChange(HANDLE hControl, DWORD dwState, DWORD dwStartOffset, DWORD dwLength); #ifdef __cplusplus }; #endif // __cplusplus #ifdef __cplusplus #if !defined(COLORREF) typedef DWORD COLORREF; #endif // NOT COLORREF // ///////////////////////////////////////////////////////////////////////////// // // C++ Interface Class to the Webster Pro DLL // Create an instance of this class for each Webster Pro Control window // required. // // Call the static LoadLibrary function once at the start of you // application and call FreeLibrary once at app termination time. // // Each simple control property has a Get and Set function. The value // of the property named BevelStyleInner, for example, is retrieved // by calling the GetBevelStyleInner function and is set by calling // the SetBevelStyleInner function. // // Property Get funtions and methods that return numeric or other // DWORD types return by value. // // Property Get functions and methods that return strings both return // pointers to a string "object", which is a string allocated by // the control. To avoid excessive memory utilizion, the caller (you) // must release each such object when done with it with a FreeObject // call. Alternatively, call FreeAllObjects to free all outstanding // objects. // // You can find the length of the string in a string object by calling // the GetObjectLength function. GetObjectLength returns the length // of the string itself, not counting the NULL terminator. // class CWebsterProWrapper { public: CWebsterProWrapper() {m_hWebsterWnd = NULL;}; ~CWebsterProWrapper() {if (m_hWebsterWnd) Destroy();}; public: // Call once at application start to load the DLL static BOOL LoadLibrary(LPCTSTR lpszDllName); // Call once at app termnination to release the DLL static BOOL FreeLibrary() { static BOOL status = FALSE; if (m_hWebsterDll) { status = ::FreeLibrary(m_hWebsterDll); m_hWebsterDll = NULL; } // No lib loaded: return status; }; // Replace a string with another string: DWORD ReplaceObject(LPSTR* ppObject, LPCTSTR lpszNewSource, DWORD length) { return m_pReplaceObject(m_hWebsterWnd, ppObject, lpszNewSource, length); }; // The actual length of data for an object (if string, does not include the // NULL terminator) DWORD GetObjectLength(LPSTR lpObject) {return m_pGetObjectLength(m_hWebsterWnd, lpObject);}; // Every (string) object returned by a property or method must be released by the // caller (you) with this function or with the next one: DWORD FreeObject(LPSTR lpObject) {return m_pFreeObject(m_hWebsterWnd, lpObject);}; // // This function releases all outstanding objects and may be called in // place of multiple FreeObject calls. DWORD FreeAllObjects() {return m_pFreeAllObjects(m_hWebsterWnd);}; // Set the address of an event handler. To fire the indicated event, // the DLL will call a function in your application. This function // is the event handler and must have a signature (sequence of // arguments) that matches the gfEvent...() function corrsponding // to dispatchID. The gfEvent...() functions are defined elsewhere // in this document. DWORD SetEventHandlerAddress(DWORD dispatchID, void* pEventHandler) { return m_pSetEventHandlerAddress(m_hWebsterWnd, dispatchID, pEventHandler); }; // Get the current address of an event handler void* GetEventHandlerAddress(DWORD dispatchID) { return m_pGetEventHandlerAddress(m_hWebsterWnd, dispatchID); }; // Is the Webster Pro Control DLL loaded? static BOOL isLoaded() {return m_hWebsterDll != NULL;}; // Create an instance of the control window, return FALSE on failure: BOOL Create(DWORD dwStyle, int left, int top, int width, int height, HWND pParent, DWORD dwCode); // Destroy this instance of the control window BOOL Destroy() {BOOL status = ::DestroyWindow(m_hWebsterWnd); m_hWebsterWnd = NULL; return status;}; BOOL isCreated() {return (this != NULL) && (m_hWebsterWnd != NULL);}; // Protected from NULL pointers HWND GetHwnd() {return m_hWebsterWnd;}; DWORD GetLastStatus() {return m_lastError;}; public: DWORD AboutBox() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidAboutBox, 0L, 0L, "", "", "", ""); return m_lastError; }; short GetBevelStyleInner() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidBevelStyleInner, 0L, &ret, NULL); return (short) ret; }; void SetBevelStyleInner(short newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidBevelStyleInner, 0L, (long) newVal, NULL); }; short GetBevelStyleOuter() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidBevelStyleOuter, 0L, &ret, NULL); return (short) ret; }; void SetBevelStyleOuter(short newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidBevelStyleOuter, 0L, (long) newVal, NULL); }; long GetBevelWidth() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidBevelWidth, 0L, &ret, NULL); return ret; }; void SetBevelWidth(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidBevelWidth, 0L, newVal, NULL); }; COLORREF GetBevelColorTop() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidBevelColorTop, 0L, &ret, NULL); return (COLORREF) ret; }; void SetBevelColorTop(COLORREF newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidBevelColorTop, 0L, newVal, NULL); }; COLORREF GetBevelColorLight() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidBevelColorLight, 0L, &ret, NULL); return (COLORREF) ret; }; void SetBevelColorLight(COLORREF newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidBevelColorLight, 0L, newVal, NULL); }; COLORREF GetBevelColorDark() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidBevelColorDark, 0L, &ret, NULL); return (COLORREF) ret; }; void SetBevelColorDark(COLORREF newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidBevelColorDark, 0L, newVal, NULL); }; COLORREF GetAnchorColor() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidAnchorColor, 0L, &ret, NULL); return (COLORREF) ret; }; void SetAnchorColor(COLORREF newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidAnchorColor, 0L, newVal, NULL); }; COLORREF GetVisitedColor() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidVisitedColor, 0L, &ret, NULL); return (COLORREF) ret; }; void SetVisitedColor(COLORREF newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidVisitedColor, 0L, newVal, NULL); }; COLORREF GetActiveColor() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidActiveColor, 0L, &ret, NULL); return (COLORREF) ret; }; void SetActiveColor(COLORREF newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidActiveColor, 0L, newVal, NULL); }; COLORREF GetHoverColor() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidHoverColor, 0L, &ret, NULL); return (COLORREF) ret; }; void SetHoverColor(COLORREF newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidHoverColor, 0L, newVal, NULL); }; short GetUrlWindowStyle() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidUrlWindowStyle, 0L, &ret, NULL); return (short) ret; }; void SetUrlWindowStyle(short newVal) { m_SetProperty(m_hWebsterWnd, dispidUrlWindowStyle, 0L, (long) newVal, NULL); }; short GetTitleWindowStyle() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidTitleWindowStyle, 0L, &ret, NULL); return (short) ret; }; void SetTitleWindowStyle(short newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidTitleWindowStyle, 0L, (long) newVal, NULL); }; char* GetPageURL() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidPageURL, 0L, NULL, &ret); return ret; }; void SetPageURL(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidPageURL, 0L, 0L, newVal); }; char* GetPageTitle() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidPageTitle, 0L, NULL, &ret); return ret; }; void SetPageTitle(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidPageTitle, 0L, 0L, newVal); }; char* GetHomePage() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidHomePage, 0L, NULL, &ret); return ret; }; void SetHomePage(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidHomePage, 0L, 0L, newVal); }; char* GetDownloadDir() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidDownloadDir, 0L, NULL, &ret); return ret; }; void SetDownloadDir(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidDownloadDir, 0L, 0L, newVal); }; long GetPagesToCache() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidPagesToCache, 0L, &ret, NULL); return ret; }; void SetPagesToCache(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidPagesToCache, 0L, newVal, NULL); }; BOOL GetIgnoreBaseInFile() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidIgnoreBaseInFile, 0L, &ret, NULL); return (BOOL) ret; }; void SetIgnoreBaseInFile(BOOL newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidIgnoreBaseInFile, 0L, newVal, NULL); }; long GetMaxSockets() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidMaxSockets, 0L, &ret, NULL); return ret; }; void SetMaxSockets(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidMaxSockets, 0L, newVal, NULL); }; long GetMaxPageLoads() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidMaxPageLoads, 0L, &ret, NULL); return ret; }; void SetMaxPageLoads(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidMaxPageLoads, 0L, newVal, NULL); }; long GetMarginHorizontal() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidMarginHorizontal, 0L, &ret, NULL); return ret; }; void SetMarginHorizontal(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidMarginHorizontal, 0L, newVal, NULL); }; long GetMarginVertical() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidMarginVertical, 0L, &ret, NULL); return ret; }; void SetMarginVertical(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidMarginVertical, 0L, newVal, NULL); }; BOOL GetLoadImages() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidLoadImages, 0L, &ret, NULL); return (BOOL) ret; }; void SetLoadImages(BOOL newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidLoadImages, 0L, newVal, NULL); }; BOOL GetShowReferer() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidShowReferer, 0L, &ret, NULL); return (BOOL) ret; }; void SetShowReferer(BOOL newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidShowReferer, 0L, newVal, NULL); }; char* GetAuthenticName() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidAuthenticName, 0L, NULL, &ret); return ret; }; void SetAuthenticName(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidAuthenticName, 0L, NULL, newVal); }; char* GetAuthenticPassword() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidAuthenticPassword, 0L, NULL, &ret); return ret; }; void SetAuthenticPassword(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidAuthenticPassword, 0L, NULL, newVal); }; char* GetFromName() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidFromName, 0L, NULL, &ret); return ret; }; void SetFromName(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidFromName, 0L, NULL, newVal); }; char* GetBrowserName() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidBrowserName, 0L, NULL, &ret); return ret; }; void SetBrowserName(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidBrowserName, 0L, 0, newVal); } long GetButtonMask() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidButtonMask, 0L, &ret, NULL); return ret; }; void SetButtonMask(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidButtonMask, 0L, newVal, NULL); }; char* GetProxyServerHTTP() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidProxyServerHTTP, 0L, NULL, &ret); return ret; }; void SetProxyServerHTTP(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidProxyServerHTTP, 0L, NULL, newVal); }; long GetProxyPortHTTP() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidProxyPortHTTP, 0L, &ret, NULL); return ret; }; void SetProxyPortHTTP(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidProxyPortHTTP, 0L, newVal, NULL); }; char* GetProxyServerUserNameHTTP() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidProxyServerUserNameHTTP, 0L, NULL, &ret); return ret; }; void SetProxyServerUserNameHTTP(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidProxyServerUserNameHTTP, 0L, NULL, newVal); }; char* GetProxyServerPasswordHTTP() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidProxyServerPasswordHTTP, 0L, NULL, &ret); return ret; }; void SetProxyServerPasswordHTTP(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidProxyServerPasswordHTTP, 0L, NULL, newVal); }; long GetImageCacheKB() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidImageCacheKB, 0L, &ret, NULL); return ret; }; void SetImageCacheKB(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidImageCacheKB, 0L, newVal, NULL); }; //// // The font properties take a dispid from the list elsewhere in this file (search for dispidFontHeading1). char* GetFontName(long dispidOfFont) { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidOfFont, FONTPROP_NAME, NULL, &ret); return ret; }; void SetFontName(long dispidOfFont, char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidOfFont, FONTPROP_NAME, NULL, newVal); }; long GetFontSize(long dispidOfFont) { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidOfFont, FONTPROP_SIZE, &ret, NULL); return ret; }; void SetFontSize(long dispidOfFont, long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidOfFont, FONTPROP_SIZE, newVal, NULL); }; long GetFontWeight(long dispidOfFont) { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidOfFont, FONTPROP_WEIGHT, &ret, NULL); return ret; }; void SetFontWeight(long dispidOfFont, long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidOfFont, FONTPROP_WEIGHT, newVal, NULL); }; long GetFontCharset(long dispidOfFont) { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidOfFont, FONTPROP_CHARSET, &ret, NULL); return ret; }; void SetFontCharset(long dispidOfFont, long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidOfFont, FONTPROP_CHARSET, newVal, NULL); }; BOOL GetFontItalic(long dispidOfFont) { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidOfFont, FONTPROP_ITALIC, &ret, NULL); return (BOOL) ret; }; void SetFontItalic(long dispidOfFont, BOOL newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidOfFont, FONTPROP_ITALIC, (DWORD) newVal, NULL); }; BOOL GetFontUnderline(long dispidOfFont) { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidOfFont, FONTPROP_UNDERLINE, &ret, NULL); return (BOOL) ret; }; void SetFontUnderline(long dispidOfFont, BOOL newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidOfFont, FONTPROP_UNDERLINE, (DWORD) newVal, NULL); }; BOOL GetFontStrikethrough(long dispidOfFont) { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidOfFont, FONTPROP_STRIKETHROUGH, &ret, NULL); return (BOOL) ret; }; void SetFontStrikethrough(long dispidOfFont, BOOL newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidOfFont, FONTPROP_STRIKETHROUGH, (DWORD) newVal, NULL); }; // //// short GetLoadStatus() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidLoadStatus, 0L, &ret, NULL); return (short) ret; } short SaveToDisk(char* FileName) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidSaveToDisk, 0, 0, FileName, NULL, NULL, NULL); return (short) m_lastError; }; short Cancel() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidCancel, 0, 0, NULL, NULL, NULL, NULL); return (short) m_lastError; }; long GetContentSize(char* URL) { DWORD ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetContentSize, 0, 0, 0, URL, &ret, NULL); return (long) ret; }; long GetContentSizeRead(char* URL) { DWORD ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetContentSizeRead, 0, 0, 0, URL, &ret, NULL); return (long) ret; }; char* GetContentType(char* URL) { char* ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetContentType, 0, 0, 0, URL, NULL, &ret); return ret; }; char* GetRedirectedURL(char* URL) { char* ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetRedirectedURL, 0, 0, 0, URL, NULL, &ret); return ret; }; short GetHiddenFlag(char* URL) { DWORD ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetHiddenFlag, 0, 0, 0, URL, &ret, NULL); return (short) ret; }; short SetHiddenFlag(char* URL, BOOL Hidden) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidGetHiddenFlag, Hidden, 0, NULL, NULL, NULL, NULL); return (short) m_lastError; }; short DismissPage(char* URL) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidDismissPage, 0, 0, NULL, NULL, NULL, NULL); return (short) m_lastError; }; long GetLinkCount(char* URL) { DWORD ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetLinkCount, 0, 0, 0, URL, &ret, NULL); return (long) ret; }; char* GetLinkURL(char* URL, long Index) { char* ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetLinkURL, Index, 0, 0, URL, NULL, &ret); return ret; }; char* GetContent(char* URL, long StartOffset, long Length) { char* ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetContent, StartOffset, Length, 0, URL, NULL, &ret); return ret; }; short GetStatus(char* URL) { DWORD ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetStatus, 0, 0, 0, URL, &ret, NULL); return (short) ret; }; char* GetTitle(char* URL) { char* ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetTitle, 0, 0, 0, URL, NULL, &ret); return ret; }; char* GetText(char* URL, long StartOffset, long Length) { char* ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetText, StartOffset, Length, 0, URL, NULL, &ret); return ret; }; short LoadPage(char* URL, short Hidden) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidLoadPage, Hidden, 0, NULL, NULL, NULL, NULL); return (short) m_lastError; }; long GetTextSize(char* URL) { DWORD ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetTextSize, 0, 0, 0, URL, &ret, NULL); return (long) ret; }; void GoHome() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidGoHome, 0, 0, NULL, NULL, NULL, NULL); }; void ShowHistory() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidShowHistory, 0, 0, NULL, NULL, NULL, NULL); }; void ShowStatus() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidShowStatus, 0, 0, NULL, NULL, NULL, NULL); }; void PageBack() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidPageBack, 0, 0, NULL, NULL, NULL, NULL); }; void PageForth() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidPageForth, 0, 0, NULL, NULL, NULL, NULL); }; void Reload() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidReload, 0, 0, NULL, NULL, NULL, NULL); }; void ShowDir() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidShowDir, 0, 0, NULL, NULL, NULL, NULL); }; short ShowOpenFileDialog(char* DefaultFile) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidShowOpenFileDialog, 0, 0, DefaultFile, NULL, NULL, NULL); return (short) m_lastError; }; short ShowURLDialog(char* DefaultURL) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidShowURLDialog, 0, 0, DefaultURL, NULL, NULL, NULL); return (short) m_lastError; }; COLORREF GetBackColor() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidBackColor, 0L, &ret, NULL); return ret; }; void SetBackColor(COLORREF newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidBackColor, 0L, newVal, NULL); }; COLORREF GetForeColor() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidForeColor, 0L, &ret, NULL); return ret; }; void SetForeColor(COLORREF newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidForeColor, 0L, newVal, NULL); }; long Paginate(long hDC, long lPageLeft, long lPageTop, long lPageRight, long lPageBottom, long plTotalPages) { Paginate2((HANDLE ) hDC, lPageLeft, lPageTop, lPageRight, lPageBottom, (long*) plTotalPages); }; long Paginate2(HANDLE hDC, long lPageLeft, long lPageTop, long lPageRight, long lPageBottom, long* plTotalPages) { DWORD ret; m_lastError = m_pDoMethod3(m_hWebsterWnd, dispidPaginate2, (DWORD) hDC, lPageLeft, lPageTop, lPageRight, lPageBottom, NULL, &ret, NULL, NULL, NULL, NULL); return ret; }; long PrintToDC(long hDC, long lPageNum, BOOL bPreview) { DWORD ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidPrintToDC, hDC, lPageNum, bPreview, NULL, &ret, NULL); return ret; }; void EndPrint() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidEndPrint, 0, 0, NULL, NULL, NULL, NULL); }; DWORD DoPrint(BOOL bShowPrinterDialog, long fromPage, long toPage) { m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidDoPrint, bShowPrinterDialog, fromPage, toPage, NULL, NULL, NULL); return m_lastError; }; char* GetShortcutDir() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidShortcutDir, 0L, NULL, &ret); return ret; }; void SetShortcutDir(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidShortcutDir, 0L, NULL, newVal); }; char* GetHTTPHeader(char* URL) { char* ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetHTTPHeader, 0, 0, 0, URL, NULL, &ret); return ret; }; short AddToFavorites(char* URL, BOOL bShowSaveDialog) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidDoPrint, bShowSaveDialog, 0, URL, NULL, NULL, NULL); return (short) m_lastError; }; short ShowFavoritesDialog() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidShowFavoritesDialog, 0, 0, NULL, NULL, NULL, NULL); return (short) m_lastError; }; short LoadHeader(char* URL, short Hidden) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidLoadHeader, Hidden, 0, URL, NULL, NULL, NULL); return (short) m_lastError; }; short PostText(char* URL, char* TextToPost, short Hidden) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidLoadHeader, Hidden, 0, URL, TextToPost, NULL, NULL); return (short) m_lastError; }; long GetProxyExclusionsHTTPCount() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidProxyExclusionsHTTP, COLLECT_GetCount, &ret, NULL); return (long) ret; }; char* GetProxyExclusionsHTTPItem(long index) { DWORD dwIndex = index; char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidProxyExclusionsHTTP, COLLECT_GetItem, &dwIndex, &ret); return ret; }; void SetProxyExclusionsHTTPItem(long index, LPCTSTR lpszItem) { DWORD dwIndex = index; LPSTR lpszItemArg = (LPSTR) lpszItem; m_lastError = m_GetProperty(m_hWebsterWnd, dispidProxyExclusionsHTTP, COLLECT_SetItem, &dwIndex, &lpszItemArg); }; void AddProxyExclusionsHTTPItem(LPCTSTR lpszItem) { LPSTR lpszItemArg = (LPSTR) lpszItem; m_lastError = m_GetProperty(m_hWebsterWnd, dispidProxyExclusionsHTTP, COLLECT_Add, NULL, &lpszItemArg); }; long FindProxyExclusionsHTTPItem(LPCTSTR lpszItem) { DWORD dwIndex; LPSTR lpszItemArg = (LPSTR) lpszItem; m_lastError = m_GetProperty(m_hWebsterWnd, dispidProxyExclusionsHTTP, COLLECT_Find, &dwIndex, &lpszItemArg); return (long) dwIndex; }; void RemoveProxyExclusionsHTTPItem(long index) { DWORD dwIndex = index; m_lastError = m_GetProperty(m_hWebsterWnd, dispidProxyExclusionsHTTP, COLLECT_Remove, &dwIndex, NULL); }; void RemoveAllProxyExclusionsHTTPItems() { m_lastError = m_GetProperty(m_hWebsterWnd, dispidProxyExclusionsHTTP, COLLECT_Remove, NULL, NULL); }; short GetScrollbarStyleVertical() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidScrollbarStyleVertical, 0L, &ret, NULL); return (short) ret; }; void SetScrollbarStyleVertical(short newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidScrollbarStyleVertical, 0L, (long) newVal, NULL); }; short GetScrollbarStyleHorizontal() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidScrollbarStyleHorizontal, 0L, &ret, NULL); return (short) ret; }; void SetScrollbarStyleHorizontal(short newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidScrollbarStyleHorizontal, 0L, (long) newVal, NULL); }; long GetScrollPosVertical() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidScrollPosVertical, 0L, &ret, NULL); return ret; }; void SetScrollPosVertical(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidScrollPosVertical, 0L, newVal, NULL); }; long GetScrollPosHorizontal() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidScrollPosHorizontal, 0L, &ret, NULL); return ret; }; void SetScrollPosHorizontal(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidScrollPosHorizontal, 0L, newVal, NULL); }; long GetPageWidth() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidPageWidth, 0L, &ret, NULL); return ret; }; long GetPageHeight() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidPageHeight, 0L, &ret, NULL); return ret; }; long GetDisplayLeft() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidDisplayLeft, 0L, &ret, NULL); return ret; }; long GetDisplayTop() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidDisplayTop, 0L, &ret, NULL); return ret; }; long GetDisplayWidth() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidDisplayWidth, 0L, &ret, NULL); return ret; }; long GetDisplayHeight() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidDisplayHeight, 0L, &ret, NULL); return ret; }; BOOL GetReloadIncludesObjects() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidReloadIncludesObjects, 0L, &ret, NULL); return (BOOL) ret; }; void SetReloadIncludesObjects(BOOL newVal) { m_SetProperty(m_hWebsterWnd, dispidReloadIncludesObjects, 0L, (long) newVal, NULL); }; BOOL GetKeepForwardHistory() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidKeepForwardHistory, 0L, &ret, NULL); return (BOOL) ret; }; void SetKeepForwardHistory(BOOL newVal) { m_SetProperty(m_hWebsterWnd, dispidKeepForwardHistory, 0L, (long) newVal, NULL); }; BOOL GetPaletteForceBackground() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidPaletteForceBackground, 0L, &ret, NULL); return ret; }; void SetPaletteForceBackground(BOOL newVal) { m_SetProperty(m_hWebsterWnd, dispidPaletteForceBackground, 0L, (long) newVal, NULL); }; long GetCachedPagesCount() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidCachedPages, COLLECT_GetCount, &ret, NULL); return (long) ret; }; char* GetCachedPagesItem(long index) { DWORD dwIndex = index; char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidCachedPages, COLLECT_GetItem, &dwIndex, &ret); return ret; }; long GetHistoryPagesCount() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidHistoryPages, COLLECT_GetCount, &ret, NULL); return (long) ret; }; char* GetHistoryPagesItem(long index) { DWORD dwIndex = index; char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidHistoryPages, COLLECT_GetItem, &dwIndex, &ret); return ret; }; long GetEmbeddedObjectURLsCount() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidEmbeddedObjectURLs, COLLECT_GetCount, &ret, NULL); return (long) ret; }; char* GetEmbeddedObjectURLsItem(long index) { DWORD dwIndex = index; char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidEmbeddedObjectURLs, COLLECT_GetItem, &dwIndex, &ret); return ret; }; long GetObjectAtXY(long x, long y, LPCTSTR* ppObjectURL, LPCTSTR* ppHyperlinkURL, long* plPureTextOffset) { // Here the return value is always a bitmask, a return < 0 indicates error: m_lastError = m_pDoMethod3(m_hWebsterWnd, dispidGetObjectAtXY, x, y, 0, 0, 0, NULL, (DWORD*) plPureTextOffset, ppObjectURL, ppHyperlinkURL, NULL, NULL); return m_lastError; }; char* GetCookiesDir() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidCookiesDir, 0L, NULL, &ret); return ret; }; void SetCookiesDir(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidCookiesDir, 0L, NULL, newVal); }; DWORD Refresh() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidRefresh, 0L, 0L, "", "", "", ""); return m_lastError; }; short GetCookieControl() { DWORD ret; m_GetProperty(m_hWebsterWnd, dispidCookieControl, 0L, &ret, NULL); return (short) ret; }; void SetCookieControl(short newVal) { m_SetProperty(m_hWebsterWnd, dispidCookieControl, 0L, (long) newVal, NULL); }; long FindString(BOOL bShowDialog, char* lpszFindString, BOOL matchCase, BOOL directionMode) { DWORD ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidFindString, bShowDialog, matchCase, directionMode, lpszFindString, &ret, NULL); return (long) ret; } DWORD SelectText(long StartOffset, long Length) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidSelectText, StartOffset, Length, "", "", "", ""); return m_lastError; }; DWORD SelectAllText() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidSelectAllText, 0L, 0L, "", "", "", ""); return m_lastError; }; DWORD CopySelectedText() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidCopySelectedText, 0L, 0L, "", "", "", ""); return m_lastError; }; DWORD ClearTextSelection() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidClearTextSelection, 0L, 0L, "", "", "", ""); return m_lastError; }; DWORD ScrollToSelectedText() { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidScrollToSelectedText, 0L, 0L, "", "", "", ""); return m_lastError; }; short GetSelectionState() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidSelectionState, 0L, &ret, NULL); return (short) ret; }; long GetSelectionStartOffset() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidSelectionStartOffset, 0L, &ret, NULL); return (long) ret; }; long GetSelectionLength() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidSelectionLength, 0L, &ret, NULL); return ret; }; DWORD SaveObjectToFile(char* URL, char* FileName, BOOL bShowSaveDialog) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidSaveObjectToFile, (long) bShowSaveDialog, 0L, URL, FileName, "", ""); return m_lastError; }; long GetFrameURLsCount() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidGetFrameURLs, COLLECT_GetCount, &ret, NULL); return (long) ret; }; char* GetFrameURLsItem(long index) { DWORD dwIndex = index; char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidGetFrameURLs, COLLECT_GetItem, &dwIndex, &ret); return ret; }; BOOL GetNoFrames() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidNoFrames, 0L, &ret, NULL); return (BOOL) ret; }; void SetNoFrames(BOOL newVal) { m_SetProperty(m_hWebsterWnd, dispidNoFrames, 0L, (long) newVal, NULL); }; ObjectHandle GetSingleObjectHandle(char* URL) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidGetSingleObjectHandle, 0, 0L, URL, "", "", ""); return (ObjectHandle) m_lastError; }; char* GetURLByObjectHandle(ObjectHandle hObject) { char* ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetURLByObjectHandle, hObject, 0, 0, NULL, NULL, &ret); return ret; }; HANDLE GetObjecthWnd(char* URL) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidGetObjecthWnd, 0, 0L, URL, "", "", ""); return (HANDLE) m_lastError; }; HANDLE GethWndByObjectHandle(ObjectHandle hObject) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidGethWndByObjectHandle, hObject, 0L, "", "", "", ""); return (HANDLE) m_lastError; }; long GetFrameObjectHandlesCount() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidGetFrameObjectHandles, COLLECT_GetCount, &ret, NULL); return (long) ret; }; long GetFrameObjectHandlesItem(long index) { // Used for both in param and out param! DWORD dwIndex = index; m_lastError = m_GetProperty(m_hWebsterWnd, dispidGetFrameObjectHandles, COLLECT_GetItem, &dwIndex, NULL); return dwIndex; }; ObjectHandle GetPageObjectHandle() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidPageObjectHandle, 0L, &ret, NULL); return (ObjectHandle) ret; }; void SetPageObjectHandle(ObjectHandle newVal) { m_SetProperty(m_hWebsterWnd, dispidPageObjectHandle, 0L, (long) newVal, NULL); }; ObjectHandle GetFocusPageObjectHandle() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidFocusPageObjectHandle, 0L, &ret, NULL); return (ObjectHandle) ret; }; void SetFocusPageObjectHandle(ObjectHandle newVal) { m_SetProperty(m_hWebsterWnd, dispidFocusPageObjectHandle, 0L, (long) newVal, NULL); }; DWORD Navigate(char* URL, long NavFlags, ObjectHandle nHandle, char* TargetName, char* TextToPost, char* ExtraHeaders) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidNavigate, NavFlags, nHandle, (LPTSTR) (LPCTSTR) URL, (LPTSTR) (LPCTSTR) TargetName, (LPTSTR) (LPCTSTR) TextToPost, (LPTSTR) (LPCTSTR) ExtraHeaders); return m_lastError; }; long GetButtonEnabledMask() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidButtonEnabledMask, 0L, &ret, NULL); return ret; }; short GetMenuControl() { DWORD ret; m_GetProperty(m_hWebsterWnd, dispidMenuControl, 0L, &ret, NULL); return (short) ret; }; void SetMenuControl(short newVal) { m_SetProperty(m_hWebsterWnd, dispidMenuControl, 0L, (long) newVal, NULL); }; AnimationControls GetAnimationControl() { DWORD ret; m_GetProperty(m_hWebsterWnd, dispidAnimationControl, 0L, &ret, NULL); return (AnimationControls) ret; }; void SetAnimationControl(AnimationControls newVal) { m_SetProperty(m_hWebsterWnd, dispidAnimationControl, 0L, (long) newVal, NULL); }; LayoutControls GetLayoutControl() { DWORD ret; m_GetProperty(m_hWebsterWnd, dispidLayoutControl, 0L, &ret, NULL); return (LayoutControls) ret; }; void SetLayoutControl(LayoutControls newVal) { m_SetProperty(m_hWebsterWnd, dispidLayoutControl, 0L, (long) newVal, NULL); }; HANDLE GetPaletteHandle() { DWORD ret; m_GetProperty(m_hWebsterWnd, dispidPaletteHandle, 0L, &ret, NULL); return (HANDLE) ret; }; void SetPaletteHandle(HANDLE newVal) { m_SetProperty(m_hWebsterWnd, dispidPaletteHandle, 0L, (long) newVal, NULL); }; short GetPrintBackgroundColors() { DWORD ret; m_GetProperty(m_hWebsterWnd, dispidPrintBackgroundColors, 0L, &ret, NULL); return (short) ret; }; void SetPrintBackgroundColors(short newVal) { m_SetProperty(m_hWebsterWnd, dispidPrintBackgroundColors, 0L, (long) newVal, NULL); }; short GetToolTipStyle() { DWORD ret; m_GetProperty(m_hWebsterWnd, dispidToolTipStyle, 0L, &ret, NULL); return (short) ret; }; void SetToolTipStyle(short newVal) { m_SetProperty(m_hWebsterWnd, dispidToolTipStyle, 0L, (long) newVal, NULL); }; HANDLE GetCursorHandle() { DWORD ret; m_GetProperty(m_hWebsterWnd, dispidCursorHandle, 0L, &ret, NULL); return (HANDLE) ret; }; void SetCursorHandle(HANDLE newVal) { m_SetProperty(m_hWebsterWnd, dispidCursorHandle, 0L, (long) newVal, NULL); }; long GetPrintPageBreakForImages() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidPrintPageBreakForImages, 0L, &ret, NULL); return ret; }; void SetPrintPageBreakForImages(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidPrintPageBreakForImages, 0L, newVal, NULL); }; long GetPrintPageBreakForTables() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidPrintPageBreakForTables, 0L, &ret, NULL); return ret; }; void SetPrintPageBreakForTables(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidPrintPageBreakForTables, 0L, newVal, NULL); }; short GetTextCopyMode() { DWORD ret; m_GetProperty(m_hWebsterWnd, dispidTextCopyMode, 0L, &ret, NULL); return (short) ret; }; void SetTextCopyMode(short newVal) { m_SetProperty(m_hWebsterWnd, dispidTextCopyMode, 0L, (long) newVal, NULL); }; short GetStatusDisplay() { DWORD ret; m_GetProperty(m_hWebsterWnd, dispidStatusDisplay, 0L, &ret, NULL); return (short) ret; }; void SetStatusDisplay(short newVal) { m_SetProperty(m_hWebsterWnd, dispidStatusDisplay, 0L, (long) newVal, NULL); }; long GetSocketTimeout() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidSocketTimeout, 0L, &ret, NULL); return ret; }; void SetSocketTimeout(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidSocketTimeout, 0L, newVal, NULL); }; short GetlfClipPrecision() { DWORD ret; m_GetProperty(m_hWebsterWnd, dispidlfClipPrecision, 0L, &ret, NULL); return (short) ret; }; void SetlfClipPrecision(short newVal) { m_SetProperty(m_hWebsterWnd, dispidlfClipPrecision, 0L, (long) newVal, NULL); }; long GetMaxPostTextInKey() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidMaxPostTextInKey, 0L, &ret, NULL); return ret; }; void SetMaxPostTextInKey(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidMaxPostTextInKey, 0L, newVal, NULL); }; long GetVerticalPosInLayout(ObjectHandle nHandle, long OffsetInPureText) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidGetVerticalPosInLayout, nHandle, OffsetInPureText, NULL, NULL, NULL, NULL); return m_lastError; }; long GetHorizontalPosInLayout(ObjectHandle nHandle, long OffsetInPureText) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidGetHorizontalPosInLayout, nHandle, OffsetInPureText, NULL, NULL, NULL, NULL); return m_lastError; }; long GetEventEnableMask() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidEventEnableMask, 0L, &ret, NULL); return ret; }; void SetEventEnableMask(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidEventEnableMask, 0L, newVal, NULL); }; long GetFormCount(ObjectHandle nHandle) { m_lastError = m_pDoMethod(m_hWebsterWnd, dispidGetFormCount, nHandle, 0L, NULL, NULL, NULL, NULL); return m_lastError; }; char* GetFormString(ObjectHandle hObject, long FormIndex, LPTSTR SubmitName) { char* ret; m_lastError = m_pDoMethod2(m_hWebsterWnd, dispidGetFormString, hObject, FormIndex, 0, SubmitName, NULL, &ret); return ret; }; char* GetPrintFooter() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidPrintFooter, 0L, NULL, &ret); return ret; }; void SetPrintFooter(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidPrintFooter, 0L, NULL, newVal); }; char* GetPrintHeader() { char* ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidPrintHeader, 0L, NULL, &ret); return ret; }; void SetPrintHeader(char* newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidPrintHeader, 0L, NULL, newVal); }; long GetImageZoomFactor() { DWORD ret; m_lastError = m_GetProperty(m_hWebsterWnd, dispidImageZoomFactor, 0L, &ret, NULL); return ret; }; void SetImageZoomFactor(long newVal) { m_lastError = m_SetProperty(m_hWebsterWnd, dispidImageZoomFactor, 0L, newVal, NULL); }; protected: static HINSTANCE m_hWebsterDll; static MY_CREATE m_pCreate; static MY_DOMETHOD m_pDoMethod; static MY_DOMETHOD2 m_pDoMethod2; static MY_DOMETHOD3 m_pDoMethod3; static MY_GETPROPERTY m_GetProperty; static MY_SETPROPERTY m_SetProperty; static MY_REPLACEOBJECT m_pReplaceObject; static MY_GETOBJECTLENGTH m_pGetObjectLength; static MY_FREEOBJECT m_pFreeObject; static MY_FREEALLOBJECTS m_pFreeAllObjects; static MY_SETEVENTHANDLERADDRESS m_pSetEventHandlerAddress; static MY_GETEVENTHANDLERADDRESS m_pGetEventHandlerAddress; HWND m_hWebsterWnd; DWORD m_lastError; }; #endif // __cplusplus #endif // NOT __WEBSTERDLLWRAP_H__