Way to detect if window is dragged?

BlitzMax Forums/BlitzMax Programming/Way to detect if window is dragged?

In the end I check the window position before the timing loop begins, and if the position has changed I reset the timing variables:

Type TRect
	Field L%, T%, R%, B%
End Type

Function ccWindowPosition:TRect()
	Local hWnd% = GetActiveWindow()
	Local window:TRect= New TRect
	GetWindowRect(hWnd,window)
	Return window	
End Function

'Quickly check to see if the window has moved.
'If it has, this is because the user has dragged it and so we should
'reset the timing variables.
Local Rect:TRect = ccWindowPosition()
If Owner.WindowX <> Rect.L Or Owner.WindowY <> Rect.T Then
        Init() 'reset timing variables
	Owner.SetWindowCoords()
EndIf