Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing font size for the IE activeX
Message
 
 
To
14/02/2003 09:01:07
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00753183
Message ID:
00753397
Views:
34
François,

The best place to get help is from msdn.microsoft.com you can search for webbrowser to get to a fair part of the documentation. This article describes how to do it:

http://msdn.microsoft.com/workshop/browser/webbrowser/webbrowser.asp?frame=true

near the bottom is a section Changing Fonts with the WebBrowser Control then click Show Example to see this:
LPDISPATCH pDisp = NULL;
LPOLECOMMANDTARGET pCmdTarg = NULL;

pDisp = m_pBrowser.get_Document();
ASSERT(pDisp);

pDisp->QueryInterface(IID_IOleCommandTarget, (LPVOID*)&pCmdTarg);
ASSERT(pCmdTarg);

VARIANT vaZoomFactor;   // input arguments
VariantInit(&vaZoomFactor);
V_VT(&vaZoomFactor) = VT_I4;
V_I4(&vaZoomFactor) = fontSize;

pCmdTarg->Exec(NULL,
		OLECMDID_ZOOM,
		OLECMDEXECOPT_DONTPROMPTUSER,
		&vaZoomFactor,
		NULL);
VariantClear(&vaZoomFactor);

if (pCmdTarg)
   pCmdTarg->Release(); // release document's command target
if (pDisp)
   pDisp->Release();    // release document's dispatch interface
well the C code isn't real easy to read but it ends up being equivalent to this one line of VFP code *g*
thisform.oIE.ExecWB( 19, 2, 2, null ) && 3rd arg values 1..5 inclusive
where do those numbers come from? well searching the VC++ .h files for OLECMDID_ZOOM finds them in docobj.h (I'm not sure if these .h files are online or not, but I have VC++ installed so that's where I look first)
typedef 
enum OLECMDEXECOPT
    {	OLECMDEXECOPT_DODEFAULT	= 0,
	OLECMDEXECOPT_PROMPTUSER	= 1,
	OLECMDEXECOPT_DONTPROMPTUSER	= 2,
	OLECMDEXECOPT_SHOWHELP	= 3
    }	OLECMDEXECOPT;

/* OLECMDID_STOPDOWNLOAD is supported for QueryStatus Only */
typedef 
enum OLECMDID
    {	OLECMDID_OPEN	= 1,
	OLECMDID_NEW	= 2,
	OLECMDID_SAVE	= 3,
	OLECMDID_SAVEAS	= 4,
	OLECMDID_SAVECOPYAS	= 5,
	OLECMDID_PRINT	= 6,
	OLECMDID_PRINTPREVIEW	= 7,
	OLECMDID_PAGESETUP	= 8,
	OLECMDID_SPELL	= 9,
	OLECMDID_PROPERTIES	= 10,
	OLECMDID_CUT	= 11,
	OLECMDID_COPY	= 12,
	OLECMDID_PASTE	= 13,
	OLECMDID_PASTESPECIAL	= 14,
	OLECMDID_UNDO	= 15,
	OLECMDID_REDO	= 16,
	OLECMDID_SELECTALL	= 17,
	OLECMDID_CLEARSELECTION	= 18,
	OLECMDID_ZOOM	= 19,
	OLECMDID_GETZOOMRANGE	= 20,
	OLECMDID_UPDATECOMMANDS	= 21,
	OLECMDID_REFRESH	= 22,
	OLECMDID_STOP	= 23,
	OLECMDID_HIDETOOLBARS	= 24,
	OLECMDID_SETPROGRESSMAX	= 25,
	OLECMDID_SETPROGRESSPOS	= 26,
	OLECMDID_SETPROGRESSTEXT	= 27,
	OLECMDID_SETTITLE	= 28,
	OLECMDID_SETDOWNLOADSTATE	= 29,
	OLECMDID_STOPDOWNLOAD	= 30,
	OLECMDID_ONTOOLBARACTIVATED	= 31,
	OLECMDID_FIND	= 32,
	OLECMDID_DELETE	= 33,
	OLECMDID_HTTPEQUIV	= 34,
	OLECMDID_HTTPEQUIV_DONE	= 35,
	OLECMDID_ENABLE_INTERACTION	= 36,
	OLECMDID_ONUNLOAD	= 37,
	OLECMDID_PROPERTYBAG2	= 38,
	OLECMDID_PREREFRESH	= 39
    }	OLECMDID;
Or if you want to be a bit cleaner in VFP
* docobj.h

#define OLECMDEXECOPT_DODEFAULT      0
#define OLECMDEXECOPT_PROMPTUSER     1
#define OLECMDEXECOPT_DONTPROMPTUSER 2
#define OLECMDEXECOPT_SHOWHELP       3

#define ...
#define OLECMDID_ZOOM 19
#define ...

* your form
#include docobj.h

thisform.oIE.ExecWB( OLECMDID_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, 2, null )
>I'am taming the IE activeX on vfp forms. A few documented quirks (the refresh method has to be NODEFAULTed, the beast is better fed with temp resources than with a string) but all in all it works acceptably fine.
>
>Any way to change the default browser font?
>
>I did not find a lot a resources on the way to push the activeX methods
>(apart from printing with and without page setup).
>
>Any useful resource on the integration with vfp or vb that would go beyond plain basic stuff?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform