AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de Windows / Funciones del cursor del ratón
  • Calculating the mouse position
  • Miscellaneous
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Otros
Procedimientos almacenados
Returns and modifies the position of the mouse cursor.
Remark: To get the position of the mouse cursor, it is recommended to use MouseXPos and MouseYPos.
Ejemplo
Res is int = CursorPos(cpClient)
IF Res <> -1 THEN
Message("Position X = " + LoWord(Res) + "Position Y = " + HiWord(Res))
END
Sintaxis
<Result> = CursorPos([<Origine>, ] <X position> , <Y position>)
<Result>: Integer
Position of the mouse (the coordinates are returned by HiWord and LoWord).
  • Current position if <X Position> and <Y Position> are not specified.
  • Previous position if <X Position> and <Y Position> are specified.
  • -1 if an error occurs (position of the mouse outside the requested marker for example).
<Origine>: Optional integer constant
Indicates the origin used to calculate the position:
cpClientMouse position in relation to the client area of the window with focus.
Client Area = window without title bar, menu bar and border.
cpScreen
(Default value)
Position of the mouse in relation to the screen.
cpWindowPosition of the mouse in relation to the window with focus.
<X position>: Real
New horizontal position in the selected marker.
<Y position>: Real
New vertical position in the selected marker.
Observaciones

Calculating the mouse position

To find out the horizontal and vertical position of the mouse from the result, you must use HiWord and LoWord.
The low byte of <Result> is used to get the horizontal position (X) of the mouse.
The high byte of <Result> is used to get the vertical position (Y) of the mouse. If an error occurs, X and Y are equal to -1.
The coordinates are relative to the top left corner of the selected marker.

Miscellaneous

  • MouseXPos and MouseYPos respectively return the horizontal and vertical positions of the mouse in relation to the control where a left mouse click was performed.
  • You can, for example, calculate the position of the mouse cursor in a timer in order to always display this position on the screen.
Componente: wd290std.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 09/04/2024

Señalar un error o enviar una sugerencia | Ayuda local