The 'onMove' event fires while the window is being moved. A solution to control the window position is to write some code in 'onMove' event.
$.extend($.fn.window.defaults, {
onMove: function(left,top){
if (left<0){
$(this).window('move',{
left:0
});;
}
if (top < 0){
$(this).window('move',{
top:0
});;
}
}
});