Posts

Showing posts with the label tlistview

TListView detecting ESC or unchanged editing

TListView detecting ESC or unchanged editing I am trying to subclass the WindowProc of TListView to detect ESC key press after editing TListView caption (if user cancels editing). ListViewWndProc is getting called clearly, but the code parameter which is supposed to detect that never gets LVN_ENDLABELEDIT value. Why the commented part never gets called? I cannot see the error, it should be happening. WindowProc TListView TListView TWndMethod OldWndProc; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { OldWndProc = ListView1->WindowProc; ListView1->WindowProc = ListViewWndProc; } //--------------------------------------------------------------------------- void __fastcall TForm1::ListViewWndProc(TMessage &Message) { if (Message.Msg == CN_NOTIFY) { LPNMHDR pnmh = reinterpret_cast<LPNMHDR>(Message.LParam); if (pnmh->code == LVN_ENDLABELEDIT) // UPDATE: if LVN_ENDLAB...