Jump to content
Macro Express Forums

Activating Wrong Window


azdayton
 Share

Recommended Posts

Here's the scoop. I have a program which after it's done with it's job, will pop up a child window to tell me it's done. Unfortunately, I often have lots of programs running while I'm focused elsewhere, so I want to add an audible sound to attract my attention when this window pops up.

 

However, I need it to make the sound periodically, because I'm often away from the desk, and if it only rings once, I'll miss it as often as not.

 

The method I've employed in the past is that I have a macro that fires off every 30 seconds, and checks for specific window titles, and if they exist, it fires off the sound.

 

So here's the problem... The durn thing keeps thinking the PARENT window is the CHILD window.

 

Specifically, when the program's done, it pops up a child with the title "Information". However, any time the program is running, it seems to think that there's an "Information" window. There isn't. It's wierd. I've set it for an exact match, and I've scrutinized all other open windows - none of them have the word "Information" in them anywhere. So why does ME keep sounding off when "Information" isn't even there? Or are there secret windows hidden away that I don't know about, and one of them is called "information"?

 

I need to check the size of this child window to confirm it's the one I'm waiting for. If it's not, I don't want the alert to sound. So if there was a way to get the window size WITHOUT activating it, that'd be an OK workaround. The problem is that if I'm doing something else, this thing fires off and, thinking it's the "information" window, brings the main window foreward to get the size for the check. And of course, the active button is the "Cancel" button. Which means if I'm typing when it happens, and I hit SPACE or ENTER, I've just cancelled the job that was running in the background. VERY annoying!

 

So either a fix for the "wrong window" identification, or a method for checking window size without pulling it to the front would fix the problem.

 

Any ideas appreciated.

 

Thanks.

 

- AzDayton - 06/21/2012 12:45:38

Link to comment
Share on other sites

Windows allows windows to be hidden or visible. (Check out the Window Hide and Window Show macro commands.) Some applications do not remove windows but hide them. Other times there are both hidden and visible copies of a specific window. Since Macro Express gets the list of windows from Windows itself it can seem to be confused.

 

You might be able to do something with the Repeat with Windows command. That command can return only visible windows. Maybe something like this:

Variable Set String %T2% ""
Repeat with Windows: Place title in %T1%
 If Variable %T1% contains "Information"
   Break
 End If
 Variable Set String %T2% "Found"
Repeat End
If Variable %T2% <> "Found"
 Macro Stop
End If

  • Like 1
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...
 Share

×
×
  • Create New...