Dim wwnd As Long
Dim hwnd As Long
wwnd = FindWindow(vbNullString, "Form1")
If wwnd > 0 Then
hwnd = FindWindowEx(wwnd, 0, vbNullString, "smellbtn")
If hwnd <> 0 Then
SendMessage hwnd, BM_CLICK, 0, 0 '点击操作
End If
End If
"smellbtn"
是个按钮,这个按钮名称和caption要一样,否则的话就获取不到?
caption名不是随便改的吗