Jefferds44 Posted February 18, 2009 Share Posted February 18, 2009 Hi guys, Say I have two windows with the following titles: 1) "Table #12345678" & 2) "Chat:Table #12345678" I want to get the handle for the first window but I always get the handle of the 2nd one for some reason. I am using WinTitleMatchMode == 2. I think I should use the [REGEXPTITLE] but I'm not sure how to get the syntax right. Pseudo code would be: Get handle for the window (with "Table #12345678" in the title) (that does NOT have "Chat:" in it.) Thanks for the help, Jeff Link to comment Share on other sites More sharing options...
motionman95 Posted February 18, 2009 Share Posted February 18, 2009 Hmm...how about using classnames? Link to comment Share on other sites More sharing options...
exodius Posted February 18, 2009 Share Posted February 18, 2009 (edited) Well according to the Help File for Opt ("WinTitleMatchMode", x):Alters the method that is used to match window titles during search operations.1 = Match the title from the start (default)2 = Match any substring in the title3 = Exact title match4 = Advanced mode, see Window Titles & Text (Advanced)-1 to -4 = force lower case match according to other type of match.Does using Mode 3 not delineate between the two? It should be looking for an exact match which would count out the one with "Chat:" at the beginning? Edited February 18, 2009 by exodius Link to comment Share on other sites More sharing options...
Manjish Posted February 18, 2009 Share Posted February 18, 2009 What about using different text?? The windows must be having some text which is not in the other.. then u can easily differentiate between the two.. Exodius's method will also work.. unless u have to use mode 2 for some specific reason.. If so then use the differnt text method which i suggested.. [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com 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