Disable default click event (WinAPI)

I am making a color dropper tool, and while this tool is active, when the user clicks or selects, I only want it to fire my mouse event, and not something else, so while this tool works, if the user clicks the start orb button, he should not open the start menu (or if the user clicks on anything else). How can i do this?

thank

+3
source share
3 answers

You can implement a system-wide mouse hook. Hooks are described here . Depending on your return value, the application under the cursor will accept or not accept the mouse event. You may need to implement a low-level mouse hook to catch mouse clicks. The hook function must also be provided with the coordinates of the screen of the mouse cursor.

+1
source

Try SetCapture()/ ReleaseCapture().

0
source

Create a transparent screen size window that you set on top of all other windows.

0
source

Source: https://habr.com/ru/post/1762563/


All Articles