Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 5: The Document/View Architecture Visual C++ and MFC Fundamentals



  1. Return to MSVC


4.2.4 Window Painting.................................................................................


WM_PAINT: Whether you have just created a window or you want to show it, you must
ask the operating system to display it, showing its appearance. To display such a window,
the operating system would need its location (left and top measures) and its dimension
(width and height). This is because the window must be painted. Also, if the window was
hidden somewhere such as behind another another window or was minimized, when it
comes up, the operating system needs to paint it. To do this, the window that needs to be
painted must send a message called ON_WM_PAINT. This message does not return
anything but in its body, you can define what needs to be painted and how you want the
job to be done. The syntax of this message is simply:
Free download pdf