3.4.1 Adding New Variables

The Output application requires several new global variables. Add the following variables at the beginning of your C-language source file:

HPEN hDashPen;      /* "---" pen handle    */
HPEN hDotPen;       /* "..." pen handle    */
HBRUSH hOldBrush;   /* old brush handle    */
HBRUSH hRedBrush;   /* red brush handle    */
HBRUSH hGreenBrush; /* green brush handle  */
HBRUSH hBlueBrush;  /* blue brush handle   */

Output also requires new local variables in the window procedure. Declare the following variables at the beginning of MainWndProc:

HDC hDC;          /* handle of device context  */
PAINTSTRUCT ps;   /* paint structure           */
RECT rcTextBox;   /* rectangle around the text */
HPEN hOldPen;     /* old pen handle            */