I cannot seem to figure out what problem I have here. This code works on any NON-NT/2000 pc. Im getting the error on the sendinput API call.



Dim x As Long
Dim inputevents(0 To 1) As INPUT_TYPE
Dim keyevent As KEYBDINPUT
Dim mouseevent As MOUSEINPUT

mouseevent.dx = 0
mouseevent.dy = 0
mouseevent.mouseData = 0
mouseevent.dwFlags = MOUSEEVENTF_LEFTDOWN
mouseevent.time = 0
mouseevent.dwExtraInfo = 0
inputevents(0).dwType = INPUT_MOUSE

CopyMemory inputevents(0).xi(0),mouseevent,Len(mouseevent)

mouseevent.dx = 0
mouseevent.dy = 0
mouseevent.mouseData = 0
mouseevent.dwFlags = MOUSEEVENTF_LEFTUP
mouseevent.time = 0
mouseevent.dwExtraInfo = 0
inputevents(1).dwType = INPUT_MOUSE

CopyMemory inputevents(1).xi(0),mouseevent,Len(mouseevent)

x = SendInput(2, inputevents(0), Len(inputevents(0)))