PEMROGRAMAN API [MOUSE EVENT]

n Gerakan
mouse
n Button
click




DEKLARASI
Declare Sub mouse_event Lib
"user32" Alias "mouse_event"
(
ByVal
dwFlags As Long,
ByVal
dx As Long,
ByVal
dy As Long,
ByVal
cButtons As Long,
ByVal
dwExtraInfo As Long
)
PENJELASAN PARAMETER


n MOUSEEVENTF_ABSOLUTE
n MOUSEEVENTF_MOVE
n MOUSEEVENTF_LEFTDOWN
n MOUSEEVENTF_LEFTUP
n MOUSEEVENTF_RIGHTDOWN
n MOUSEEVENTF_RIGHTUP
n MOUSEEVENTF_MIDDLEDOWN
n MOUSEEVENTF_MIDDLEUP
n MOUSEEVENTF_WHEEL











KONSTANTA-KONSTANTA
Const MOUSEEVENTF_LEFTDOWN =
&H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_MIDDLEDOWN =
&H20
Const MOUSEEVENTF_MIDDLEUP =
&H40
Const MOUSEEVENTF_MOVE = &H1
Const MOUSEEVENTF_ABSOLUTE =
&H8000
Const MOUSEEVENTF_RIGHTDOWN =
&H8
Const MOUSEEVENTF_RIGHTUP =
&H10
PENJELASAN KONSTANTA

CONTOH PENGGUNAAN
Private Declare Sub mouse_event Lib
"user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long,
ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Const MOUSEEVENTF_LEFTDOWN =
&H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_MIDDLEDOWN =
&H20
Const MOUSEEVENTF_MIDDLEUP =
&H40
Const MOUSEEVENTF_MOVE = &H1
Const MOUSEEVENTF_ABSOLUTE =
&H8000
Const MOUSEEVENTF_RIGHTDOWN =
&H8
Const MOUSEEVENTF_RIGHTUP =
&H10
Private Sub Form_Activate()
Do
mouse_event MOUSEEVENTF_LEFTDOWN Or
MOUSEEVENTF_LEFTUP, 0&, 0&, cButt, dwEI
DoEvents
Loop
End Sub
FUNCTION UTAMA
Private Sub Form_Activate()
Do
mouse_event
MOUSEEVENTF_LEFTDOWN
Or MOUSEEVENTF_LEFTUP,
0&, 0&,
cButt, dwEI
DoEvents
Loop
End Sub
PENJELASAN FUNCTION
Do
mouse_event
MOUSEEVENTF_LEFTDOWN
Or MOUSEEVENTF_LEFTUP,
0&, 0&,
cButt, dwEI
DoEvents
Loop
RUNNING PROGRAM

No comments:
Post a Comment
silahkan membaca dan berkomentar