我的代码如下
Private Sub Command1_Click()
Dim hBtn As Long
Dim hParent As Long
Const WM_LBUTTONDOWN = &H201
Const WM_LBUTTONUP = &H202
hParent = FindWindow("ThunderFormDC", "Form1")
hBtn = FindWindowEx(hParent, 0, "ThunderCommandButton", "Button1")
lblWinHDL.Caption = Hex(hParent)
lblBtnHDL.Caption = Hex(hBtn)
SendMessage hBtn, WM_LBUTTONDOWN, 0, 0
SendMessage hBtn, WM_LBUTTONUP, 0, 0
End Sub
在我单击command1时,只是在form1中焦点移动到了Button1上,而没有产生Button1的单击事件。这是为什么呢?是否还需要加入一些API函数或要进行一些设置?谢谢
Private Sub Command1_Click()
Dim hBtn As Long
Dim hParent As Long
Const WM_LBUTTONDOWN = &H201
Const WM_LBUTTONUP = &H202
hParent = FindWindow("ThunderFormDC", "Form1")
hBtn = FindWindowEx(hParent, 0, "ThunderCommandButton", "Button1")
lblWinHDL.Caption = Hex(hParent)
lblBtnHDL.Caption = Hex(hBtn)
SendMessage hBtn, WM_LBUTTONDOWN, 0, 0
SendMessage hBtn, WM_LBUTTONUP, 0, 0
End Sub
在我单击command1时,只是在form1中焦点移动到了Button1上,而没有产生Button1的单击事件。这是为什么呢?是否还需要加入一些API函数或要进行一些设置?谢谢
有时候sendmessage窗体不接收
发哪个树标事件我们成功过.
发了按下还要发抬起.