开发者

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 开发者_StackOverflow中文版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


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.


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


Try SetCapture() / ReleaseCapture().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜