#StackBounty: #winapi #mfc #clistctrl #message-handlers Never notify HDN_TRACK message of CListCtrl's CHeaderCtrl

Bounty: 50

I want to catch HDN_TRACK message from listCtrl’s header, but it’s never notified.

I tested HDN_BEGINTRACK and HDN_ENDTRACK, and these are working well.

I also changed the Control Id of message map to IDC_TEST_LIST and 0, there was no difference – NOT WORKING.

I googled many forums, but I couldn’t find any solution.

Here’s my test code.


BEGIN_MESSAGE_MAP(CDlgTest, CDialogEx)
    //ON_NOTIFY(HDN_BEGINTRACK, 0, &CDlgTest::OnTrackListTest) // WORKING!!
    //ON_NOTIFY(HDN_ENDTRACK, 0, &CDlgTest::OnTrackListTest) // WORKING!!
    //ON_NOTIFY(HDN_TRACK, IDC_TEST_LIST, &CDlgTest::OnTrackListTest) // NOT WORKING
    ON_NOTIFY(HDN_TRACK, 0, &CDlgTest::OnTrackListTest)   // NOT WORKING
END_MESSAGE_MAP()


void CDlgTest::OnTrackListLog(NMHDR* pNMHDR, LRESULT* pResult)
{
    LPNMHEADER phdr = reinterpret_cast<LPNMHEADER>(pNMHDR);
    // TODO: Add your control notification handler code here

    AfxMessageBox(L"Hello!!!");     // >>>>>>>>>>> NOT showing up

    *pResult = 0;
}


class CDlgTest : public CDialogEx {
    
public:
    afx_msg void OnTrackListLog(NMHDR* pNMHDR, LRESULT* pResult);
}

I append some forums that I visited.

Help me, please. 😢

UPDATE: I asked this 22 days ago, but there was a very few visitors and no answer.
I’m very worried about what was wrong for asking or is it a small problem no need to ask.
I believe that there is another person who encountered with this problem, not only me.
That is why I asked again with a small bounty.
Any help is appreciated :).


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.