wxIEHtmlWin (IWebBrowser2) steals focus

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
thile
Knows some wx things
Knows some wx things
Posts: 26
Joined: Sat Oct 25, 2008 3:46 pm

wxIEHtmlWin (IWebBrowser2) steals focus

Post 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.
http://msdn.microsoft.com/en-us/library ... 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?
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Re: wxIEHtmlWin (IWebBrowser2) steals focus

Post 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 ;) )
"Keyboard not detected. Press F1 to continue"
-- Windows
User avatar
saifcoder
Experienced Solver
Experienced Solver
Posts: 80
Joined: Thu Nov 16, 2017 9:32 pm

Re: wxIEHtmlWin (IWebBrowser2) steals focus

Post by saifcoder »

this topic was created on 2011, now 2019 and still have the same problem !!
Debian 9 - GCC 6 - wxWidgets 3.x U
Win 10 - GCC 8 - wxWidgets 3.x U
Mac OS X 10.x - Clang - wxWidgets 3.x U
i am in love with WX. Yes.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxIEHtmlWin (IWebBrowser2) steals focus

Post by ONEEYEMAN »

Hi,
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.
Post Reply