I thought that would be the solution, but the Snipping Tool grabbed the mouse.
GraphicsWindow.Height = 50
GraphicsWindow.Width = 300
GraphicsWindow.Title = "Catch the mouse"
GraphicsWindow.Show()
While 1 = 1
Program.Delay(20)
GraphicsWindow.Clear()
x = Mouse.MouseX
y = Mouse.MouseY
if x > GraphicsWindow.Left And x < GraphicsWindow.Left + 300 And y > GraphicsWindow.Top And y < GraphicsWindow.Top + 50 Then
Else
Program.Delay(200)
x = Mouse.MouseX
y = Mouse.MouseY
GraphicsWindow.Left = x - 200
GraphicsWindow.Top = y - 30
EndIf
GraphicsWindow.DrawText(1,1 ," Mouse Position X = " + x)
GraphicsWindow.DrawText(1,15," Mouse Position Y = " + y)
EndWhile