Tech Support > Microsoft Windows > Development Resources > Label editing in listview using win32 api's
Label editing in listview using win32 api's
Posted by sshetty on December 18th, 2003


Hi all ,

I am having great difficulty, in fact going crazy getting in place
editing of labels working in a list view control for the very first
item . From MSDN i am aware of the edit label notifications
LVN_BEGINLABELEDIT and LVN_ENDLABELEDIT notifications received thru
the wm_notify. on clicking on the label the edit box gets created and
lets you to enter the text , but when i track LVN_ENDLABELEDIT
notification coded as follows


case WM_NOTIFY:
switch ( ((LPNMHDR) lParam)->code )
{
case LVN_ENDLABELEDITW:
{

LPNMLVDISPINFOA pdi = (LPNMLVDISPINFOA) lParam;

char *newText = pdi->item.pszText;
}
break;
}

I allways find pdi->item.pszText allways NULL indicating that edit of
the label was cancelled.


I have subclassed the wndproc for the listview . From some of the
mails in the news group relating to the same problem , i have tried
to return false from LVN_BEGINLABELEDIT and as well true from
wm_command. But no success .

Do i need to handle anything else ?


Thank you in advance
sshetty


Similar Posts