mypoint := point(a,b);
myrect := rect(x,y,z,w);
if (a>x) and (a<z) and (b>z) and (b<w) then result := true
 else  result :=false;

解决方案 »

  1.   

    如果我不确定myrect的x,y,z,w该怎么办?
    谢谢
    一定多给你几分
      

  2.   

    用API函数:PtInRectPtInRect
    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. 
    Return Values
    If the specified point lies within the rectangle, the return value is nonzero.If the specified point does not lie within the rectangle, the return value is zero. 
      

  3.   

    if ptinrect(myrect,mypoint) then mypoint在myrect里 
    else mypoint不在myrect里