the window kind of spazzes out if I set it to MouseX, MouseY
I'd imagine, since on moving the window the relative coordinates of the mouse change.
Use absolute mouse position instead
EDIT: http://www.udec.cl/~jfuente_alba/dragwindow.cap yup, it works. Can't get the window edge sizes though, so it jumps a bit on grab. Guess that could be fixed too somehow.
EDIT2: removed window frame thus no jump. Any key to get rid of the flashing annoyance.