Windows Messages Macros

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Windows Messages Macros.

This macro forwards window messages.

WM_FORWARDMSGUse to forward a message received by a window to another window for processing.

This macro forwards a message received by a window to another window for processing.

WM_FORWARDMSG

Return Value

Nonzero if the message was processed, zero if not.

Remarks

Use WM_FORWARDMSG to forward a message received by a window to another window for processing. The LPARAM and WPARAM parameters are used as follows:

ParameterUsage
WPARAMData defined by user
LPARAMA pointer to a MSG structure that contains information about a message

Example

In the following example, m_hWndOther represents the other window that receives this message.

LRESULT CMyWindow::OnMsg(UINT nMsg, WPARAM wParam, LPARAM lParam, 
   BOOL& bHandled)
{
   MSG msg = { m_hWnd, nMsg, wParam, lParam, 0, { 0, 0 } };
   LRESULT lRet = SendMessage(m_hWndOther, WM_FORWARDMSG, 0, (LPARAM)&msg);
   if(lRet == 0)   // not handled
      bHandled = FALSE;
   return 0;
}

Macros

Show: