jmasterx
jmasterx

Reputation: 54193

Prevent default click event (WinAPI)

I'm making a color dropper tool and while this tool is active, when the user clicks or taps I only want it to run my mouse event, not anything else,so while this tool is running,if the user clicks the start orb, it should not open the start menu (or if the user clicks anything else). How could I do this?

Thanks

Upvotes: 3

Views: 433

Answers (3)

twf
twf

Reputation: 619

Try SetCapture() / ReleaseCapture().

Upvotes: 0

Frederik Slijkerman
Frederik Slijkerman

Reputation: 6529

Create a screen-sized transparent window that you put on top of all other windows.

Upvotes: 0

dreamlax
dreamlax

Reputation: 95405

You could implement a system-wide mouse event hook. Hooks are described here. Depending on your hook's return value, the application underneath the cursor will or will not receive the mouse event. You may need to implement a low level mouse hook in order to catch mouse clicks. The hook function should also be provided with the screen coordinates of the mouse cursor.

Upvotes: 1

Related Questions