Sets and releases exclusive mouse input which can be limited to a specific window.
ReleaseCapture
SetCapture wh%
wh%:integer expression
SetCapture redirects all mouse events - regardless of how many windows are currently open - to the window with the number wh% (0..31) or API handle. For a Form object use the hWnd property.
SetCapture can only be invoked for one single window at any one time. If the mouse input is to be redirected to another window, the command ReleaseCapture must first be called for the current (mouse) window and then SetCapture for the new window.
ReleaseCapture redirects the mouse input back to the corresponding window (the window with the mouse pointer).
OpenW 1 : Win_1.Caption = Win_1.Name
OpenW 2 : Win_2.Caption = Win_2.Name
SetCapture 1// or Win_1.hWnd
Do
Sleep
If MouseK %& 1
Print MouseX, MouseY
EndIf
Until MouseK %& 2 'press right mouse button
ReleaseCapture
CloseW 2
CloseW 1
Causes all mouse-input to be sent only to window 1 until right mouse button is pressed
SetCapture and ReleaseCapture correspond to Windows function SetCapture() and ReleaseCapture respectively.
-
{Created by Sjouke Hamstra; Last updated: 22/10/2014 by James Gaite}