Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
ATL
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

WM_FORWARDMSG 

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


WM_FORWARDMSG

Nonzero if the message was processed, zero if not.

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:

Parameter Usage

WPARAM

Data defined by user

LPARAM

A pointer to a MSG structure that contains information about a message

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

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

Community Additions

ADD
Show:
© 2015 Microsoft