Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Collapse the table of content
Expand the table of content


Called for a control so the control can process arrow-key and TAB-key input itself.

afx_msg UINT OnGetDlgCode( );

One or more of the following values, indicating which type of input the application processes:

  • DLGC_BUTTON   Button (generic).

  • DLGC_DEFPUSHBUTTON   Default pushbutton.


  • 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.

  • 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.


Normally, Windows handles all arrow-key and TAB-key input to a CWnd control. By overriding OnGetDlgCode, a CWnd control can choose a particular type of input to process itself.

The default OnGetDlgCode functions for the predefined control classes return a code appropriate for each class.

Community Additions

© 2015 Microsoft