In the example in Creating a Combo-box Toolbar SubClassProc sends application-defined messages to the toolbar window when the user presses the tab, esc, or enter key in a combo box. The WM_TAB message is sent for the tab key, the WM_ESC message for the esc key, and the WM_ENTER message for the enter key.
The example processes the WM_TAB message by setting the focus to the next combo box in the toolbar. It processes the WM_ESC message by setting the focus to the main application window.
In response to the WM_ENTER message, the example ensures that the current selection for the combo box is valid and then sets the focus to the main application window. If the combo box contains no current selection, the example uses the CB_FINDSTRINGEXACT message to search for a list item that matches the contents of the selection field. If there is a match, the example sets the current selection; otherwise, it adds a new list item.