Board index » cppbuilder » Re: Listview Column header resizing related events in a component

Re: Listview Column header resizing related events in a component


2008-01-09 09:09:17 AM
cppbuilder61
"E B" < XXXX@XXXXX.COM >wrote in message
Quote
if ( (pnmh->code == HDN_ENDTRACKA)
|| (pnmh->code == HDN_ENDTRACKW)
)
{
OnColumnHeaderResized(this); // but never reach this line !!!
}
Works fine for me. I do get HDN_BEGINTRACK and HDN_ENDTRACK notifications
in my test code.
Gambit
 
 

Re:Re: Listview Column header resizing related events in a component

an aditional hint (that might help somebody)
in OnColumnHeaderResized I resize other controls to have them the same
width as the columns
for this to work
- DefListViewWndProc(Message) must be called first
- column width must be read using
SNDMSG(lvList->Handle, LVM_GETCOLUMNWIDTH, i/*column index*/, 0);
E B a écrit :
Quote
That was the problem the following works fine


void __fastcall TMyComponent::ListViewWndProc(TMessage &Message )
{
if( Message.Msg == WM_NOTIFY )
{
NMHDR *pnmh = (NMHDR*) Message.LParam; // if I put a breakpoint here
it stops several time =>so I assume the wndproc is actually used
if ( (pnmh->code == HDN_ENDTRACKA)
|| (pnmh->code == HDN_ENDTRACKW)
)
{
OnColumnHeaderResized(this); // but never reach this line !!!
}
}

DefListViewWndProc(Message); // Default processing
}

thank you for your help
 

Re:Re: Listview Column header resizing related events in a component

"E B" < XXXX@XXXXX.COM >wrote in message
Quote
if( Message.Msg == CN_NOTIFY )
You have to catch WM_NOTIFY instead.
Gambit
 

{smallsort}