Catching the "Enter" key in a CListCtrl (and other controls)
Posted
by Randy More
on January 24th, 1999
UINT SMUPPGrid::OnGetDlgCode()
{
UINT result = CListCtrl::OnGetDlgCode();
result = result | DLGC_WANTALLKEYS;
return result;
}
Other options include (from MSDEV documentation):
- DLGC_WANTALLKEYS All keyboard input.
- DLGC_WANTARROWS Arrow keys.
- DLGC_WANTCHARS WM_CHAR messages.
- DLGC_WANTMESSAGE All keyboard input. The application passes this message on to the control.
- DLGC_WANTTAB TAB key.
- DLGC_BUTTON Button (generic).
- DLGC_DEFPUSHBUTTON Default pushbutton.
- DLGC_HASSETSEL EM_SETSEL messages.
- DLGC_UNDEFPUSHBUTTON No default pushbutton processing. (An application can use this flag with DLGC_BUTTON to indicate that it processes button input but relies on the system for default pushbutton processing.)
- DLGC_RADIOBUTTON Radio button.
- DLGC_STATIC Static control.
This is a relatively simple process but it is not really all that intuitive or well documented.
Last updated: 9 May 1998

Comments
DLGC_UNDEFPUSHBUTTON: is this an undocumented feature?
Posted by Legacy on 03/29/1999 12:00amOriginally posted by: newsoft
ReplyCatching Enter in combobox
Posted by Legacy on 10/26/1998 12:00amOriginally posted by: Vadim
Reply