torsten's .NET blog In the end, everything is a gag [Ch. Chaplin]
# Sunday, May 18, 2008
WebBrowser control hosting and build-in zoom: how to get it work again

You may have noticed the zoom keyboard shortcuts (CTRL+mouse wheel forward/back, CTRL+PLUS SIGN, and CTRL+MINUS SIGN) are not enabled by default when hosting the WebBrowser control if you have installed IE7, while it does without any problem with older IE versions. This was now an issue for a long time in RSS Bandit, that we couldn't fix. Yesterday I did a research again and found this page: MSDN about IZoomEvents. We already implemented the font size change using a menu (see KB 304103) but it offers not the same usability that you have with older IE x and loose if you switch from IEx to IE7 and run RSS Bandit. Now it works again like a charm and for your convenience I repeat the important part you have to apply in your own IE hosting code:

"To enable this behavior, call IWebBrowser2::ExecWB with OLECMDID_OPTICAL_ZOOM, passing 100 in pvaIn. Once set, the keyboard shortcuts remain available as long as the host navigates to HTML content because the same instance of MSHTML is used. However, if the host navigates to Active documents, such as XML or Portable Document Format (PDF) files, optical zoom is disabled and will need to be enabled again."

What the docs are not mention: you should call this at a time the hosted control is visible and fully initialized, or you will get wired COM exceptions...

Technorati tags:  |  |  | 
Sunday, May 18, 2008 12:50:20 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [2]  | 
Navigation

Like RSS Bandit? Make a donation to help support its development and maintenance. As little as 1€ will help.

Make payments with PayPal - it's fast, free and secure!
On this page....
<May 2008>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

SUBSCRIBE RSS GeoURL e-mail

Search
Categories
Blogroll
[Feed] Dare Obasanjo
Dare Obasanjo aka Carnage4Life
[Feed] Clemens Vasters
[Feed] Omar Shahine
[Feed] Tom Mertens

newtelligence dasBlog 2.1.8102.813

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

WOT Notar

Join WebHost4Life.com