Hey:)
I'm not actually sure what it's called..so just calling it "mouse window locking" - What i mean by this is how do you lock the mouse to a window ie: The mouse can not leave the window unless you alt tab. So when the user drags the mouse to the edge of the window it will not leave the window it will just stop at the window's max cords. If that makes sense?:P I'm following the OpenGL tutorials on Nehe Help would be much appreciated:)
BradenMurphy
0
Light Poster
Recommended Answers
Jump to PostI assume you mean in MS-Windows operating system. You would not want to do that even if you could because it would not allow the user to easily select a different desktop icon, the start menu, or any of the icons in the desktop trey. And that would piss off …
Jump to PostRECT r; GetWindowRect( hwnd, &r); ClipCursor( &r );
Replace hwnd with whatever the window is called, and you're done.
Jump to PostAlso for anyone reading this post. You will need to set the ClipCursor inside a loop to constantly update that cursor is infact still inside the window
No, you just have to freeze the thread after you've called it, you don't have to keep calling it. Example:
All 10 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
BradenMurphy
0
Light Poster
William Hemsworth
1,339
Posting Virtuoso
Emin_3
commented:
Thanks. It works..
+0
BradenMurphy
0
Light Poster
BradenMurphy
0
Light Poster
William Hemsworth
1,339
Posting Virtuoso
BradenMurphy
0
Light Poster
BradenMurphy
0
Light Poster
William Hemsworth
1,339
Posting Virtuoso
BradenMurphy
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.