Page 1 of 1

wxIEHtmlWin (IWebBrowser2) steals focus

Posted: Tue Aug 02, 2011 11:25 am
by thile
I have an application where I can browse different items in a list.
Upon an item is selected, I display information about it in a embedded browser window, beside the list.

Behind the scene I generate some html from the item data and pass it to the embedded IE control.

I use the wxActiveX (wxIEHtmlWin) project to embed IE into the application.

The user will use the arrow keys to navigate though the items. Fast and easy.

Now to the problem, the embedded browser steals the focus, each time new html content is passed to it. User must then use mouse/keyboard to give the item list focus again, to be able to show next item.

Others have experienced this and the suggested solution is to use the IProtectFocus interface. ... 85%29.aspx

I’m just totally lost how to get further. Everything in the wxactivex project is like a blackbox to me.
I have spent hours searching for examples, documentation trying to understand this lowlevel ActiveX/OLE code.

Where/how can I find information to how to implement IProtectFocus, and how do I pass it along to the control?

Re: wxIEHtmlWin (IWebBrowser2) steals focus

Posted: Tue Aug 02, 2011 12:31 pm
by Auria
I don't have a direct answer, but... maybe you can take a look at the wxWebView branch in wxWidgets SVN, it features a new component (also based on IE on Windows) and maybe it's easier to follow than wxActiveX (and if you can reproduce the focus issue there, you can maybe suggest to the student coding in this branch to implement the interface ;) )

Re: wxIEHtmlWin (IWebBrowser2) steals focus

Posted: Sun Nov 17, 2019 9:24 pm
by saifcoder
this topic was created on 2011, now 2019 and still have the same problem !!

Re: wxIEHtmlWin (IWebBrowser2) steals focus

Posted: Mon Nov 18, 2019 3:50 pm
This topic was created during the GSoC when the wxWebView was implemented.
If you can follow AQuria suggestion and implement the missing piece - it would be great. And if you can submit it as a patch/PR - it would be even better.

Thank you.