[求助]请教有关SendMessagede问题
我想在Form1窗口中先把鼠标移动到(32,32) 然后移动到(132,132) 但是没反映 请问什么地方有问题 怎样可以移动到这两个点 我很想把这个API函数学好:lo1
Option Explicit
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Const WM_LBUTTONDOWN = &H201
Const WM_lBUTTONUP = &H202
Private Sub Command1_Click()
Dim hWnd As Long, Cs As String, Cd As POINTAPI, Cx As POINTAPI
hWnd = GetForegroundWindow()
Cd.x = 32
Cd.y = 32
Cx.x = 132
Cx.y = 132
SendMessage From1_hWnd, WM_LBUTTONDOWN, 0, Cd.x + Cd.y
SendMessage From1_hWnd, WM_lBUTTONUP, 0, Cd.x + Cd.y
SendMessage From1_hWnd, WM_LBUTTONDOWN, 0, Cx.x + Cx.y
SendMessage From1_hWnd, WM_lBUTTONUP, 0, Cx.x + Cx.y
End Sub