PDA

View Full Version : Window focus problem



nhmabv
08-10-2012, 06:05 PM
I have a form that is set as "Allways on top"
It sits at the upper right corner on top of a IE full window page that is a web outlook application.
There are a number of other word documents that are behind the IE window.

What I am doing now:
Clicking a button on the form shells to a AutoIt executable that opens the highlighted e-mail. This works great.

What I what to do:
It takes a little time for the shelled .exe to load after clicking the button to open the e-mail. I want to display a message "Please wait". When AutoIt finally loads and runs, it has a "WinClose" function that I can use to close that window (just based on the text in the title bar).

I have experimented with modeless forms and modeless message boxes to no avail, why, because any form I "Show" or message box will not only show the form, or message box, it Also brings any one of the word documents on top of the IE window. This totally screws up the entire application.

I know just what you are thinking, "Task.activate" the IE window. (now my message is gone). This takes you down a road that has a street sign named "What came first Chicken or the egg?". This is not the answer

Using VBA word to do what AutoIt does is totally out of the question.

What I need is to display a message that is modeless (like the "Find and replace" tool for Word). and not change who has the focus in doing so.

Thanks Mucho * 1K for help

Frosty
08-11-2012, 10:42 AM
I'm not 100% clear on what you want to do, honestly. You're talking about Outlook, IE, AutoIt and Word.

I'm not sure how you can use Word to display a form (modeless or not) without that application activating (and thus displaying a word document).

Just a couple of brainstorms... what about opening a hidden document in Word, and then launching your modeless form? Or perhaps the Activate event of the modeless form hides the application?

There's still a lot of stuff that you're talking about which might impact this. And a Word VBA forum may not be the best place to get the answer you're looking for.