I am attempting to control two “mice”. The primary mouse (mice) are used for controlling the cursor for normal UI control (which I don’t want to intercept) and a secondary “mouse” which should only be used as input into the application I am writing and ignored otherwise.
I am successfully capturing the mouse messages and filtering as desired. I can also successfully capture the mouse inputs,even when my app is not in focus (as desired).
The only remaining issue is that I can’t seem to keep the mouse from interacting with other applications. So I can essentially spy on the mouse, but not fully consume the message.
I “believe” I am preventing the “base.WndProc(ref message)” from getting called when I am processing the filtered mouse messages, but the system still seems to be getting the mouse clicks.
Is C# (Visual Studio Express 2010) able to do this?
Thank you for any assistance you might be able to give.
Raw input might be what you’re looking for.
Here is an MSDN discussion with a similar question which has link to a codeproject article on handling mutliple keyboards in C#.