CWnd::IsDialogMessage

Call this member function to determine whether the given message is intended for a modeless dialog box; if it is, this function processes the message.

BOOL IsDialogMessage(
   LPMSG lpMsg 
);

Parameters

  • lpMsg
    Points to an MSG structure that contains the message to be checked.

Return Value

Specifies whether the member function has processed the given message. It is nonzero if the message has been processed; otherwise 0. If the return is 0, call the CWnd::PreTranslateMessage member function of the base class to process the message. In an override of the CWnd::PreTranslateMessage member function the code looks like this :

BOOL CAboutDlg::PreTranslateMessage(MSG* pMsg)
{
   if(IsDialogMessage(pMsg))
      return TRUE;
   else
      return CDialog::PreTranslateMessage(pMsg);
}

Remarks

When the IsDialogMessage function processes a message, it checks for keyboard messages and converts them to selection commands for the corresponding dialog box. For example, the TAB key selects the next control or group of controls, and the DOWN ARROW key selects the next control in a group.

You must not pass a message processed by IsDialogMessage to the TranslateMessage or DispatchMessage Windows functions, because it has already been processed.

Requirements

Header: afxwin.h

See Also

Concepts

CWnd Class

CWnd Members

Hierarchy Chart

DispatchMessage

TranslateMessage

GetMessage

CWnd::PreTranslateMessage

IsDialogMessage