Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Development
Dialog Boxes
 WM_GETDLGCODE message
WM_GETDLGCODE message

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.

#define WM_GETDLGCODE                   0x0087

Parameters

wParam

The virtual key, pressed by the user, that prompted Windows to issue this notification. The handler must selectively handle these keys. For instance, the handler might accept and process VK_RETURN but delegate VK_TAB to the owner window. For a list of values, see Virtual-Key Codes.

lParam

A pointer to an MSG structure (or NULL if the system is performing a query).

Return value

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

Return code/valueDescription
DLGC_BUTTON
0x2000

Button.

DLGC_DEFPUSHBUTTON
0x0010

Default push button.

DLGC_HASSETSEL
0x0008

EM_SETSEL messages.

DLGC_RADIOBUTTON
0x0040

Radio button.

DLGC_STATIC
0x0100

Static control.

DLGC_UNDEFPUSHBUTTON
0x0020

Non-default push button.

DLGC_WANTALLKEYS
0x0004

All keyboard input.

DLGC_WANTARROWS
0x0001

Direction keys.

DLGC_WANTCHARS
0x0080

WM_CHAR messages.

DLGC_WANTMESSAGE
0x0004

All keyboard input (the application passes this message in the MSG structure to the control).

DLGC_WANTTAB
0x0002

TAB key.

 

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.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

See also

Reference
DefWindowProc
EM_SETSEL
MSG
WM_CHAR
Conceptual
Dialog Boxes

 

 

Send comments about this topic to Microsoft

Build date: 9/7/2011

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Better description of how to use DLGC_WANTMESSAGE      skst   |   Edit   |   Show History
Tags What's this?: Add a tag
Flag as ContentBug
Value      Đonny   |   Edit   |   Show History
WM_GETDLGCODE = &;;H87
Public Enum WM_GETDLGCODE As Integer
DLGC_BUTTON = &;;H2000
DLGC_DEFPUSHBUTTON = &;;H10
DLGC_HASSETSEL = &;;H8
DLGC_RADIOBUTTON = &;;H40
DLGC_STATIC = &;;H100
DLGC_UNDEFPUSHBUTTON = &;;H20
DLGC_WANTALLKEYS = &;;H4
DLGC_WANTARROWS = &;;H1
DLGC_WANTCHARS = &;;H80
DLGC_WANTMESSAGE = &;;H4
DLGC_WANTTAB = &;;H2
End Enum
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker