Home > database >  The mouse control
The mouse control

Time:10-03

How to use the code to control the mouse

CodePudding user response:

API

CodePudding user response:

gz

CodePudding user response:

Bpy, say thank you
And after I define the API, the call it error, "open the error"
API function definition before using, I can't always use

CodePudding user response:

Define and use the case to be
Then is the problem parameters

China soft on another article, write very good, is instead of the mouse

CodePudding user response:

Declaration API below
 
Ulong Subroutine mouse_event (ulong dwFlags, ulong dx, dy, ulong cButtons, ulong dwExtraInfo) LIBRARY "user32. DLL
"The FUNCTION long SetCursorPos (long mx, long my) LIBRARY "USER32. DLL
"


Define some constants as
 
ULong MOUSEEVENTF_LEFTDOWN=2//& amp; The H2
ULong MOUSEEVENTF_LEFTUP=4//& amp; H4
ULong MOUSEEVENTF_MIDDLEDOWN=32//& amp; H20
ULong MOUSEEVENTF_MIDDLEUP=64//& amp; H40
ULong MOUSEEVENTF_MOVE=1//& amp; H1
ULong MOUSEEVENTF_ABSOLUTE=32768//& amp; H8000
ULong MOUSEEVENTF_RIGHTDOWN=8//& amp; H8
ULong MOUSEEVENTF_RIGHTUP=16//& amp; H10


In the program control the mouse and click on
 
SetCursorPos (100100)//mouse moves to the position of the screen coordinates 100100

Mouse_event (MOUSEEVENTF_LEFTDOWN, 100, 100, 0, 0)//in the 100100 position coordinates by pressing the left mouse button
Mouse_event (MOUSEEVENTF_LEFTUP, 100, 100, 0, 0)//in the 100100 position coordinates to loosen the left mouse button

CodePudding user response:

Pick up points is king!
  • Related