The interface display program in the client area is in the processing of the WM_PAINT message placed in the callback function, and the Windows system sends an WM_PAINT message to the application window when the client area needs to be redrawn. When the window receives the message, it redraws its client area.
To display text:
1 Use the BeginPaint () function to get the device environment handle for the client area.
2 Use the TextOut () function to display the text.
3 End the display with the EndPaint () function.
The code for displaying the text is as follows:
Case Wm_paint:hdc=beginpaint (HWND,&PS); TextOut (hdc,10,10,s1,13); TextOut (hdc,20,40,s2,32); EndPaint (HWND,&PS);
Note that the beginpiant () and EndPaint () functions must be paired, just like when redrawing a window, the program has nothing to do, and it has to have this pair of functions. Otherwise, Windows will always send a WM_PAINT message to the program.
The results of this procedure are as follows:
Windows Programming Note (5): client area output characters