If hWnd4 Then
m = SendMessage(hWnd2, &H201, hWnd4, 0) '发送按钮按下
n = SendMessage(hWnd2, &H202, hWnd4, 0)
Debug.Print m, n
End If
End Sub
Private Sub Command2_Click()
MessageBox Form1.hwnd, "这里是内容", "标题", vbYesNo
End Sub
If hWnd3 Then
m = SendMessage(hWnd3, &H201, 0, &h50005) '发送按钮按下
n = SendMessage(hWnd3, &H202, 0, &h50005)
Debug.Print m, n
End If
End Sub
Private Sub Command2_Click()
MessageBox Form1.hwnd, "这里是内容", "标题", vbYesNo
End Sub
Private Declare Function MessageBox Lib "user32" Alias "MessageBoxA" _
(ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, _
ByVal wType As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
ByVal lParam As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const GWL_ID = (-12)
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal szClsName As String, ByVal szWndName As String) As Long
Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd As Long, ByVal hClientWnd As Long, ByVal szClsName As String, ByVal szWndName As String) As Long
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function MessageBox Lib "user32.dll" Alias "MessageBoxA" (ByVal hWnd As Long, ByVal szMessages As String, ByVal szMsgTitle As String, ByVal nType As Long) As Long
If hWnd3 Then
m = SendMessage(hWnd3, WM_LBUTTONDOWN, 0, &H50015) '发送按钮按下
n = SendMessage(hWnd3, WM_LBUTTONUP, 0, &H50015)
'Debug.Print m, n
End If
End Sub
Private Sub Command2_Click()
Timer2.Enabled = True
MessageBox Form1.hWnd, "这里是内容", "标题", vbYesNo
Timer2.Enabled = False
End Sub