Link to home
Start Free TrialLog in
Avatar of alex123
alex123

asked on

Forwarding events to embedded control

Hi

I am trying to embed Internet Explorer into my application. Being not too familiar with windows programming I am using an example obtained from the web that demonstrates how it is done. Everything is working well except for the fact that I am unable to extend the example. For instance I would like Internet Explorer to be able to receive keyboard events, so that for example F5 will cause Internet Explorer to refresh its page. I am attaching the code of the example obtained from the web.

The answer that will earn full points needs to describe how to forward F5 event to the browser.

This question is also related to https://www.experts-exchange.com/questions/23135017/Forwarding-events-to-embedded-Internet-Explorer-COM-control.html?anchorAnswerId=20821785#a20821785 which has not yet been answered.

Thank you!
basewnd.cpp.txt
basewnd.h.txt
webhost.cpp.txt
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alex123
alex123

ASKER

jkl thank you for replying.

Actually for some reason F5 is not handeled by the WindowProc in this example. I've added print statements and nothing happens on F5, I see mouse events, resize events but not keyboard events.

While I do see sizing events this does not help me, when I try to change internet explorer size to match new window size nothing happens.

If you have any idea what is the cause of this problems please share it :)
As a first step, I suggest that you use the utility program named Spy++ to identify which window is getting the F5 keystroke.

=-=-=-=-=-=-=-=-=
I see that you have tried two different methods to embed the browser control.  There is a third method that is easiest of all:  Just use MFC and create a dialog-based program and use the Resource Editor to add a WebBrowser ActiveX control to the dialog.  That is an excellent way to experiment with the control.  Yes, MFC does a lot of the behind-the-scenes work (and perhaps you don't want those details to be hidden from your program) but it *is* possible to break-point and trace into the MFC code as you explore the workings and learn the basics.
i feel jkr is correct, IE does not provide you complete message forwarding capability. you need to make an object of webbrowser2 and then handle each of the events manually.

James
Avatar of alex123

ASKER

Thank you to all who answered. I will try the suggestions soon and report the result. Btw I do not agree with the point reduction, at the time of accepting the answer I intend to increase the points back to the original level. While the two questions that I've asked have similarities they have different attached code and ask for help in handling different events.