WM_USER ignored by View window? (CHtmlView)
-
Hi, I am desperated: I want to send a WM_USER message to a CHtmlView but the message handler is never called :-( In my *.h file I have:
#define WM_HYLGETCONTENT WM_USER + 79
afx_msg LRESULT OnHylGetContent(WPARAM wParam, LPARAM lParam);In my *cpp file I have:
BEGIN_MESSAGE_MAP(CHyperlexView, CHtmlView)
[...]
ON_MESSAGE(WM_HYLGETCONTENT, OnHylGetContent)
END_MESSAGE_MAP()[...]
afx_msg LRESULT CHyperlexView::OnHylGetContent(WPARAM wParam, LPARAM lParam)
{
MessageBox("I get called!");
return 1111;
}But the function is never called :-( I checked with Spy++: The message is sent successfully to the window but the LRESULT is 0 instead of 1111. The message does not appear too. What could be the problem here? I have also checked other values for WM_USER, I get the same result :( Thank you, Niki
-
Hi, I am desperated: I want to send a WM_USER message to a CHtmlView but the message handler is never called :-( In my *.h file I have:
#define WM_HYLGETCONTENT WM_USER + 79
afx_msg LRESULT OnHylGetContent(WPARAM wParam, LPARAM lParam);In my *cpp file I have:
BEGIN_MESSAGE_MAP(CHyperlexView, CHtmlView)
[...]
ON_MESSAGE(WM_HYLGETCONTENT, OnHylGetContent)
END_MESSAGE_MAP()[...]
afx_msg LRESULT CHyperlexView::OnHylGetContent(WPARAM wParam, LPARAM lParam)
{
MessageBox("I get called!");
return 1111;
}But the function is never called :-( I checked with Spy++: The message is sent successfully to the window but the LRESULT is 0 instead of 1111. The message does not appear too. What could be the problem here? I have also checked other values for WM_USER, I get the same result :( Thank you, Niki
You've probably hit a conflict with another existing message ID. Use
WM_APP
instead ofWM_USER
, the latter is obsolete. What you really should do is use a registered windows message. Read more about message management here[^]."It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown -
Hi, I am desperated: I want to send a WM_USER message to a CHtmlView but the message handler is never called :-( In my *.h file I have:
#define WM_HYLGETCONTENT WM_USER + 79
afx_msg LRESULT OnHylGetContent(WPARAM wParam, LPARAM lParam);In my *cpp file I have:
BEGIN_MESSAGE_MAP(CHyperlexView, CHtmlView)
[...]
ON_MESSAGE(WM_HYLGETCONTENT, OnHylGetContent)
END_MESSAGE_MAP()[...]
afx_msg LRESULT CHyperlexView::OnHylGetContent(WPARAM wParam, LPARAM lParam)
{
MessageBox("I get called!");
return 1111;
}But the function is never called :-( I checked with Spy++: The message is sent successfully to the window but the LRESULT is 0 instead of 1111. The message does not appear too. What could be the problem here? I have also checked other values for WM_USER, I get the same result :( Thank you, Niki