The driver must deal with brushes differently than in Windows 3.x. After an Enable function call, GDI calls the driver RealizeObject function twice with an OBJ_BRUSH argument: the first time to get size information and the second time to realize the brush. Under Windows 3.x the driver returned only a TRUE or FALSE value on the second call. Under Windows 95, upon success, the driver must return a WORD with two or more of the following bits set:
Bit Setting | Description |
---|---|
PBF_SOLIDCLRBRUSH | A solid (not dithered) brush was realized. |
PBF_SOLIDMONOBRUSH | A monochrome (not colored) brush was realized. |
PBF_SUCCESS | Brush successfully realized. |
For example, if a solid white brush was realized, for a monochrome DC the driver must return PBF_SUCCESS+PBF_SOLIDMONOBRUSH. For a color DC the driver must return PBF_SUCCESS+PBF_SOLIDCLRBRUSH. This is because a solid white brush is not dithered in either monochrome or color.
If, for example, a solid red brush was realized, for a monochrome DC the driver must return PBF_SUCCESS. This is because a red brush is dithered in monochrome. For a color DC, when a solid red brush is realized, the driver must return SUCCESS+PBF_SOLIDCLR.
Note that if the driver fails to realize the brush, it should still return FALSE.