Page 1 of 1

Cursor move outside the window

Posted: Thu Jan 01, 2026 2:45 pm
by Natter

Happy New Year!

The event of hovering the mouse cursor over the window can be handled using the code block :bMMoved. How can the cursor move event be handled outside the window?


Re: Cursor move outside the window

Posted: Thu Jan 01, 2026 11:12 pm
by Antonio Linares

Dear Yuri,

In that case you have to capture the mouse so the mouse events keep geeting routed to the window:

SetCapture( oWnd:hWnd )

To finally release it:

ReleaseCapture()


Re: Cursor move outside the window

Posted: Fri Jan 02, 2026 7:26 am
by Natter

Antonio, thank you for your reply!
However, I did not understand how to use SetCapture/ReleaseCapture to find out that the mouse cursor has gone beyond the outline of the window. :(


Re: Cursor move outside the window

Posted: Fri Jan 02, 2026 9:29 am
by Antonio Linares

oWnd:bMMoved = { | nRow, nCol, nFlags | IsOverWnd( oWnd:hWnd, nRow, nCol ) }

oWnd:Capture()