Click to See Complete Forum and Search --> : WM_LBUTTONUP outside the client's area


Remek Zajac
April 8th, 1999, 01:11 PM
Hi

Gotta little problem that cannot be much illustrated with a code sample, still:

I need to to get a WM_LBUTTONUP message whilst the mouse cursor is outside my window (i.e.: somewhere over the desktop).
Obviously i do capture the mouse ::SetCapture(hwnd).

When the mouse is within my client's area everything works fine, but once i press and hold the left button outside the client's area both WM_LBUTTONDOWN and WM_LBUTTONUP come to me at once, regardless the mouse button is kept pressed.

anyone met this before?
HELP!

thanks in advance.
Rem.

Remek Zajac
April 10th, 1999, 06:17 PM
Selfanswering :)

In case someone finds it interesting (annoying?)

"if the mouse has been captured and the mouse button is not currently down, and the mouse cursor passes over another window, the window underneath the cursor will receive the mouse messages rather than the window that captured the mouse"
Charles Petzold "Programming Windows 95"

I don't mind another window to receive the message, unless i get it too. Everything is possible, but i aint got the know-how.
Still, the given explanation doesn't quite suit the "abnormal" behaviour, for i do get the WM_LBUTTONUP, only that in the wrong moment.
Like the system was predicting that i would release the button sooner or later. If it only could predict the coordinates of the eventual release as well - sorry for sarcasm.

Anyone?
Rem