Using the Edit Controls

If you use several single-line edit controls on the surface of your main window (as PIFEDIT does), you'll need to use window subclassing to move the input focus from one control to another. You can accomplish this much as COLORS1 does, by intercepting Tab and Shift-Tab keystrokes. (Another example of window subclassing is shown later in this chapter in the HEAD program.) How you handle the Enter key is up to you. You can use it the same way as the Tab key or as a signal to your program that all the edit fields are ready.

If you want to insert text into an edit field, you can do so using SetWindowText. Getting text out of an edit control involves GetWindowTextLength and GetWindowText. We'll see examples of these facilities in our later revisions to the POPPAD1 program.