共用方式為


COleControl::OnQueryHitRect

Called by the framework in response to a container's IViewObjectEx::QueryHitRect request.

virtual BOOL OnQueryHitRect(
   DWORD dwAspect,
   LPCRECT pRectBounds,
   LPCRECT prcLoc,
   LONG lCloseHint,
   DWORD* pHitResult 
);

Parameters

  • dwAspect
    Specifies how the object is to be represented. Valid values are taken from the enumeration DVASPECT or DVASPECT2.

  • pRectBounds
    Pointer to a RECT structure specifying the bounding rectangle of the OLE control client area.

  • prcLoc
    Pointer to the RECT structure specifying the rectangle to be checked for a hit (overlap with the object rectangle), relative to the upper left corner of the object.

  • lCloseHint
    Not used.

  • pHitResult
    Pointer to the result of the hit query. One of the following values:

    • HITRESULT_OUTSIDE   no point in the rectangle is hit by the OLE object.

    • HITRESULT_HIT   at least one point in the rectangle would be a hit on the object.

Return Value

Nonzero if a hit result is successfully returned; otherwise 0.

Remarks

Queries whether an object's display rectangle overlaps any point in the given rectangle (hits the rectangle). QueryHitRect can be overridden to test hits for non-rectangular objects.

Requirements

Header: afxctl.h

See Also

Concepts

COleControl Class

COleControl Members

Hierarchy Chart

COleControl::OnQueryHitPoint