Add a WM_PAINT Case

A WM_PAINT case is necessary in order to draw the current client-area text on the screen when the window has been minimized, resized, or overlaid. Add the following case to the window procedure:

case WM_PAINT:

hDC = BeginPaint (hWnd, &ps);

if (hText != NULL) {

if (!(lpszText = GlobalLock (hText))) {

OutOfMemory();

} else {

GetClientRect (hWnd, &rectClient);

DrawText (hDC, lpszText, -1, &rectClient

, DT_EXTERNALLEADING | DT_NOPREFIX | DT_WORDBREAK);

GlobalUnlock (hText);

}

}

EndPaint (hWnd, &ps);

break;