Write the following code in the event '(Declarations)' of Form
[VB 6.0]
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[VB.Net]
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function SendMessage Lib"user32.dll" Alias "SendMessageA"(ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam As Object) As IntegerNow for practice use code like the following:
Const WM_LBUTTONDOWN = &H201
Const WM_LBUTTONUP = &H202
[VB 6.0]
SendMessage Command1.hwnd, &HF3, 1, 0[VB.Net]
Sleep 150
SendMessage Command1.hwnd, &HF3, 0, 0
Command1.Value = True
SendMessage(Button1.Handle, WM_LBUTTONDOWN, 0, 0)
Application.DoEvents()
Threading.Thread.Sleep(150)
SendMessage(Button1.Handle, WM_LBUTTONUP, 0, 0)
Button1.PerformClick()
0 comments:
Post a Comment