Jump to content

Recommended Posts

Posted

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

Posted (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 title

3 = Exact title match

4 = 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 by exodius
Posted

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

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
  • Recently Browsing   0 members

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