CBrush::operator HBRUSH
Consente di ottenere un handle connessione di Windows GDI dell'oggetto CBrush.
operator HBRUSH( ) const;
Valore restituito
Se l'operazione riesce, un handle per l'oggetto Windows GDI rappresentato dall'oggetto CBrush ; in caso contrario NULL.
Note
Questo operatore è un operatore di cast, che supporta i l'utilizzo di un oggetto HBRUSH.
Per ulteriori informazioni sull'utilizzo degli oggetti grafici, vedere oggetti grafici in Windows SDK.
Esempio
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);
Requisiti
Header: afxwin.h