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?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

NickRepinConnect With a Mentor Commented:
Try to add LVS_EDITLABELS style to the listview.
The list view control must have the focus before you send ListView_EditLabel to the control. Focus can be set using the SetFocus function.
nadirkamalAuthor Commented:
I forgot to mention that I have already called SetFocus and ListView_EditLabel fails despite this.
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.

I strongly suggest you take a look at listview column of write an application like yours and I learn alot there.
Just for you infor.
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?
You have to handle LVN_BEGINLABELEDIT and LVN_ENDLABELEDIT notifications.
All Courses

From novice to tech pro — start learning today.