BOOL IsDialogMessage(hDlg,lpMsg)
This function determines whether the given message is intended for the modeless dialog box specified by the hDlg parameter, and automatically processes the message if it is. When the IsDialogMessage function processes a message, it checks for keyboard messages and converts them into selection commands for the corresponding dialog box. For example, the TAB key selects the next control or group of controls, and the DOWN key selects the next control in a group.
If a message is processed by IsDialogMessage, it must not be passed to the Translate-Message or DispatchMessage function. This is because IsDialogMessage performs all necessary translating and dispatching of messages.
IsDialogMessage sends WM_GETDLGCODE messages to the dialog function to determine which keys should be processed.
Parameter | Type/Description |
hDlg | HWND Identifies the dialog box. | |
lpMsg | LPMSG Points to an MSG data structure that contains the message to be checked. |
The return value specifies whether or not the given message has been processed. It is nonzero if the message has been processed. Otherwise, it is zero.
Although IsDialogMessage is intended for modeless dialog boxes, it can be used with any window that contains controls to provide the same keyboard selection as in a dialog box.