Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CDC::DrawFocusRect
Collapse the table of content
Expand the table of content

CDC::DrawFocusRect

Draws a rectangle in the style used to indicate that the rectangle has the focus.

void DrawFocusRect( 
   LPCRECT lpRect  
);

lpRect

Points to a RECT structure or a CRect object that specifies the logical coordinates of the rectangle to be drawn.

Since this is a Boolean XOR function, calling this function a second time with the same rectangle removes the rectangle from the display. The rectangle drawn by this function cannot be scrolled. To scroll an area containing a rectangle drawn by this function, first call DrawFocusRect to remove the rectangle from the display, then scroll the area, and then call DrawFocusRect again to draw the rectangle in the new position.

Caution note Caution

DrawFocusRect works only in MM_TEXT mode. In other modes, this function does not draw the focus rectangle correctly, but it does not return error values.

Header: afxwin.h

Show:
© 2015 Microsoft