Click here to Skip to main content
13,089,943 members (48,240 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi codeproject community,

normally I never bother an internet forum with my problems but I am kind of desperated right now.
So here's the issue:

I have an MFC application with an webbrowser control in the gui contained. For this purpose I created a new class deriving from the necessary com interfaces to cope with all requirements. By now it more or less works pretty good, the only problem I'm still encountering is that I can't zoom or rather alter the font size inside the html control.

As usually I looked up the msdn documentation and came up with this code snippet (which ought to work according to the general consensus on the internet):

VARIANT vFontSize;
VariantInit (&vFontSize);
V_VT(&vFontSize) = VT_I4;
V_I4(&vFontSize) = 4;   //arbitrary picked zoom value out of a possible range from 0 to 4

But no matter what I try, there's not any change of the displayed html content.

Anyone got an idea?
Posted 12-Apr-13 3:25am
Updated 12-Apr-13 3:39am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

If anybody is interested, here's what I did to solve this:

Since the method to do it by calling the ExecWB function with the respective arguments still not want to work, I did a somewhat ugly work around.

On the OnDocumentComplete event, I simply call a Javascript function which does the zoom for me. This manual was of very big help for me. Thanks again Mr. Khodakovsky.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 15 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100