Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Acc object and Reg expr
#1
Hi Gintaras,

I have this accesible object statement(which works):

Acc a.Find(w "WINDOW" "3: Tenor Sax" "class=Afx:*[]id=65285" 0x1005)

However the id=65285 changes sometimes subtly, like id=65286.

I tried several things
Acc a.Find(w "WINDOW" "3: Tenor Sax" "class=Afx:*[]id=6528*" 0x1005)
Acc a.Find(w "WINDOW" "3: Tenor Sax" "class=Afx:*[]id=6528?" 0x1005)
Acc a.Find(w "WINDOW" "3: Tenor Sax" "class=Afx:*[]id=6528\d" 0x1005)
etc.

Somehow I can't get it to work. Are these statements not correct or is it in some cases just impossible to get it to work?

Regards,
GertC
#2
Regexp and wildcard cannot be used with numeric properties.

I see 2 ways:
1. Call Find or child multiple times with different id. Slow.
2. Use callback function.

Code:
Copy      Help
Acc a.Find(w "WINDOW" "3: Tenor Sax" "class=Afx:*" 0x1005 0 0 "" &sub.Callback_Acc_Find)


#sub Callback_Acc_Find
function# Acc&a level cbParam

int k=GetWinId(child(a))
out k
if(k>=65285 and k<=65286) ret 0 ;;found
ret 1
#3
Thanks for your help. Now I understand callback functions as well !


Forum Jump:


Users browsing this thread: 1 Guest(s)