Sign in to follow this  
Followers 0
CyberFunk Productions

windows

8 posts in this topic

is there a way to detect open windows without knowing the title or text in them. I want to detect any open windows.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

One interesting idea: keep alt-tabbing between windows until you hit one you've already seen before. This method will break if two or more windows hold the same title, but the basic idea is as follows. You start by recording the text of the active window. Then, you alt-tab once and record that window. Alt-tab twice (hold alt down and press tab 2 times) and record that one. Alt-tab 3 times, and so on, until you hit a window title and/or text that you have already seen. You will then have a list of all windows.

Recording the text from the window will lower the chances that it stops prematurally with two identical titles, but it is possable to have two windows with the same title and the same text.

Edit: see Valik's suggestion below for a way to avoid issues of windows with the same titles and/ or text.

Edited by pekster

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

You should also store the handle as it will be unique for every window...

Share this post


Link to post
Share on other sites

yes you should b/c this method is a little complicated.

The thing i don't understand is hw to get the text of the active window, without doing it manually?

Share this post


Link to post
Share on other sites

The thing i don't understand is hw to get the text of the active window, without doing it manually?

What do you mean manually? There are a number of functions to detect text in various locations within a window, including: WinGetText, AutoItSetOption("WinDetectHiddenText", 1), ControlGetText, and StatusbarGetText. Maybe that helps.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

right, my bad, i'll take a look at it

Share this post


Link to post
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
Sign in to follow this  
Followers 0