8.5 Sample Application: EditCntl

This sample application illustrates how you can use an edit control in an application's main window to provide multiline text entry and editing. The EditCntl application fills the client area of its main window with a multiline edit control and monitors the size of the client area to ensure that the control always just fits. When completed, the EditCntl application looks like this:

To create the application, make the following modifications to the EditMenu application created in Chapter 7, “Menus”:

1.Add a new constant to the header file.

2.Add new variables.

3.Add a CreateWindow function.

4.Modify the WM_COMMAND case.

5.Add a WM_SETFOCUS case.

6.Add a WM_SIZE case.

7.Compile and link the application.