Edit controls send WM_COMMAND messages to the parent window procedure. The meanings of the wParam and lParam variables are the same as for button controls:
Parameter | Description |
wParam | Child window ID |
LOWORD (lParam) | Child window handle |
HIWORD (lParam) | Notification code |
The notification codes are shown below:
EN_SETFOCUS | Edit control has gained the input focus |
EN_KILLFOCUS | Edit control has lost the input focus |
EN_CHANGE | Edit control's contents will change |
EN_UPDATE | Edit control's contents have changed |
EN_ERRSPACE | Edit control has run out of space |
EN_MAXTEXT | Edit control has run out of space on insertion |
EN_HSCROLL | Edit control's horizontal scroll bar has been clicked |
EN_VSCROLL | Edit control's vertical scroll bar has been clicked |
POPPAD1 traps only EN_ERRSPACE notification codes and displays a message box.
The edit control stores text in the local heap of its parent window's program. The contents of an edit control are limited to about 32 KB. You'll note that POPPAD1 reserves only 1 KB of space for its local heap in the module definition file. As we'll see in Chapter 7, this is not a problem. Windows will expand the program's local heap if an edit control needs more space.