PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • 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
PROCEDURE CursorStart
CursorCapture()
PROCEDURE Cursor
Pos is int
Pos = CursorPos(cpScreen)
Message(LoWord(Pos) + " " + HiWord(Pos))
PROCEDURE CursorEnd
CursorCapture(False)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment