文档库 最新最全的文档下载
当前位置:文档库 › c#获取teamviewer ID密码源码

c#获取teamviewer ID密码源码

c#获取teamviewer ID密码源码
c#获取teamviewer ID密码源码

using System;

using System.Collections.Generic;

using https://www.wendangku.net/doc/f36813774.html,ponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using System.Runtime.InteropServices;

namespace WindowsFormsApplication1

{

publicpartialclass Form3 : Form

{

[DllImport("user32.dll", EntryPoint = "FindWindow", CharSet = CharSet.Auto)] privateexternstatic IntPtr FindWindow(string classname, string captionName);

[DllImport("user32.dll", EntryPoint = "FindWindowEx", CharSet = CharSet.Auto)] privateexternstatic IntPtr FindWindowEx(IntPtr parent, IntPtr child, string classname, string captionName);

//[DllImport("user32.dll")]

[DllImport("user32.dll", EntryPoint = "SendMessageA")]

privatestaticexternint SendMessage(IntPtr hwnd, int wMsg, int wParam, StringBuilder lParam); //public static extern intSendMessage(IntPtrhwnd, intwMsg, IntPtrwParam, IntPtrlParam); //static extern IntPtrSendMessage(IntPtrhWnd, UInt32 Msg, IntPtrwParam,

[MarshalAs(UnmanagedType.LPStr)] string lParam);

public Form3()

{

InitializeComponent();

}

constint WM_GETTEXT = 0x0D;

privatevoid button1_Click(object sender, EventArgs e)

{

IntPtr main = FindWindow("#32770", "TeamViewer");

listBox1.Items.Add(main.ToString());

IntPtr Child = FindWindowEx(main, IntPtr.Zero, null, string.Empty);

listBox1.Items.Add(Child.ToString());

Child = FindWindowEx(main, Child, null, string.Empty);

listBox1.Items.Add(Child.ToString());

IntPtr box1 = FindWindowEx(Child, IntPtr.Zero, "ATL:0216AA20", null);

listBox1.Items.Add(box1.ToString());

constint buff_sizi = 20;

StringBuilder buffer1 = new StringBuilder(buff_sizi);

StringBuilder buffer2 = new StringBuilder(buff_sizi);

SendMessage(box1, WM_GETTEXT, buff_sizi, buffer1);

listBox1.Items.Add(buffer1.ToString());

IntPtr box2 = FindWindowEx(Child, box1, "ATL:0216AA20", null);

listBox1.Items.Add(box2.ToString());

SendMessage(box2, WM_GETTEXT, buff_sizi, buffer2);

listBox1.Items.Add(buffer2.ToString());

}

} }

相关文档