Constraining the cursor

Hi
   -does anyone know how to constrain the mouse cursor to a
NON-RECTANGULAR region ? I've set my program up to ignore any mouse clicks
in forbidden areas, but I'd rather the user wasn't able to get his cursor
there at all.

thanks

Gordon Cooper