客户要求一个远程协助软件. 用于局域网内部使用.
几经比对筛选, 还是基于TeamViewer的封装实现
方案是通过句柄获取Teamviewer内控件. 然后修改内部参数或是模拟鼠标点击
后面发现Teamviewer可以带参数.
-i <ID>
(Mandatory) ID of the remote computer
--Password <password> -P <password>
(Optional) password of the remote computer – you will be prompted for the password if this is not used
-m fileTransfer -m vpn
(Optional) connection mode – this defaults to Remote Control if not used
详细参考: https://community.teamviewer.com/t5/Knowledge-Base/Command-line-parameters/ta-p/34447
然后将Teamviewer的远程界面嵌入到自己的form中
IntPtr maindHwnd = FindWindow("TV_CClientWindowClass", null); //获得句柄
if (maindHwnd != IntPtr.Zero)
{
SetParent(maindHwnd, this.Handle);
ShowWindow(maindHwnd, 1);
}