|
|
@@ -603,73 +603,73 @@ LRESULT CMainWnd::OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHand
|
|
|
|
|
|
LRESULT CMainWnd::OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
|
|
{
|
|
|
- POINT pt;
|
|
|
- pt.x = GET_X_LPARAM(lParam);
|
|
|
- pt.y = GET_Y_LPARAM(lParam);
|
|
|
- ::ScreenToClient(*this, &pt);
|
|
|
- RECT rcClient;
|
|
|
- ::GetClientRect(*this, &rcClient);
|
|
|
-
|
|
|
- if(!::IsZoomed(*this))
|
|
|
- {
|
|
|
- RECT rcSizeBox = m_pm.GetSizeBox();
|
|
|
+ POINT pt;
|
|
|
+ pt.x = GET_X_LPARAM(lParam);
|
|
|
+ pt.y = GET_Y_LPARAM(lParam);
|
|
|
+ ::ScreenToClient(*this, &pt);
|
|
|
+ RECT rcClient;
|
|
|
+ ::GetClientRect(*this, &rcClient);
|
|
|
|
|
|
- if(pt.y < rcClient.top + rcSizeBox.top)
|
|
|
- {
|
|
|
- if(pt.x < rcClient.left + rcSizeBox.left)
|
|
|
- {
|
|
|
- return HTTOPLEFT;
|
|
|
- }
|
|
|
+ if (!::IsZoomed(*this))
|
|
|
+ {
|
|
|
+ RECT rcSizeBox = m_pm.GetSizeBox();
|
|
|
|
|
|
- if(pt.x > rcClient.right - rcSizeBox.right)
|
|
|
- {
|
|
|
- return HTTOPRIGHT;
|
|
|
- }
|
|
|
+ if (pt.y < rcClient.top + rcSizeBox.top)
|
|
|
+ {
|
|
|
+ if (pt.x < rcClient.left + rcSizeBox.left)
|
|
|
+ {
|
|
|
+ return HTTOPLEFT;
|
|
|
+ }
|
|
|
|
|
|
- return HTTOP;
|
|
|
- }
|
|
|
- else if(pt.y > rcClient.bottom - rcSizeBox.bottom)
|
|
|
- {
|
|
|
- if(pt.x < rcClient.left + rcSizeBox.left)
|
|
|
- {
|
|
|
- return HTBOTTOMLEFT;
|
|
|
- }
|
|
|
+ if (pt.x > rcClient.right - rcSizeBox.right)
|
|
|
+ {
|
|
|
+ return HTTOPRIGHT;
|
|
|
+ }
|
|
|
|
|
|
- if(pt.x > rcClient.right - rcSizeBox.right)
|
|
|
- {
|
|
|
- return HTBOTTOMRIGHT;
|
|
|
- }
|
|
|
+ return HTTOP;
|
|
|
+ }
|
|
|
+ else if (pt.y > rcClient.bottom - rcSizeBox.bottom)
|
|
|
+ {
|
|
|
+ if (pt.x < rcClient.left + rcSizeBox.left)
|
|
|
+ {
|
|
|
+ return HTBOTTOMLEFT;
|
|
|
+ }
|
|
|
|
|
|
- return HTBOTTOM;
|
|
|
- }
|
|
|
+ if (pt.x > rcClient.right - rcSizeBox.right)
|
|
|
+ {
|
|
|
+ return HTBOTTOMRIGHT;
|
|
|
+ }
|
|
|
|
|
|
- if(pt.x < rcClient.left + rcSizeBox.left)
|
|
|
- {
|
|
|
- return HTLEFT;
|
|
|
- }
|
|
|
+ return HTBOTTOM;
|
|
|
+ }
|
|
|
|
|
|
- if(pt.x > rcClient.right - rcSizeBox.right)
|
|
|
- {
|
|
|
- return HTRIGHT;
|
|
|
- }
|
|
|
- }
|
|
|
+ if (pt.x < rcClient.left + rcSizeBox.left)
|
|
|
+ {
|
|
|
+ return HTLEFT;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pt.x > rcClient.right - rcSizeBox.right)
|
|
|
+ {
|
|
|
+ return HTRIGHT;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- RECT rcCaption = m_pm.GetCaptionRect();
|
|
|
+ RECT rcCaption = m_pm.GetCaptionRect();
|
|
|
|
|
|
- if(pt.x >= rcClient.left + rcCaption.left && pt.x < rcClient.right - rcCaption.right \
|
|
|
- && pt.y >= rcCaption.top && pt.y < rcCaption.bottom)
|
|
|
- {
|
|
|
- CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(pt));
|
|
|
+ if (pt.x >= rcClient.left + rcCaption.left && pt.x < rcClient.right - rcCaption.right \
|
|
|
+ && pt.y >= rcCaption.top && pt.y < rcCaption.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;
|
|
|
- }
|
|
|
- }
|
|
|
+ if (pControl && _tcscmp(pControl->GetClass(), L"ButtonUI") != 0 &&
|
|
|
+ _tcscmp(pControl->GetClass(), L"OptionUI") != 0 &&
|
|
|
+ _tcscmp(pControl->GetClass(), L"TextUI") != 0)
|
|
|
+ {
|
|
|
+ return HTCAPTION;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- return HTCLIENT;
|
|
|
+ return HTCLIENT;
|
|
|
}
|
|
|
|
|
|
LRESULT CMainWnd::OnInput(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|