If you only want to move the mouse programmatically within a restricted rectangle, then tell us where you're stuck in this process.

If you want to prevent the user from moving the mouse outside of...