Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
get the value of a control on the window
#1
Hello everyone, I am trying a case, I want to get the value of a control on the window, and save the value to the variable(id), I can't think of a solution, I hope someone can help me, thanks in advance

Macro Macro5
Code:
Copy      Help
;Here is a little problem, how to wait for the control to activate, then, get the control value
int w=wait(0 WA win("TeamViewer" "#32770")) 

str id
;;The code that saves the control value to the variable(id)


Attached Files Image(s)
       
#2
try this for getting the  text


Code:
Copy      Help
str txt.getwintext(child("" "Edit" w 0x0 "id=1")) ;;editable text 'YOUR ID'
out txt
code for password very similar

Code:
Copy      Help
str txt1.getwintext(child("" "Edit" w 0x0 "id=1" 2)) ;;editable text 'PASSWORD'
out txt1
#3
Did not get any value,

I don't know how to wait for the control to activate. Huh


Macro Macro5
Code:
Copy      Help
run "$program files$\TeamViewer\TeamViewer.exe" "" "" "*" ;;TeamViewer 13
;Here is a little problem, how to wait for the control to activate, then, get the control value
int w=wait(0 WA win("TeamViewer" "#32770")) 
str txt.getwintext(child("" "Edit" w 0x0 "id=1")) ;;editable text 'YOUR ID'
out txt
str txt1.getwintext(child("" "Edit" w 0x0 "id=1" 2)) ;;editable text 'PASSWORD'
out txt1
#4
Code:
Copy      Help
int w
run "$program files$\TeamViewer\TeamViewer.exe" "" "" "" 0x800 win("TeamViewer" "#32770") w
;again
str txt.getwintext(child("" "Edit" w 0x0 "id=1")) ;;editable text 'YOUR ID'
if empty(txt); 0.3; goto again
out txt
str txt1.getwintext(child("" "Edit" w 0x0 "id=1" 2)) ;;editable text 'PASSWORD'
out txt1
#5
Still can't get any value,


Attached Files Image(s)
   
#6
don't know what to tell you working fine every time for me
#7
Occasionally I can output values, sometimes the values are incomplete, and more often I can't get the values.   Confused


Attached Files Image(s)
   
#8
Is there a more stable and reliable method? I tried to wait for various commands related to it and could not achieve it. Smile
#9
after a bit of sleep and seeing your attachment try this.


Code:
Copy      Help
int w
run "$program files$\TeamViewer\TeamViewer.exe" "" "" "" 0x800 win("TeamViewer" "#32770") w
;again
str txt.getwintext(child("" "Edit" w 0x0 "id=1")) ;;editable text 'YOUR ID'
if(empty(txt) or txt="-")    0.3;    goto again
out txt
str txt1.getwintext(child("" "Edit" w 0x0 "id=1" 2)) ;;editable text 'PASSWORD'
out txt1
#10
another way  but waits for Ready to connect(secure connection) status message (english language only) since it appears your trouble is because your not connected . 
Code:
Copy      Help
int w
run "$program files$\TeamViewer\TeamViewer.exe" "" "" "" 0x800 win("TeamViewer" "#32770") w
;again
str text.getwintext(child("" "Static" w 0x0 "id=1")) ;;text '
if(text !="Ready to connect (secure connection)")    0.3;    goto again
str txt.getwintext(child("" "Edit" w 0x0 "id=1")) ;;editable text 'YOUR ID'
out txt
str txt1.getwintext(child("" "Edit" w 0x0 "id=1" 2)) ;;editable text 'PASSWORD'
out txt1


if using another language besides english in teamviewer use  code below.

Code:
Copy      Help
int w
run "$program files$\TeamViewer\TeamViewer.exe" "" "" "" 0x800 win("TeamViewer" "#32770") w
;again
str txt.getwintext(child("" "Edit" w 0x0 "id=1")) ;;editable text 'YOUR ID'
if(empty(txt) or txt="-")    0.3;    goto again
out txt
str txt1.getwintext(child("" "Edit" w 0x0 "id=1" 2)) ;;editable text 'PASSWORD'
out txt1
#11
@kevin

Thank you for your help, the above code works very well, I have learned a lot, thank you again Heart


Forum Jump:


Users browsing this thread: 1 Guest(s)