Re: How to disable the right click menu on a web browser control?

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 04/22/04


Date: Thu, 22 Apr 2004 13:11:20 -0400


"saripalli" <anonymous@discussions.microsoft.com> wrote in message
news:C2A38126-DA56-41CB-ABCF-D3B01B7BFAEB@microsoft.com
> Can you look at the thread "Controlling keyboard input to
> browser control". Actually that's what I want to do. I don't
> Iwebbrowser2 control to refresh itself when F5 is pressed. When I was
> looking at an aswer for this I came to know about IDOCHostUIHandler,
> the drill example and translateaccelerators.

The easiest way is to intercept the keystroke right at the message pump,
before it even reaches the browser. In MFC, you do it by overriding
PreTranslateMessage and returning FALSE for corresponding WM_KEYDOWN
message.

-- 
With best wishes,
    Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken