warping cursor

Hi, I’m writing a first person shooter game and need to warp the mouse pointer back to a certain spot every time it is moved. I’ve done this using glut before but this time im going to use windows, does anyone know how to do this?

i use this

tagPOINT lpPoint;

GetCursorPos(&lpPoint);
SetCursorPos(300,300);

mousex=(int)lpPoint.x-300;
mousey=(int)lpPoint.y-300;

just what i was looking for thanks!

Little hint - use the SetCursorPos only if your application is in the foreground or do it in response to WM_MOUSEMOVE. It’s just nice to have the ability do pause the game and switch to another application.

tanks for the tip, definitly worth keeping in mind