WM_GETDLGCODE

The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types of input it wants to process itself.

WM_GETDLGCODE 
wParam;                // not used 
pMsg = (LPMSG) lParam; // pointer to an MSG structure 
 

Parameters

pMsg
The value of lParam is NULL if the system is performing a query, or lParam is a pointer to an MSG structure.

Return Values

The return value is one or more of the following values, indicating which type of input the application processes.

Value Meaning
DLGC_BUTTON Button.
DLGC_DEFPUSHBUTTON Default push button.
DLGC_HASSETSEL EM_SETSEL messages.
DLGC_RADIOBUTTON Radio button.
DLGC_STATIC Static control.
DLGC_UNDEFPUSHBUTTON Non-default push button.
DLGC_WANTALLKEYS All keyboard input.
DLGC_WANTARROWS Direction keys.
DLGC_WANTCHARS WM_CHAR messages.
DLGC_WANTMESSAGE All keyboard input (the application passes this message in the MSG structure to the control).
DLGC_WANTTAB tab key.

Default Action

The DefWindowProc function returns zero.

Remarks

Although the DefWindowProc function always returns zero in response to the WM_GETDLGCODE message, the window procedure for the predefined control classes return a code appropriate for each class.

The WM_GETDLGCODE message and the returned values are useful only with user-defined dialog box controls or standard controls modified by subclassing.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Requires version 1.0 or later.
  Header: Declared in winuser.h.

See Also

Dialog Boxes Overview, Dialog Box Messages, DefWindowProc, MSG, EM_SETSEL, WM_CHAR