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);
}
2007/09/01 22:19 2007/09/01 22:19

Trackbas address :: http://zekill.pe.kr/blog/trackback/35

[로그인][오픈아이디란?]
오픈아이디로만 댓글을 남길 수 있습니다