How to send a notification processed by ON_NOTIFY?

I am trying to publish LVN_ ITEMCHANGED to my own grid list owner. I know how to send WM_ user message using PostMessage (as shown here)

::PostMessage( AfxGetMainWnd()->GetSafeHwnd(), WM_REFRESH, (WPARAM)pBuffer, (LPARAM)GetOutputIdx() );

When I use the same code to send the LVN_ITEMCHANGED message,

::PostMessage( AfxGetMainWnd()->GetSafeHwnd(), LVN_ITEMCHANGED, 0, 0);

he doesn't seem to be caught

ON_NOTIFY(LVN_ITEMCHANGED, ..., ...) 

I have an owner class.

Am I using :: PostMessage to dispatch a Notify event?
Is there a difference between notification messages and WM_ prefix messages or their processing?
Can someone post a sample of how to send a message correctly?

Thanks in advance.

Edit
I found another solution to the problem. See my answer below.

+2
source share
2

, , :

ON_NOTIFY_REFLECT_EX(LVN_ITEMCHANGED, OnListItemChanged)

OnListItemChanged , FALSE. , .

+4

WM_NOTIFY, wParam NMHDR * lParam.

NMHDR - code LVN_ITEMCHANGED idFrom . SendMessage(), PostMessage(), NMHDR *.

Smth :

NMHDR nmhdr;
nmhdr.code = LVN_ITEMCHANGED;
nmhdr.idFrom = controlId;
nmhdr.hwndFrom = controlWindowHandle;
SendMessage( targetWindowHandle, WM_NOTIFY, controlId, &nmhdr );
+7

All Articles