I'm sending a WM_NOTIFY message to another class, which has a message map set up to handle the notification. However, the function I've set up in the message map is never called. The code is below:
TooltipBase.h
TooltipBase.cppCode://! @brief Information shown in a tooltip struct TooltipData { CString strHeader; CString strContents; CString strFooter; }; //! @brief ON_NOTIFY structure struct TooltipNotification { NMHDR hdr; TooltipData* pTooltipData; };
Canvas2.cpp - Just a CWnd class that shapes are drawn on.Code:// Code to send the message. TooltipNotification ttn; ttn.hdr.hwndFrom = m_hParentHWnd; ttn.hdr.idFrom = GetDlgCtrlID(); ttn.hdr.code = UDM_NEED_TOOLTIP_TEXT; ttn.pTooltipData = &m_TooltipData; ::SendMessage( m_hParentHWnd, WM_NOTIFY, ( WPARAM ) m_hParentHWnd, ( LPARAM ) &ttn );
The message appears to be sent ok, as the program continues, but I can't be sure what is happening to the message (nor if I'm right that it is being sent).Code:ON_NOTIFY ( UDM_NEED_TOOLTIP_TEXT, NULL, OnNeedTooltipText ) .... void Canvas2::OnNeedTooltipText( NMHDR* pNotifyStruct, LRESULT * result ) { TRACE( _T( "The tooltip needs some text." ) ); }




Reply With Quote