
User defined Message with additional data?
Off the top of my head I think this is correct:
#define WM_SOME_MESSAGE WM_USER+1
// in message map of .cpp file:
ON_MESSAGE(WM_SOME_MESSAGE, OnMyMessage)
// in header file:
afx_msg LRESULT OnMyMessage(WPARAM wParam, LPARAM lParam);
// function body in .cpp file
LRESULT CMyClass::OnMyMessage(WPARAM wParam, LPARAM lParam)
{
// do whatever processing...
return (TRUE or FALSE);
Quote:
}
Use PostMessage or SendMessage
Quote:
>Hi
>How can I send a user defined message to a window with additional data?
>With WM_COMMAND I can send a user defined message, but without additional
>data:
>GetParent()->SendMessage(WM_COMMAND, GetDlgCtrlID() | MYOWNMESSAGE <<16),
>(LONG)GetSafeHwnd())
>With WM_NOTIFY MFC sends additional data. But how can I send my own user
>defined message?
>Thanks for your help!
>Matthias.