Sign in to follow this  
Followers 0
Queener

TeamViewer

5 posts in this topic

#1 ·  Posted (edited)

Can someone tell me why this isn't working? I got the field focused, but it doesn't type.

$Title = WingetHandle("[CLASS:#32770; TITLE:TeamViewer]", "")
If @error Then
    MsgBox(16, "Error", "Failed to find TeamViewer Windows.")
    Exit
EndIf

sleep(1000)

While 1
WinActivate($Title, "")
if WinWaitActive ($Title, "", 2) Then
ControlSetText("TeamViewer", "", "[CLASS:Edit; INSTANCE:1]", "Test")
Else
Exit
EndIf
WEnd
Exit

I'm try to set it to type Test on Partner ID field...

Edited by asianqueen

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

As far as I can tell, this is not possible with TeamViewer. As you mentioned, the window activates, but it does not seem that the window responds. There is no error code thrown and I even tried to call SetWindowText via WinAPI with no success (yet the error code returns successful). 

Edited for clarity

Edited by 0xdefea7

Share this post


Link to post
Share on other sites

If you do a forum search, you'll see this is a common issue with TeamViewer. If you expand the Computers and Contacts window, you can use WinActivate on that, but not on the main window. Usually I just resort to doing it from command line, like so:

ShellExecute("C:\Program Files (x86)\TeamViewer\Version8\TeamViewer.exe", "-i 123456789 --Password LetMeIn")

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

thanks for the input. I don't usually install any application if it can be executed via portable. I do notice that it's possible in AutoHotKey which uses autoit2 codes. What I did was create a multiple-drop down menu. Each name in the multiple drop down list are assigned to an id. As soon as you click on one of the name, it detects an existent TeamViewer windows. If it doesn't exist, execute TeamViewer. Once it's launched, it clicks on the edit field and type the assigned id.

This is possible with a send, 123456; but doesn't work on autoit3. I didn't want to put all that hard work into that Short-cut cause it gets confuse sometimes. So I want it to code it to an executable file and just have AutoHotKey to run that executable file with a short-cut key.

EDIT: it's editable... Just need to compile it and run it as admin.

Edited by asianqueen

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0