void Cxxx::OnRButtonUp(UINT nFlags, CPoint point) 
{
CRect rect;
CStatic* p_bitmap=(CStatic*)GetDlgItem(IDC_PHOTO_ICON);
p_bitmap->GetClientRect(&rect);        rect.NormalizeRect(); if (rect.PtInRect(point))
{
.....           不知道相对坐标之类的东东,怎么可以使点和控件IDC_PHOTO_ICON获得一致的参考坐标????

解决方案 »

  1.   

    你的代码我不是很理解。要是我做,我就会:
    RECT rect;
    GetWindowRect(&rect);
    ScreenToClient(&rect);
    判断点的话,就这样咯
    if(point.x>=rect.left&&point.x<=rect.right&&point.y>=rect.top&&point.y<=rect.bottom)
    {
    ...
    }
      

  2.   

    GetClientRect ==> GetWindowRect.
      

  3.   

    void CPtInRectDlg::OnRButtonUp(UINT nFlags, CPoint point) 
    {
    CRect rect;
    CStatic* p_bitmap=(CStatic*)GetDlgItem(IDC_PHOTO_ICON);
    p_bitmap->GetWindowRect(&rect);
    ScreenToClient(&rect); if (rect.PtInRect(point))
    {
    MessageBox("ok");
    } CDialog::OnRButtonUp(nFlags, point);
    }