Page 1 of 1

Cursor Click?

Posted: Wed Apr 28, 2010 5:44 am
by Livengood
how would you make your cursor click? without clicking the mouse

Re: Cursor Click?

Posted: Fri Apr 30, 2010 4:46 am
by mikethedj4
Are you talking about an autoclicker, like I made here???

Re: Cursor Click?

Posted: Mon May 03, 2010 1:53 am
by Livengood
yes, but i need just a click

Re: Cursor Click?

Posted: Mon May 03, 2010 1:31 pm
by mandai
Code: Select all

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)