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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
Try to add LVS_EDITLABELS style to the listview.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.