Code : Tout sélectionner
If OpenWindow(0, 0, 0, 80, 40, #PB_Window_SystemMenu | #PB_Window_ScreenCentered, "Position")
If CreateGadgetList(WindowID())
TextGadget(1, 5, 5, 50, 15, "")
TextGadget(2, 5, 25, 50, 15, "")
Repeat
Event = WindowEvent()
; position de la souris
GetCursorPos_(CursorPos.Rect)
MouseX = CursorPos\Left
MouseY = CursorPos\Top
SetGadgetText(1, "X = " + Str(MouseX))
SetGadgetText(2, "Y = " + Str(MouseY))
updatewindow_(WindowID())
Delay(50)
Until Event = #WM_Close
EndIf
EndIf