The hollow brush

Raymond Chen

What is the hollow brush for? The hollow brush is a brush that doesn’t do anything. You can use it when you’re forced to use a brush but you don’t want to. As one example, you can use it as your class brush. Then when your program stops responding and Windows decide to do the “white flash” (see yesterday’s entry), it grabs the hollow brush and ends up not drawing anything. (At least, that’s how it worked on Windows 2000. Things may be different on XP.)

Another place you can use the hollow brush is when handling the WM_CTLCOLOR* messages. Those messages require you to return a brush, which will be used to erase the background. If you don’t want to erase the background, a hollow brush does the trick.


Discussion is closed.

Feedback usabilla icon