IanN1990 Posted November 18, 2011 Share Posted November 18, 2011 (edited) Heya, Small question I have some windows i would like to minimize, but the first instance of the name changes. Instead of writing out every instance, is there a way i could make it check if it contains just part of it ? while 1 sleep(250) WinSetState("Randomstarta - Example","",@SW_MINIMIZE) WinSetState("Randomstartb - Example","",@SW_MINIMIZE) WinSetState("Randomstartc - Example","",@SW_MINIMIZE) WEnd is there any way it could be written so if it contained " - Example" it would minimize it ? Edited April 14, 2012 by IanN1990 Link to comment Share on other sites More sharing options...
jchd Posted November 18, 2011 Share Posted November 18, 2011 Look in the help, Using AutoIt >> Windows Titles and Text (Advanced) This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Realm Posted November 18, 2011 Share Posted November 18, 2011 Hello IanN1990,If you know the exact name of the instance at startup, you could use WinGetHandle() which should never change, and use the handle for the rest of your functions. However if a new window is created rather than just the name being changed, then the handle will most definitely change as well.Another Option is to use the option 'WinTitleMatchMode' and set it to match any substring since it appears 'Example' stays the same.Example:Opt('WinTitleMatchMode', 2 ) WinSetState('Example','',@SW_MINIMIZE) My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
IanN1990 Posted November 18, 2011 Author Share Posted November 18, 2011 Works perfectly thanks realm Link to comment Share on other sites More sharing options...
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