POINT pt; pt.x = GET_X_LPARAM(lParam); pt.y = GET_Y_LPARAM(lParam);
::ScreenToClient(*this, &pt);
RECT rcClient;
::GetClientRect(*this, &rcClient);
RECT rcCaption = m_pm.GetCaptionRect();
if (pt.x >= rcClient.left && pt.x < rcClient.right && pt.y >= rcClient.top && pt.y < rcClient.bottom) {
CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(pt));
if (pControl && _tcscmp(pControl->GetClass(), DUI_CTR_BUTTON) != 0 &&
_tcscmp(pControl->GetClass(), DUI_CTR_OPTION) != 0 &&
_tcscmp(pControl->GetClass(), DUI_CTR_TEXT) != 0)
return HTCAPTION;
}
return HTCLIENT;