DrawStateW function (winuser.h)
The DrawState function displays an image and applies a visual effect to indicate a state, such as a disabled or default state.
Syntax
BOOL DrawStateW(
[in] HDC hdc,
[in] HBRUSH hbrFore,
[in] DRAWSTATEPROC qfnCallBack,
[in] LPARAM lData,
[in] WPARAM wData,
[in] int x,
[in] int y,
[in] int cx,
[in] int cy,
[in] UINT uFlags
);
Parameters
[in] hdc
A handle to the device context to draw in.
[in] hbrFore
A handle to the brush used to draw the image, if the state specified by the fuFlags parameter is DSS_MONO. This parameter is ignored for other states.
[in] qfnCallBack
A pointer to an application-defined callback function used to render the image. This parameter is required if the image type in fuFlags 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] lData
Information about the image. The meaning of this parameter depends on the image type.
[in] wData
Information about the image. The meaning of this parameter depends on the image type. It is, however, zero extended for use with the DrawStateProc function.
[in] x
The horizontal location, in device units, at which to draw the image.
[in] y
The vertical location, in device units, at which to draw the image.
[in] cx
The width of the image, in device units. This parameter is required if the image type is DST_COMPLEX. Otherwise, it can be zero to calculate the width of the image.
[in] cy
The height of the image, in device units. This parameter is required if the image type is DST_COMPLEX. Otherwise, it can be zero to calculate the height of the image.
[in] uFlags
The image type and state. This parameter can be one of the following type values.
This parameter can also be one of the following state values.
For all states except DSS_NORMAL, the image is converted to monochrome before the visual effect is applied.
Return value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Remarks
Note
The winuser.h header defines DrawState as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | winuser.h (include Windows.h) |
Library | User32.lib |
DLL | User32.dll |