Поделиться через


CBrush::operator HBRUSH

Use this operator to get the attached Windows GDI handle of the CBrush object.

operator HBRUSH( ) const;

Возвращаемое значение

If successful, a handle to the Windows GDI object represented by the CBrush object; otherwise NULL.

Заметки

This operator is a casting operator, which supports direct use of an HBRUSH object.

For more information about using graphic objects, see Graphic Objects in the Windows SDK.

Пример

RECT rc = { 50, 50, 200, 200 };

Rectangle(pDC->GetSafeHdc(), rc.left, rc.top, rc.right, rc.bottom);

// The Win32 call to FillRect requires an HBRUSH.
// The HBRUSH operator casts the CBrush object
// to the required type.
CBrush brush;
brush.CreateSysColorBrush(COLOR_BTNFACE);
FillRect(pDC->GetSafeHdc(), &rc, (HBRUSH)brush);

Требования

Header: afxwin.h

См. также

Основные понятия

CBrush Class

CBrush Members

Hierarchy Chart