Jump to content

WinWaitActive window targeting problem


wysocki
 Share

Recommended Posts

I'm trying to create a script that watches for a small popup to appear, then captures it for me (either an image or the contents). The popup is created by a Chrome browser plugin called "Pandora Enhancer". Whenever a song changes in Pandora, the plugin creates the small popup display showing info about the song. Unfortunately, Au3Info shows no window title, and the class is the same the main Pandora browser window, and the handle varies each time it pops up. The only other possibility is that the Window Matching Modes of AutoIt appear to be able to find a window based upon X/Y/W/H. However, the help file and other sources don't show me the syntax I'd need to use this, if it's even doable. The popup position is 1550,950 and the size is 360,80.

What's the syntax to match a window based upon position and size? Will this idea even work? Are there any alternatives?

Link to comment
Share on other sites

You can do a winlist based on the class...then loop until an additional window is included in the array...use that handle to do your additional scripting.

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Interesting approach, delaney! But right off the start, I hit a problem. If I just start Chrome then do:

WinList("[CLASS:Chrome_WidgetWin_1]")

I get two items in the array. One has the title of the main window, the other has a blank title (which is what my target popup also has). When the popup appears, I DO get another item in the winlist array but I'm not sure how to tell which one is my new popup. If I have multiple Chrome windows running, it appears that each real window has another invisible handle created. I suppose I could capture the existing window handles when Chrome starts up, before the popup appears, then watch for a new different one (as long as I don't open another Chrome window). I'll play with that idea.

Still, I wonder if there's a way to use the X/Y/W/H as implied in the docs since the popup always appears in the same place?

Link to comment
Share on other sites

sure, just loop through the array, verify the win state is visible (wingetstate), you can look at the wingetpos to get the size, ...profit?

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...