TONT 40943 白光一闪



If you had a program that didn’t process messages for a while, but it needed to be painted for whatever reason (say, somebody uncovered it), Windows would eventually lose patience with you and paint your window white.


Or at least, that’s what people would claim. Actually, Windows is painting your window with your class background brush. Since most people use COLOR_WINDOW and since COLOR_WINDOW is white in most color schemes, the end result is a flash of white.


Why paint the window white? Why not just leave it alone?


Well, that’s what it used to do, but the result was that the previous contents of the screen would be shown where the window “would be”. So suppose you were looking at Explorer, and then you restored a program that stopped responding. Inside the program’s main window would be… a picture of Explorer. And then people would try to double-click on what they thought was Explorer but was really a hung program.


In Windows XP, the behavior for a window that has stopped painting is different. Now, the system captures the pixels of the unresponsive window and just redraws those pixels if the window is unable to draw anything itself. Note, however, that if the system can’t capture all of the pixels – say because the window was partially covered – then the parts that it couldn’t get are filled in with the class brush.

在Windows XP中,针对停止绘制自己的窗体的行为有所变化。现如今,系统会捕获这个无响应窗体的像素点,然后在其无法自行进行绘制时,由系统(用记录下来的像素点)进行重绘。不过,请注意如果系统无法获取到所有的像素点——例如该窗口被部分遮挡了,那么那部分窗体就会由窗体类的笔刷进行填充。

Which is usually white.



电子邮件地址不会被公开。 必填项已用*标注

 剩余字数 ( Characters available )


Notice: please DO NOT add any links in your comment, otherwise it would be identified as SPAM automatically.