troubleshooting Question

IE Browser in Second Thread Grabs Keyboard Focus

Avatar of dbtoth
dbtoth asked on
.NET ProgrammingC#
11 Comments1 Solution863 ViewsLast Modified:
After resolving an issue getting a form with an IEBrowser control to successfully run on a second thread I am fighting a problem with updates to that window grabbing active window, mouse and keyboard focus.

Basically, the intent was to load a Powerpoint PPS file on a second display window and whenever the window isn't needed for displaying valuable information to let the PPS file spew advertising in the clients direction.

The problem I've got is that the form running in that second thread grabs active window, keyboard and mouse focus everytime a slide transitions. The problem is system wide, it doesn't matter what other application you are running, the IEBrowser control update always grabs focus.

I have a suspicion this is related to my original problem. When the window on the new thread was invoked with MySecondScreen.Show() the window immediately opened, then closed, then the thread terminated. I resolved that by calling .ShowDialog() instead. This made the window on that thread system modal and I suspect this is the reason for my issue...

So the solution as I see it is to either (a) figure out how to keep the window open on the new thread without making the window modal, or (b) prevent that window from pulling focus from everything else on update.

Anyone got any ideas?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 11 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros