views:

499

answers:

2

Hi,

I'm writing an application to fully control the mouse click/movement. What I mean is that say for instance, if I have the application running, form fully transparent, fullscreen, then if I click the mouse button, in normal case, it will bring the application in background in focus - I need to stop this from happening (i.e. clicking the button and nothing visible should happen on the screen), as I need to process all the mouse activity and send it out using this application.


I need to write an application which allow 2 mouse to act independently, and im using this as an overlay, creating 2 fake pointers by drawing using C#, whist disabling the real mouse

A: 

What you are referring to is called mouse capture - and it can be done it both Windows Forms as well as WPF and WinAPI directly.

Here's the way to do it in WinForms.

At the WinAPI level you can use the SetCapture( HWND w ) function call.

LBushkin
Hi,In here: Here's the way to do it in WinForms. <-- this actually say that "Also, even if the foreground window has captured the mouse, the user can still click another window, bringing it to the foreground", which is not what I want, what I want is that regardless where/when the button is click, the application would still be in focus/foreground.
A: 

please someone help me, im really clueless as to where to start :(