Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Guys

i m using API function to send right-click mouse with SendInput But Return Zero and not do it.

if anybody try to do it please help me

What I have tried:

VB
Type INPUT
dwType As Long
mi(0 To 10) As Byte
End Type

Type MOUSEINPUT
dwFlage As Long
dx As Long
dy As Long
End Type


dim inputStruct(0 To 1) As INPUT
dim MInput A MOUSEINPUT
inputStruct(0).dwType=0
Minput.dx=100
Minput.dy=200
Minput.dwFlags=10

Copymem instruct(0).mi(0),Minput,Len(Minput)

inputStruct(1).dwType=0
Minput.dx=100
Minput.dy=200
Minput.dwFlags=10

Copymem instruct(1).mi(0),Minput,Len(Minput)

SendInput 2,inputStruct(0).mi(0),Len(inputStruct(0))
Posted
Updated 4-Jan-22 2:50am
v2
Comments
0x01AA 4-Jan-22 8:50am    
I think this ...
SendInput 2,inputStruct(0).mi(0),Len(inputStruct(0))
... should be
SendInput 2,inputStruct(0),Len(inputStruct(0))
0x01AA 4-Jan-22 15:48pm    
and?
[no name] 5-Jan-22 3:39am    
no any action i have used even

Public Declare PtrSafe Function SendInput Lib "user32" (byVal nInput As Long,pinputs As MOUSEINPUT,cbSize as any)

Type MOUSEINPUT
dwType As Long
dwFlags As Long
dx As Long
dy As Long
End Type


Arr(0) As MOUSEINPUT
Arr(0).dwType=0 ' Mouse
Arr(0).dx=200
Arr(0).dy=200
Arr(0).dwFlags=&H8

SendInput &1,Arr(0),Len(Arr(0))

Arr(0).dwType=0 ' Mouse
Arr(0).dx=200
Arr(0).dy=200
Arr(0).dwFlags=&H10

SendInput &1,Arr(0),Len(Arr(0))


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900