Cartman. Posted June 27, 2014 Report Posted June 27, 2014 Here is a simple tuto how to deal with the mouse APIS it can be helpfull for some of you : GetX, GetY, LeftClick, LeftDown, LeftUp, RightClick, RightUp, RightDown, MiddleClick, MiddleDown, MiddleUp, MoveMouse, SetMousePos'**************************************'Windows API/Global Declarations '**************************************Public 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)Public Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As LongPublic Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As LongPublic Const MOUSEEVENTF_LEFTDOWN = &H2Public Const MOUSEEVENTF_LEFTUP = &H4Public Const MOUSEEVENTF_MIDDLEDOWN = &H20Public Const MOUSEEVENTF_MIDDLEUP = &H40Public Const MOUSEEVENTF_RIGHTDOWN = &H8Public Const MOUSEEVENTF_RIGHTUP = &H10Public Const MOUSEEVENTF_MOVE = &H1Public Type POINTAPIx As Longy As LongEnd TypePublic Function GetX() As Long Dim n As POINTAPI GetCursorPos n GetX = n.xEnd FunctionPublic Function GetY() As Long Dim n As POINTAPI GetCursorPos n GetY = n.yEnd FunctionPublic Sub LeftClick() LeftDown LeftUpEnd SubPublic Sub LeftDown() mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0End SubPublic Sub LeftUp() mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0End SubPublic Sub MiddleClick() MiddleDown MiddleUpEnd SubPublic Sub MiddleDown() mouse_event MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, 0End SubPublic Sub MiddleUp() mouse_event MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0End SubPublic Sub MoveMouse(xMove As Long, yMove As Long) mouse_event MOUSEEVENTF_MOVE, xMove, yMove, 0, 0End SubPublic Sub RightClick() RightDown RightUpEnd SubPublic Sub RightDown()mouse_event MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0End SubPublic Sub RightUp() mouse_event MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0End SubPublic Sub SetMousePos(xPos As Long, yPos As Long) SetCursorPos xPos, yPosEnd Sub Quote