Why does windows se开发者_JAVA技巧parate the painting cycle into two message wm_paint and wm_ereasebackground, why not just one?
This is still from the good old ways where WM_PAINT could have been too slow. It was better to have at least the background drawn. It is far less important today.
You can use the default implementation which just draws the background with the window's default background brush. Alternatively, you can just ignore it and use WM_PAINT for all your drawing code.
I think there was an article by Raymond Chen, but I can't find it now.
http://blogs.msdn.com/b/oldnewthing/
精彩评论