Using the position mouse command would not be very smooth because the mouse would not be repositioned quickly enough and would jitter.
I would probably solve this by hiding the mouse and placing my own sprite where the mouse co-ordinates are, combining that with the position mouse command would negate the jitter of the mouse leaving the window.
You could also use the Windows dll's as IanM suggested, I wonder what would happen if the program later crashes?

God created the world in 7 days, but we're still waiting for the patch.