- 超级版主
- 1228894
- 26974
- 25
- 8049 朵
- 36128 个
- 4745 个
- 421340
- 2012-07-18
|
2#
t
T
发表于 2024-06-20 09:09
|
|只看该用户
, - Dim Hwnd(99), x, y, M_tp, Q_tp, i
- MsgBox "將滑鼠放置在要同步窗口視窗內按下空白鍵" & chr(13) & "設定完成請按下ESC" & chr(13) & "本版本為試用版最多同步數為:5", 0, "提示:關閉此彈出窗後"
- i = 0
- Do
- bk = WaitKey()
- If bk = 27 or i = 5 Then
- Exit Do
- ElseIf bk = 32 Then
- i = i + 1
- st = Plugin.Window.MousePoint()
- Hwnd(i) = st
- Delay 10
- End If
- Loop
- If i = 0 Then
- ExitScript
- End If
- MsgBox "請切換至要操作的主窗口" & chr(13) & "按任意鍵開始操作。", 0, "提示:"
- WaitKey
- Hwnd1 = Plugin.Window.Foreground()
- sRect = Plugin.Window.GetClientRect(Hwnd1)
- xy = Split(sRect, "|")
- Do
- Call 鍵盤操作()
- Call 滑鼠操作()
- Loop
- EndScript
- Sub 鍵盤操作()
- M_tp = GetLastKey()
- If M_tp > 0 Then
- For n = 1 To i
- Call Plugin.Bkgnd.KeyDown(Hwnd(n), M_tp)
- Call Plugin.Bkgnd.KeyUp(Hwnd(n), M_tp)
- Next
- M_tp = 0
- End If
- Delay 1
- End Sub
- Sub 滑鼠操作()
- GetCursorPos x, y
- If x > int(xy(0)) and y > int(xy(1)) and x < int(xy(0)) + int(xy(2)) and y < int(xy(1)) + int(xy(3)) Then
- //Call Plugin.Msg.Tips("")
- Q_tp = GetLastClick()
- If Q_tp > 0 Then
- For n = 1 To i
- Call Plugin.Bkgnd.MoveTo(Hwnd(n), x - xy(0), y - xy(1))
- Select Case Q_tp
- Case 32769//左鍵壓下
- Call Plugin.Bkgnd.LeftDown(Hwnd(n), x - xy(0), y - xy(1))
- Case 32770//左鍵彈起
- Call Plugin.Bkgnd.LeftUp(Hwnd(n), x - xy(0), y - xy(1))
- Case 32773//右鍵壓下
- Call Plugin.Bkgnd.RightDown(Hwnd(n), x - xy(0), y - xy(1))
- Case 32774//右鍵彈起
- Call Plugin.Bkgnd.RightUp(Hwnd(n), x - xy(0), y - xy(1))
- Case Else
- End Select
- Next
- End If
- Else
- //Call Plugin.Msg.Tips("滑鼠超出主窗口範圍!!")
- End If
- Delay 1
- End Sub
复制代码
|