Επεξεργασία

Κοινή χρήση μέσω


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/value Description
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

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Winuser.h (include Windows.h)

See also

Reference

DefWindowProc

EM_SETSEL

MSG

WM_CHAR

Conceptual

Dialog Boxes