这个只有两要加的话怎么加?那里切,最好能直接发个代码
Do
Key = WaitKey()
If Key = 117 Then
主窗口 = Plugin.Window.MousePoint()
//Call Plugin.Window.Size(主窗口,800,600)
End If
If Key = 118 Then
同步窗口 = Plugin.Window.MousePoint()
// Call Plugin.Window.Size(同步窗口,800,600)
End If
Delay 500
If 主窗口 0 and 同步窗口 0 Then
Exit Do
End If
Loop
Do
Mouse = GetLastClick()
If Mouse = 32769 Then //鼠标左键按下时ASCII码为 32769
sRect = Plugin.Window.GetWindowRect(主窗口)
dim MyArray
MyArray = Split(sRect, "|")
L = Clng(MyArray(0)): T = Clng(MyArray(1))
GetCursorPos mx, my
Delay 10
Call Plugin.Bkgnd.LeftDown(同步窗口, mx-L, my-T)
Delay 10
Do
Mouse = GetLastClick()
If Mouse = 0 Then //鼠标无点击操作
GetCursorPos mx, my
Delay 10
Call Plugin.Bkgnd.MoveTo(同步窗口, mx-L, my-T)
Delay 10
End If
If Mouse = 32770 Then //鼠标左键弹起时ASCII码为 32770
GetCursorPos mx, my
Delay 10
Call Plugin.Bkgnd.LeftUp(同步窗口, mx-L, my-T)
Exit Do
End If
Loop
End If
Key = GetLastKey()
Call Plugin.Bkgnd.KeyPress(同步窗口, Key)
Loop
如果你想,手动操作一个窗口,别的窗口同步操作。好像很难实现。
如果,完全自动的同步就简单了。
//1、先得到所有窗口的句柄,这个根据实际情况有很多办法
Hwnd1 = Plugin.Window.Foreground()
Delay 10000
Hwnd2 = Plugin.Window.Foreground()
//下一句第一个窗口按a
Call Plugin.Bkgnd.KeyPress(Hwnd1, 65)
//下一句第二个窗口按a
Call Plugin.Bkgnd.KeyPress(Hwnd2, 65)
//下一句式在第一个窗口的100 200位置点击鼠标左键
Call Plugin.Bkgnd.LeftClick(Hwnd1, 100, 200)
//下一句式在第二个窗口的100 200位置点击鼠标左键
Call Plugin.Bkgnd.LeftClick(Hwnd2, 100, 200)
本文地址:https://www.docexcel.net/show/4_21435.html