Actually, don't worry. I've worked it out: I had WM_GETTEXT and WM_GETTEXTLENGTH the wrong way round...
Just one last question: how can I trigger the rename box to appear, other than clicking on the entry in the ListViewControl (for example, through a right-click menu or button)?