WindowMouseX()
语法
x = WindowMouseX(#Window)概要
Returns the mouse x position in the inner area of the specified window.
参数
#Window The window to use.
返回值
The mouse x position in the inner area of the given window. If the mouse is outside of the window area, it will return -1.
Remarks
To get the absolute x position of the mouse on the desktop, use DesktopMouseX().
示例
If OpenWindow(0, 0, 0, 300, 30, "Window mouse monitor", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) TextGadget(0, 10, 6, 200, 20, "") Repeat Event = WaitWindowEvent(20) ; return at least every 20ms for an update SetGadgetText(0, "Window mouse position: " + Str(WindowMouseX(0)) + "," + Str(WindowMouseY(0))) Until Event = #PB_Event_CloseWindow EndIf
已支持操作系统
所有