We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.


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  


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

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)
      return TRUE;
      return CDialog::PreTranslateMessage(pMsg);

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.

Header: afxwin.h