Jump to content
Macro Express Forums

How do you Get the Window Title of the Current Window in Focus


Recommended Posts

I have elected to do a Switch and CASE statement to handle the many different dialogs that shows up when during an dialog operation.

How do you Get the Window Title of the Current Window or Control in Focus?

 

Example of the dialogs that I am dealing with...

http://screencast.com/t/UBN3bTUmaL

 

So if there is an unexpected dialog that shows up, I want to save that Window Title in a variable or log it to a file somewhere.

 

Thanks in advance for any help at all.

 

EDIT:

I guess I just found the following: http://pgmacros.invisionzone.com/index.php?showtopic=3899

This method seems to only take the string from the top-most Window Title. It appears this wouldn't work for a dialog that popup within the program. Right? Any solutions?

Link to comment
Share on other sites

How do you Get the Window Title of the Current Window or Control in Focus?
Well you would use Variable Set String with the Set to Topmost Window Title. But surely you knew that already which leaves me thinking there's something I'm missing here. Especially given your edit. Perhaps if you explained why this will not work and we can go from there.

 

Also you might check out the Repeat With Windows command.

Link to comment
Share on other sites

It appears this wouldn't work for a dialog that popup within the program. Right? Any solutions?
Do you mean an MDI ? If so then that is correct. EG you can't get the title of a Word doc window in Word. However many application pop ups are not children in the MDI. Just try a test to see.
Link to comment
Share on other sites

You are partially correct. In my example of a Word document it would but this is because Word is using MDI (Multiple Document Interface). When the parent app creates a new form it can do so either within or as another form. And usually pop up dialogs are the later.

 

There are a lot of things in MEP which one must experiment with or research as a "So what's what it means by..." kind of thing. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...