Private Declare Function PostMessage Lib "user32. DLL" Alias "PostMessageA" (ByVal HWND As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam) As Long As Long
Private Const WM_LBUTTONDOWN As Long=& amp; H201
Private Const WM_LBUTTONUP As Long=& amp; H202
Private Sub Command1_Click ()
SendClick Me. HWND, 10, 10
End Sub
Private Sub Form_Click ()
MsgBox "dasd
"End Sub
Private Function SendClick (HWND As Long, mX, As Long As mY Long)
'
click messages sentDim As Long I
I=PostMessage (HWND, WM_LBUTTONDOWN, 0, (mX And & amp; HFFFF) + (mY And & amp; HFFFF) * & amp; H10000)
I=PostMessage (HWND, WM_LBUTTONUP, 0, (mX And & amp; HFFFF) + (mY And & amp; HFFFF) * & amp; H10000)
End the Function
HWND if you said is wrong, so no sent to, if not so back to things, don't know why, now don't have gone?
CodePudding user response:
PostMessage Settings window position? The building Lord why trifles?CodePudding user response:
I have this code, the form coordinates can be click, no problem,If is ordinary creat form, even the buttons inside the can, but if you are a GUI Windows gdi can only be generated background, button is not can point,
Also, if is a messagebox dialog box is not clickable, and if there is a dialog box, also can't click form inside the handle, messagebox is only the handle to desktop level can click, the tested very strange,
CodePudding user response:
If is ordinary creat form, even inside the button can orderCreat form is what meaning, is not a general program to generate the form?
CodePudding user response:
Do you have a will?CodePudding user response:
Top, I also want to know why it doesn't work?In many BBS have all witnessed the building of the code, there is a call "widely spread-and deeply felt the horse" to send several times, but why I can't test on the machine of success ~?
The same code must have a lot of people is successful, why some people can't succeed? What reason do ~! ?
CodePudding user response: