Add New Variables

You need to add new global variables to hold the handle of the client area text string and its initial data. Add the following to the beginning of your C-language source file:

HANDLE hClientText = NULL; /* handle for current client-area text */

char szInitialClientAreaText[] = “This program demonstrates...”

HANDLE hData, hClipData; /* handles to clip data */

LPSTR lpData, lpClipData; /* pointers to clip data */

You also need to add variables for painting and clipboard data manipulation. Add the following to the beginning of your MainWndProc main window function:

HDC hDC;

PAINTSTRUCT ps;

RECT rectClient;

LPSTR lpszText;