Jump to content


Photo

SetTitleMatchMode RegEx support for ControlGet classNN param


  • Please log in to reply
2 replies to this topic

#1 guest3456

guest3456
  • Members
  • 1327 posts

Posted 20 July 2012 - 06:55 PM

i'm trying to use RegEx mode to match partial control class names

Can be either ClassNN (the classname and instance number of the control) or the name/text of the control, both of which can be determined via Window Spy. When using name/text, the matching behavior is determined by SetTitleMatchMode.


i read those docs to mean:

1. for the 4th (Control) parameter, if you use Classname, it won't use TitleMatchMode, and i guess it will have to be an exact Classname match
2. if you use name/text of control, it will use TitleMatchMode

and obv for the 5th (WinTitle) param, TitleMatchMode will always work

suppose i have a button in another window with classNN = ExampleButtonXClass02, and i try to pass a classname ButtonXClass02, it won't work since it will not match the partial classname

SetTitleMatchMode, Regex
ControlGet, visi, Visible,, ButtonXClass02, ahk_id %hwnd%

i've also tried to trigger the "name/text" matching like this, but it also didn't work:

SetTitleMatchMode, Regex
ControlGet, visi, Visible,, ahk_class ButtonXClass02, ahk_id %hwnd%

:(

#2 Lexikos

Lexikos
  • Administrators
  • 8836 posts

Posted 20 July 2012 - 11:58 PM

ClassNN is the NNth child window of class Class. It can't be a regex because it needs to match the exact class in order to calculate NN.

#3 guest3456

guest3456
  • Members
  • 1327 posts

Posted 21 July 2012 - 12:15 AM

gotcha thanks, ill have to figure something else out