The information in this article applies to:
SUMMARYIEZoom.exe demonstrates how to change the font size of the text displayed in a Web Browser control embedded in an MFC container application. MORE INFORMATIONThe following file is available for download from the Microsoft
Download Center. Click the file name below to download the file: Iezoom.exeFor more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address http://www.microsoft.com/downloads/search.aspand then click How to use the Microsoft Download Center. Microsoft Internet Explorer (IE) obtains much of its functionality from COM objects implemented in Shdocvw.dll, Mshtml.dll, and Urlmon.dll. The IE application itself is a thin wrapper that aggregates the functionality of these components. Developers who wish to tap directly into the functionality of these underlying components are frequently interested in mimicking the functionality of IE. While many IE features are exposed through the Web Browser (SHDOCVW) control's automation model, other features available on the IE menus, including changing the font size of the text of the current page, are not exposed this way. This sample demonstrates how to use the IOleCommandTarget interface to change the font size of the text of the current page displayed by a WebBrowser control. The IOleCommandTarget interface consists of two methods, QueryStatus and Exec, in addition to the IUnknown methods. QueryStatus allows the client to determine if an object supports a particular command. If QueryStatus indicates that the specified command is enabled, the client can call Exec to execute or show Help for the command. The list of standard command identifiers is defined in the OLECMDID enumeration in the header file DOCOBJ.H. For more information on the IOleCommandTarget interface, see the Internet Client SDK online documentation. The sample is a Microsoft Foundation Classes (MFC) 4.2 SDI application that mimics the functionality of the Fonts pop-up under IE's View menu. Both the sample and IE provide the user with five scaling factors: largest, large, medium, small, smallest. While a page is displayed in medium by default, choosing any of the other options scales the text of the page up and down respectively. The following code taken from the sample shows how to accomplish this using the IOleCommandTarget interface:
Steps To Run
If you are connected to the Internet, the ActiveX page on www.microsoft.com will be displayed. If you do not have an Internet connection, modify the Navigate() call in CIezoomView::OnCreate() by passing a different URL. Additional query words: SCALE SCALING WEBBROWSER
Keywords : kbfile kbgraphic kbsample kbIE300 kbIE301 kbIE400 kbIE401 kbIE302 AXSDKWebBrowser |
Last Reviewed: January 18, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |