Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

CDC::DrawState

Call this member function to display an image and apply a visual effect to indicate a state, such as a disabled or default state.

Note Note

For all nFlag states except DSS_NORMAL, the image is converted to monochrome before the visual effect is applied.

BOOL DrawState( 
   CPoint pt, 
   CSize size, 
   HBITMAP hBitmap, 
   UINT nFlags, 
   HBRUSH hBrush = NULL  
); 
BOOL DrawState( 
   CPoint pt, 
   CSize size, 
   CBitmap* pBitmap, 
   UINT nFlags, 
   CBrush* pBrush = NULL  
); 
BOOL DrawState( 
   CPoint pt, 
   CSize size, 
   HICON hIcon, 
   UINT nFlags, 
   HBRUSH hBrush = NULL  
); 
BOOL DrawState( 
   CPoint pt, 
   CSize size, 
   HICON hIcon, 
   UINT nFlags, 
   CBrush* pBrush = NULL  
); 
BOOL DrawState( 
   CPoint pt, 
   CSize size, 
   LPCTSTR lpszText, 
   UINT nFlags, 
   BOOL bPrefixText = TRUE, 
   int nTextLen = 0, 
   HBRUSH hBrush = NULL  
); 
BOOL DrawState( 
   CPoint pt, 
   CSize size, 
   LPCTSTR lpszText, 
   UINT nFlags, 
   BOOL bPrefixText = TRUE, 
   int nTextLen = 0, 
   CBrush* pBrush = NULL  
); 
BOOL DrawState( 
   CPoint pt, 
   CSize size, 
   DRAWSTATEPROC lpDrawProc, 
   LPARAM lData, 
   UINT nFlags, 
   HBRUSH hBrush = NULL  
); 
BOOL DrawState( 
   CPoint pt, 
   CSize size, 
   DRAWSTATEPROC lpDrawProc, 
   LPARAM lData, 
   UINT nFlags, 
   CBrush* pBrush = NULL  
);
pt

Specifies the location of the image.

size

Specifies the size of the image.

hBitmap

A handle to a bitmap.

nFlags

Flags that specify the image type and state. See DrawState in the Windows SDK for the possible nFlags types and states.

hBrush

A handle to a brush.

pBitmap

A pointer to a CBitmap object.

pBrush

A pointer to a CBrush object.

hIcon

A handle to an icon.

lpszText

A pointer to text.

bPrefixText

Text that may contain an accelerator mnemonic. The lData parameter specifies the address of the string, and the nTextLen parameter specifies the length. If nTextLen is 0, the string is assumed to be null-terminated.

nTextLen

Length of the text string pointed to by lpszText. If nTextLen is 0, the string is assumed to be null-terminated.

lpDrawProc

A pointer to a callback function used to render an image. This parameter is required if the image type in nFlags is DST_COMPLEX. It is optional and can be NULL if the image type is DST_TEXT. For all other image types, this parameter is ignored. For more information about the callback function, see the DrawStateProc function in the Windows SDK.

lData

Specifies information about the image. The meaning of this parameter depends on the image type.

Nonzero if successful; otherwise 0.

Header: afxwin.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.