In OnNotify, what is the difference between returning TRUE or setting * pResult = TRUE

Given the notification handler

BOOL CMyWindow::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { ....... 

If I process a specific notification. Should I return TRUE or set * pResult = TRUE?

This is what has been listening to me for ages.

+4
source share
1 answer

This is completely different:

  • A return value of BOOL indicates whether you processed the message. Without zero, if you processed it, zero otherwise. This determines whether DefWindowProc called.
  • And pResult used to send information back to the caller associated with this particular notification. The fact that this information depends on which notification is processed is determined by the NMHDR structure transmitted through lParam .
+6
source

All Articles