UINT CBoayoDlg::OnNcHitTest(CPoint point)
{
// TODO: Add your message handler code here and/or call default
RECT rc;
GetWindowRect(&rc);
long x, y;
x = point.x;// + rc.left;
y = point.y;// + rc.top;
if((rc.top <= y) && (y <= rc.top+10))
{
if((rc.left <= x) && (x <= rc.left+10))
{
return HTTOPLEFT;
}
if((rc.right >= x) && (x >= rc.right-10))
{
return HTTOPRIGHT;
}
return HTTOP;
}
if((rc.bottom >= y) && (y >= rc.bottom-10))
{
if((rc.left <= x) && (x <= rc.left+10))
{
return HTBOTTOMLEFT;
}
if((rc.right >= x) && (x >= rc.right-10))
{
return HTBOTTOMRIGHT;
}
return HTBOTTOM;
}
if((rc.left <= x) && (x <= rc.left+10))
{
if((rc.top <= y) && (y <= rc.top+10))
{
return HTTOPLEFT;
}
if((rc.bottom >= y) && (y >= rc.bottom-10))
{
return HTBOTTOMLEFT;
}
return HTLEFT;
}
if((rc.right >= x) && (x >= rc.right-10))
{
if((rc.top <= y) && (y <= rc.top+10))
{
return HTTOPRIGHT;
}
if((rc.bottom >= y) && (y >= rc.bottom-10))
{
return HTBOTTOMRIGHT;
}
return HTRIGHT;
}
return CDialog::OnNcHitTest(point);
}
{
// TODO: Add your message handler code here and/or call default
RECT rc;
GetWindowRect(&rc);
long x, y;
x = point.x;// + rc.left;
y = point.y;// + rc.top;
if((rc.top <= y) && (y <= rc.top+10))
{
if((rc.left <= x) && (x <= rc.left+10))
{
return HTTOPLEFT;
}
if((rc.right >= x) && (x >= rc.right-10))
{
return HTTOPRIGHT;
}
return HTTOP;
}
if((rc.bottom >= y) && (y >= rc.bottom-10))
{
if((rc.left <= x) && (x <= rc.left+10))
{
return HTBOTTOMLEFT;
}
if((rc.right >= x) && (x >= rc.right-10))
{
return HTBOTTOMRIGHT;
}
return HTBOTTOM;
}
if((rc.left <= x) && (x <= rc.left+10))
{
if((rc.top <= y) && (y <= rc.top+10))
{
return HTTOPLEFT;
}
if((rc.bottom >= y) && (y >= rc.bottom-10))
{
return HTBOTTOMLEFT;
}
return HTLEFT;
}
if((rc.right >= x) && (x >= rc.right-10))
{
if((rc.top <= y) && (y <= rc.top+10))
{
return HTTOPRIGHT;
}
if((rc.bottom >= y) && (y >= rc.bottom-10))
{
return HTBOTTOMRIGHT;
}
return HTRIGHT;
}
return CDialog::OnNcHitTest(point);
}