Click to See Complete Forum and Search --> : Mouse coordinates in lParam - screen/client


rsmemphis
April 23rd, 2003, 06:51 AM
I noticed something odd last night, and I want to share it.

I wrote a little program that displays a bitmap in its entire client area, and made it so that all non-active parts can be used to move the window.

Now, I catch WM_NCHITEST, and as expected, lParam includes the coordinates in screen coordinates. So, depending on where that is, I return HTCLIENT.
In which case, I receive the WM_LBUTTONDOWN notification. Now here is the odd part - I expected the coordinates again to be relative to the screen, but they got translated into client coordinates - not what MSDN made me believe.

Now, the weirdest thing is that I wrote an MFC program a little while ago, where I handled OnLButtonDown() myself, and there, the coordinates where screen coordinates again.