Cursor Click?

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
4 posts Page 1 of 1
Contributors
User avatar
Livengood
Serious Programmer
Serious Programmer
Posts: 445
Joined: Tue Feb 16, 2010 6:24 am

Cursor Click?
Livengood
how would you make your cursor click? without clicking the mouse
Image
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

Re: Cursor Click?
mikethedj4
Are you talking about an autoclicker, like I made here???
User avatar
Livengood
Serious Programmer
Serious Programmer
Posts: 445
Joined: Tue Feb 16, 2010 6:24 am

Re: Cursor Click?
Livengood
yes, but i need just a click
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Cursor Click?
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)

4 posts Page 1 of 1
Return to “Tutorial Requests”