Cursor Click?
Posted: Wed Apr 28, 2010 5:44 am
how would you make your cursor click? without clicking the mouse
Sharing, Teaching and Supporting coders of all ages and levels since 2009
https://www.codenstuff.com/forum/
Structure MOUSEINPUT
Public dx As Integer
Public dy As Integer
Public mouseData As UInteger
Public dwFlags As UInteger
Public time As UInteger
Public dwExtraInfo As IntPtr
End Structure
Structure INPUT
Public type As UInteger ' = 0 already for mouse
Public mi As MOUSEINPUT
End Structure
<DllImport("user32.dll")> Shared Function SendInput(ByVal nInputs As UInteger, ByRef pInputs As INPUT, ByVal cbSize As Integer) As UInteger
End Function
Const MOUSEEVENTF_LEFTDOWN As UInteger = &H2
Const MOUSEEVENTF_LEFTUP As UInteger = &H4
Const MOUSEEVENTF_RIGHTDOWN As UInteger = &H8
Const MOUSEEVENTF_RIGHTUP As UInteger = &H10
Const MOUSEEVENTF_MIDDLEDOWN As UInteger = &H20
Const MOUSEEVENTF_MIDDLEUP As UInteger = &H40
...
Dim inp As INPUT = New INPUT()
Dim size As Integer = Marshal.SizeOf(inp)
inp.mi.dwFlags = MOUSEEVENTF_LEFTDOWN
SendInput(1, inp, size)
inp.mi.dwFlags = MOUSEEVENTF_LEFTUP
SendInput(1, inp, size)