Problem:
a derived class of CListCtrl (LVS_REPORT-Style) get no notification messages
from his child window (HeaderCtrl).
Spy++ shows: the SysHeader32-Window sends no Notification Messages, when I
click on a column (WM_NOTIFY)
Environment: Win98 / VC++ 4.2 / MFC 4.2
What's the matter ? Can anybody help me ?
Günter Haas (Mail: ha...@proconnection.de)
// Source:
BOOL CMyListCtrl::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
if (CWnd::OnNotify(wParam, lParam, pResult))
return TRUE;
NMHDR* nmhdr = (NMHDR*)lParam;
switch (nmhdr->code)
case HDN_ITEMCHANGED:
{
//...
}
}
return TRUE;
}
Is your list control in UNICODE mode as opposed to ANSI? I encountered a
similar problem when using the common controls version 4.72 provided with
IE4 when testing my s/w for NT4 compatibility. The NT4 list control's
header defaulted to UNICODE mode, so only HDN_xxxxW notification messages
were sent. Try trapping HDN_ITEMCHANGEDW.
There is a new message you can send the list control which sets it to the
required mode... I've only got VC5 here, and the message came with the VC6
include files, and I can't remember off hand, but it was something obvious,
like LVM_SETUNICODEMODE or something.
Mind you, if you are using VC4.2, this isn't much help, need to get hold
of the latest commctrl.h.