May 24, 2017 at 10:25am UTC
HI,
I have created a ListCtrl as shown below.
List.CreateEx(WS_EX_CLIENTEDGE,
WS_VISIBLE | WS_TABSTOP | WS_CHILD | WS_BORDER | WS_GROUP
| LVS_REPORT | LVS_OWNERDRAWFIXED | LVS_EDITLABELS | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS,
m_rectEditor,
this,
IDC_LIST_FIT_PARAM);
I have a declared message handlers as shown below.
ON_NOTIFY(LVN_BEGINSCROLL, IDC_LIST_FIT_PARAM, OnBeginScrollFitParamList)
ON_NOTIFY(LVN_ENDSCROLL, IDC_LIST_FIT_PARAM, OnEndScrollFitParamList)
my Message handler function declared in .h file as below.
afx_msg void OnBeginScrollFitParamList(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnEndScrollFitParamList(NMHDR* pNMHDR, LRESULT* pResult);
Message handler definition in .cpp file as shown below.
void CModelParmsEditorDockablePane::OnBeginScrollFitParamList(NMHDR* pNMHDR, LRESULT* pResult)
{
AfxMessageBox("test 11");
}
void CModelParmsEditorDockablePane::OnEndScrollFitParamList(NMHDR* pNMHDR, LRESULT* pResult)
{
AfxMessageBox("test 12");
}
But when I run the application and scroll the ListCtrl. The LVN_BEGINSCROLL and LVN_ENDSCROLL messages are not handled. Left click and right click in the listctrl is handled/called properly.
Please let me know the problem with scroll messages.
May 25, 2017 at 7:17am UTC
I tried putting dialog before the name of function. That does not work.
I traced OnNotify code. when I scroll the list Ctrl. the scroll event messages are not triggered.
Don't know why.