Re: getting mouse messages when mouse is outside of my window
=A9koda wrote:
> Does anybody know how do I still receive mouse
> messages even if the mouse is not in my window?
> For example, if you draw a line in PaintShopPro
> drawing program, you can go anywhere on screen
> with your mouse while you have left mouse button
> down, and the line will follow you.
Thomas was right about GetCursorPos, but dragging the mouse (holding down
the left button and moving the mouse) is a special case in Windows. For t=
his
case, you can use captureMouse, which does works by calling the Win32
SetCapture routine. All mouse events will be returned to your window, as
long as the mouse is being dragged (left button is held down).
There _is_ an exception to this, but it's a quite rare. If a modal dialog
box comes up, it can capture the mouse from you, even if you've grabbed t=
he
mouse. In these cases, it will first issue a WM_CAPTURECHANGED event to y=
our
application to warn you that you are about to lose the mouse. I only ment=
ion
this for completeness; I doubt it will happen in reality.
-- David Cuny
|
Not Categorized, Please Help
|
|