Under MS-DOS, a program using the display in a full-screen mode can write to any part of the display. What the program puts on the display will stay there and will not mysteriously disappear. The program can then discard information needed to re-create the screen display. If another program (such as a RAM-resident popup) overlays part of the display, then the popup is responsible for restoring the display when it leaves.
In Windows, you can display only to the client area of your window, and you cannot be assured that what you display to the client area will remain there until your program specifically writes over it. For instance, the dialog box from another application may overlay part of your client area. Although Windows will attempt to save and restore the area of the display underneath the dialog box, it sometimes cannot do so. When the dialog box is removed from the screen, Windows will request that your program repaint this portion of your client area.
Windows is a message-driven system. Windows informs applications of various events by posting messages in the application's message queue or sending messages to the appropriate window procedure. Windows informs a window procedure that part of the window's client area needs updating by posting a WM_PAINT message.