Hello, need a bit help here,
I have been making a program that can control the mouse via the number pad, similar to Ease of access center from windows.
I have got the maneuver features working, but I am stuck at the click commends.
I want to click the mouse by pressing NumPad5. After doing some googling, here's my attempt:
But it return the following error, what did I do wrong?
A call to PInvoke function 'Mouseboard!Mouseboard.Form1::mouse_event' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
I have been making a program that can control the mouse via the number pad, similar to Ease of access center from windows.
I have got the maneuver features working, but I am stuck at the click commends.
I want to click the mouse by pressing NumPad5. After doing some googling, here's my attempt:
Code:
Public Declare Sub mouse_event Lib "user32." Alias "mouse_event" (ByVal dwFlags As Long)
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
Me.Cursor = New Cursor(Cursor.Current.Handle)
If e.KeyValue = Keys.NumPad5 Then
mouse_event(&H2)
End If
End Sub
Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
Me.Cursor = New Cursor(Cursor.Current.Handle)
If e.KeyValue = Keys.NumPad5 Then
mouse_event(&H4)
End If
End Sub
Quote:
A call to PInvoke function 'Mouseboard!Mouseboard.Form1::mouse_event' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.