ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Mouse functions
  • Capturing the mouse
CursorCapture (Example)
Capturing the mouse
The following example is used to capture:
  • the left mouse button down,
  • the right mouse button up,
  • the move of the mouse.
From the moment the mouse button is pressed until it is released, the mouse events are re-directed to the window. The mouse position is displayed in the status bar.
// Create a button with the following code on the click
Event("CursorStart", "*.", 513)  // WM_LBUTTONDOWN
Event("Cursor", "*.", 512)       // WM_MOUSEMOVE
Event("CursorEnd", "*.", 514)    // WM_LBUTTONUP
PROCÉDURE CursorStart
CursorCapture()
PROCÉDURE Cursor
Pos is int
Pos = CursorPos(cpScreen)
Message(LoWord(Pos) + " " + HiWord(Pos))
PROCÉDURE CursorEnd
CursorCapture(False)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help