getting notifications from child controls...
-
Hi, I've got a dialog with a simple listbox on it and I want my dialog class to be notified when the user rightclicks on the listbox. TN061 says to add ON_NOTIFY to the message map: ON_NOTIFY(NM_RCLICK, IDC_LIST1, OnListRightClick) and add a handler function with this prototype: afx_msg void OnListRightClick( NMHDR * pNotifyStruct, LRESULT * result ); That's what I did, but it doesn't seem to work. The handler function is never called. Anyone? Thanks, ren.
-
Hi, I've got a dialog with a simple listbox on it and I want my dialog class to be notified when the user rightclicks on the listbox. TN061 says to add ON_NOTIFY to the message map: ON_NOTIFY(NM_RCLICK, IDC_LIST1, OnListRightClick) and add a handler function with this prototype: afx_msg void OnListRightClick( NMHDR * pNotifyStruct, LRESULT * result ); That's what I did, but it doesn't seem to work. The handler function is never called. Anyone? Thanks, ren.
Hello, are you sure, that you enabled the notification of parents? And if so, is the dialog window the parent? To enable notification, you have to open your diolog resource and have a look at the proprties of your list control. The format tab has in the middle of the options a boolean value for notification. Make sure that this one is activated. Hope this helps G. Steudtel Even dwarves started small.
-
Hello, are you sure, that you enabled the notification of parents? And if so, is the dialog window the parent? To enable notification, you have to open your diolog resource and have a look at the proprties of your list control. The format tab has in the middle of the options a boolean value for notification. Make sure that this one is activated. Hope this helps G. Steudtel Even dwarves started small.
Thanks but no luck, The Notify property was enabled and the dialog is indeed the parent. (I checked with: m_cMyListCtrl.GetParent()->m_hWnd == this->m_hWnd )
-
Hi, I've got a dialog with a simple listbox on it and I want my dialog class to be notified when the user rightclicks on the listbox. TN061 says to add ON_NOTIFY to the message map: ON_NOTIFY(NM_RCLICK, IDC_LIST1, OnListRightClick) and add a handler function with this prototype: afx_msg void OnListRightClick( NMHDR * pNotifyStruct, LRESULT * result ); That's what I did, but it doesn't seem to work. The handler function is never called. Anyone? Thanks, ren.
-
Make sure the object ID is correct and refers to the corresponding list object. Recheck. Kuphryn
I have seen this 'failure to comply' before. Even after quadruple checking everything. I ended up catching the right click in the control and 'manually' posting the message to the parent. Now it works fine. A little extra work to make a derived CListBox that catches the right-click, but that is what I really needed. C++/MFC/InstallShield since 1993, breathing air since 1963