CyberFunk Productions Posted June 23, 2004 Posted June 23, 2004 is there a way to detect open windows without knowing the title or text in them. I want to detect any open windows.
pekster Posted June 23, 2004 Posted June 23, 2004 (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 June 23, 2004 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.
Valik Posted June 23, 2004 Posted June 23, 2004 You should also store the handle as it will be unique for every window...
Administrators Jon Posted June 23, 2004 Administrators Posted June 23, 2004 I really should get around to doing the function to get lists of windows... Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
CyberFunk Productions Posted June 23, 2004 Author Posted June 23, 2004 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?
pekster Posted June 23, 2004 Posted June 23, 2004 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.
CyberFunk Productions Posted June 24, 2004 Author Posted June 24, 2004 right, my bad, i'll take a look at it
tutor2000 Posted June 24, 2004 Posted June 24, 2004 I really should get around to doing the function to get lists of windows...Don't forget the MakeMyCoffee funcRick
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now