SendMessage点击其他窗体按钮(VB)_业余编程爱好者备忘录_百度空间

Private Declare Function SetCapture Lib "user32" (ByVal hwnd 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 Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202

Private Sub Command1_Click()
MsgBox "成功!"
End Sub

Private Sub Command2_Click() '将Command1.hwnd改为其它窗体按钮句柄即可实现点击
SendMessage Command1.hwnd, WM_LBUTTONDOWN, 1, ByVal 0
SendMessage Command1.hwnd, WM_LBUTTONUP, 0, ByVal 0
End Sub



郑重声明:资讯 【SendMessage点击其他窗体按钮(VB)_业余编程爱好者备忘录_百度空间】由 发布,版权归原作者及其所在单位,其原创性以及文中陈述文字和内容未经(企业库qiyeku.com)证实,请读者仅作参考,并请自行核实相关内容。若本文有侵犯到您的版权, 请你提供相关证明及申请并与我们联系(qiyeku # qq.com)或【在线投诉】,我们审核后将会尽快处理。
—— 相关资讯 ——