Question on ListView_EditLabel

I want to rename a list view item in a manner similar to windows explorer that allows in place editing when rename is invoked from the drop-down/context menu. For this I used ListView_EditLabel in my application and passed it the handle to my list view control and the index of the selected item but its not working. Instead of returning me the handle to the edit control, ListView_EditLabel returns a NULL. What am I doing wrong?
nadirkamalAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
NickRepinConnect With a Mentor Commented:
Try to add LVS_EDITLABELS style to the listview.
0
 
chensuCommented:
The list view control must have the focus before you send ListView_EditLabel to the control. Focus can be set using the SetFocus function.
0
 
nadirkamalAuthor Commented:
I forgot to mention that I have already called SetFocus and ListView_EditLabel fails despite this.
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
WynCommented:
I strongly suggest you take a look at listview column of www.codeguru.com.I write an application like yours and I learn alot there.
Just for you infor.
Regards
Wyn
0
 
nadirkamalAuthor Commented:
Thanks NickRepin
I added LVS_EDITLABELS and now I get a handle to the edit control. However, when I run the appication still the in place editing of the item doesn't get initiated. Do I have to to something with the edit control handle?
0
 
NickRepinCommented:
You have to handle LVN_BEGINLABELEDIT and LVN_ENDLABELEDIT notifications.
0
All Courses

From novice to tech pro — start learning today.