vb台后向指定窗口发送鼠标点击
PublicDeclareFunctionPostMessageLib"user32"Alias"PostMessageA"(ByValhwndAsInteger,ByV...
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As IntPtr) As Integer
hwnd = Dm.FindWindow("", "API浏览器")
Dm.BindWindow(hwnd, "normal", "normal", "normal", 0)
Dm.FindStr(0, 0, 800, 800, "添加", "000000-000000", 1, intX, intY)
' pos = Dm.FindStrE(0, 0, 800, 800, "添加", "000000-000000", 1)
' j = Split(pos, "|")
' Dm.MoveTo(CInt(j(1)), CInt(j(2)))
' Label1.Text = j(2)
' Dim mx As Long = CInt(intX)
' Dim my As Long = CInt(intY)
' zbc = (intX And &HFFFF) + (intY And &HFFFF) * &H10000
' Dm.MoveTo(intX + 10, intY)
Label2.Text = intX
i = PostMessage(hwnd, BM_CLICK, MK_LBUTTON, intX + intY * 65536)
VB2010
ByVal lParam As IntPtr,这个值不能用AS any,提示说与 Declare 有冲突 展开
hwnd = Dm.FindWindow("", "API浏览器")
Dm.BindWindow(hwnd, "normal", "normal", "normal", 0)
Dm.FindStr(0, 0, 800, 800, "添加", "000000-000000", 1, intX, intY)
' pos = Dm.FindStrE(0, 0, 800, 800, "添加", "000000-000000", 1)
' j = Split(pos, "|")
' Dm.MoveTo(CInt(j(1)), CInt(j(2)))
' Label1.Text = j(2)
' Dim mx As Long = CInt(intX)
' Dim my As Long = CInt(intY)
' zbc = (intX And &HFFFF) + (intY And &HFFFF) * &H10000
' Dm.MoveTo(intX + 10, intY)
Label2.Text = intX
i = PostMessage(hwnd, BM_CLICK, MK_LBUTTON, intX + intY * 65536)
VB2010
ByVal lParam As IntPtr,这个值不能用AS any,提示说与 Declare 有冲突 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询