Berikut adalah cara-cara untuk menekan tombol di form lain dengan menggunakan kode . Jadi anda tidak perlu untuk menggunakkan mouse pointer anda untuk mengkliknya .
[ 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
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds 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 Integer
Const WM_LBUTTONDOWN = &H201
Const WM_LBUTTONUP = &H202
Const WM_LBUTTONDOWN = &H201
Const WM_LBUTTONUP = &H202
Sekarang untuk mempraktekkannya gunakan kode seperti berikut :
[ VB 6.0 ]
SendMessage Command1.hwnd, &HF3, 1, 0
Sleep 150
SendMessage Command1.hwnd, &HF3, 0, 0
Command1.Value = True
Sleep 150
SendMessage Command1.hwnd, &HF3, 0, 0
Command1.Value = True
[ VB .NET ]
SendMessage(Button1.Handle, WM_LBUTTONDOWN, 0, 0)
Application.DoEvents()
Threading.Thread.Sleep(150)
SendMessage(Button1.Handle, WM_LBUTTONUP, 0, 0)
Button1.PerformClick()
Application.DoEvents()
Threading.Thread.Sleep(150)
SendMessage(Button1.Handle, WM_LBUTTONUP, 0, 0)
Button1.PerformClick()
Update Contact :
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email : Fajarudinsidik@gmail.com
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email: Fajarudinsidik@gmail.com
atau Kirimkan Private messanger melalui email dengan klik tombol order dibawah ini :