GoldStone32767
asked on
Send Mouse Click to DirectX app
Im trying to send a mouse click to a certain area in a directx game. Generating a mouse click in any other app (not DX) works fine with this code:
Call PostMessage(CLng(param(1)) , WM_LBUTTONDOWN, 1, CLng(param(2)) + CLng(param(3)) * &H10000)
Call PostMessage(CLng(param(1)) , WM_LBUTTONUP, 1, CLng(param(2)) + CLng(param(3)) * &H10000)
I even used Spy++ and the MouseClicks do not register. MouseMove and KeyPress all come through, but mouse clicks dont.
Any idea how i can generate a mouseclick on a DX app. thx
Call PostMessage(CLng(param(1))
Call PostMessage(CLng(param(1))
I even used Spy++ and the MouseClicks do not register. MouseMove and KeyPress all come through, but mouse clicks dont.
Any idea how i can generate a mouseclick on a DX app. thx
Public objDX As New DirectX8
Public objDI As DirectInput8
Set objDIDev = objDI.CreateDevice("guid_S ysMouse")
Call objDIDev.SetCommonDataForm at(DIFORMA T_MOUSE)
Call objDIDev.SetCooperativeLev el(frmCanv as.hwnd, _
DISCL_FOREGROUND Or DISCL_EXCLUSIVE)
You need DIRECTINPUT Class Functions to handle mouse events in your game.
Public objDI As DirectInput8
Set objDIDev = objDI.CreateDevice("guid_S
Call objDIDev.SetCommonDataForm
Call objDIDev.SetCooperativeLev
DISCL_FOREGROUND Or DISCL_EXCLUSIVE)
You need DIRECTINPUT Class Functions to handle mouse events in your game.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If it is via the DIRECTINPUT device, that the event will not be got and thus handled.
Bye,
Max