Keeping the mouse inside the window

BlitzMax Forums/BlitzMax Programming/Keeping the mouse inside the window

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

So pursuant to my totally awesome game, I need a way to keep the mouse inside the game window, so you don't click outside and lose focus. I don't want to do the old movemouse width/2,height/2 trick because that's laggy and rubbish. I assume there's something in the winAPI that lets you get the screen position of the mouse, but I've got no experience with that sort of stuff at all. Any ideas?