Not being entirely familiar with programming GUIs in C++ and whatnot, I’m running into a problem where my program will not respond to a left-mouse click after moving/dragging the application window. What should I do to make it work properly? Here is how I am handling the left-click message in the callback function:
case WM_LBUTTONDOWN:
{
POINT point;
GetCursorPos(&point);
break;
}
The mouse location is included in the message as the LPARAM.
As documented at MSDN, the point is relative to the upper left corner of the client area. Therefore if you move the window,
pointwill still be relative to your window.GetCursorPos gets the position of the cursor in screen coordinates. So you would have to compensate for the position of your window on the screen to get a usable position.