本帖最后由 didilc 于 2011-03-22 14:29:11 编辑

解决方案 »

  1.   

    Rect rect
    m_stPicture->GetWindowRect(&rect);PtInRect(mousePt, rect);
      

  2.   

    PtInRect
    The PtInRect function determines whether the specified point lies within the specified rectangle. A point is within a rectangle if it lies on the left or top side or is within all four sides. A point on the right or bottom side is considered outside the rectangle. BOOL PtInRect(
      CONST RECT *lprc,  // rectangle
      POINT pt           // point
    );
    Parameters
    lprc 
    [in] Pointer to a RECT structure that contains the specified rectangle. 
    pt 
    [in] Specifies a POINT structure that contains the specified point. 
      

  3.   


    CRect rect;
    m_stPicture.GetWindowRect(&rect);
    ScreenToClient(&rect);
    if (point.x >rect.left && point.x <rect.right &&point.y > rect.top && point.y <rect.bottom)
    {
    MessageBox("框内");
    }