SNB Solutions - Baja California Software Company
Welcome Guest Search | Active Topics | Log In | Register

Tag as favorite
How to get teamViewer ID and send it to web page
stoian_bycovich
#1 Posted : Friday, February 26, 2010 3:09:23 PM

Rank: Administration

Medals:

Groups: Administrators
Joined: 1/2/2010
Posts: 79
Points: 10,237
Location: Cabo San Lucas

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Imports System.Runtime.InteropServices

Module Sender
Private Const WM_GETTEXT As Integer = &HD
Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal msg As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Function FindWindowEx(ByVal parentHandle As IntPtr, _
ByVal childAfter As IntPtr, _
ByVal lclassName As String, _
ByVal windowTitle As String) As IntPtr
End Function
Declare Auto Function FindWindow Lib "user32.dll" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr

Sub Main()
Dim curDir As String = My.Computer.FileSystem.SpecialDirectories.ProgramFiles() & "\SNB Solutions\SNB Soultions Soporte\"
Dim fileExists As Boolean = My.Computer.FileSystem.FileExists(curDir & "Soporte.exe")

If fileExists Then
Dim tv As Process = Process.Start(curDir & "Soporte.exe")
Dim Hwnd As IntPtr = FindWindow(Nothing, "TeamViewer")

If Hwnd.ToString <> "" Then
Dim Handle As IntPtr = Marshal.AllocHGlobal(100)
Dim NumText As Integer = SendMessage(Hwnd, WM_GETTEXT, 50, Handle)
Dim ChildHandle As IntPtr = FindWindowEx(Hwnd, IntPtr.Zero, "Edit", Nothing)
Dim Hndl As IntPtr = Marshal.AllocHGlobal(200)
NumText = SendMessage(ChildHandle, WM_GETTEXT, 200, Hndl)
Dim web As New System.Net.WebClient()
Dim Cname As String = My.Computer.Name.ToString
web.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
Dim d As Byte() = System.Text.Encoding.ASCII.GetBytes("tvid=" & Marshal.PtrToStringUni(Hndl) & "&cname=" & Cname)
Dim res As Byte() = web.UploadData("http://mypage.com/tvid.aspx", "POST", d)
End If
End If
End Sub
End Module
Best regards,
Stoyan Bukovich
Executive manager
SNB Solutions

Cell.: +52 6241 616969
E-mail: s.bucovich@snb-bg.com
Web: www.snb-bg.com
Sponsor  
 
Eannouncements.net SNB Solutions Eanuncios.net

Eannouncements.net the place for your announcement.

SNB Solutions - Software and computing services company.

Eanuncios.net el lugar para su anuncio.

Users browsing this topic
Guest
Tag as favorite
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.