Locking mouse on one screen [solved]

Started by
4 comments, last by Evil Steve 14 years, 11 months ago
Hi, I'm developing a DirectX full-screen application. I want to avoid that the mouse leaves the primary screen on dual-screen configuration. I tried to use the WM_MOUSELEAVE event to force the mouse position at application edges when the mouse goes out, but it is not satisfactory, as I can see the cursor being "caught back" to the main screen. Also, this make impossible to ALT-TAB/minimize the application. Any idea ? Thanks, K.
Advertisement
Try ClipCursor:

http://weseetips.com/2008/07/01/how-to-restrict-mouse-cursor-inside-window/
scottrick49
Works great !
Thanks !
Quote:Original post by Kiristu
Also, this make impossible to ALT-TAB/minimize the application.
Why on earth do you want to do this? There's always ways around this (Ctrl+alt+del anyone?) and you're just going to annoy the hell out of the user.
I don't want to prevent alt+tab etc !
This was a side effect of my first try with WM_MOUSELEAVE.

ClipCursor works perfectly.
Quote:Original post by Kiristu
I don't want to prevent alt+tab etc !
This was a side effect of my first try with WM_MOUSELEAVE.

ClipCursor works perfectly.
Whoops, I need to learn to read better [smile]

This topic is closed to new replies.

Advertisement