regedit: Re-select the listview item after renaming is complete.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2017-05-22 13:03:01 +00:00 committed by Alexandre Julliard
parent 5474b7a43e
commit c5d38ce427
1 changed files with 5 additions and 0 deletions

View File

@ -400,11 +400,16 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
LPNMLVDISPINFOW dispInfo = (LPNMLVDISPINFOW)lParam;
LPWSTR oldName = GetItemText(hWnd, dispInfo->item.iItem);
LONG ret;
LVITEMW item;
if (!oldName) return -1; /* cannot rename a default value */
ret = RenameValue(hWnd, g_currentRootKey, g_currentPath, oldName, dispInfo->item.pszText);
if (ret)
{
RefreshListView(hWnd, g_currentRootKey, g_currentPath, dispInfo->item.pszText);
item.state = LVIS_FOCUSED | LVIS_SELECTED;
item.stateMask = LVIS_FOCUSED | LVIS_SELECTED;
SendMessageW(hWnd, LVM_SETITEMSTATE, dispInfo->item.iItem, (LPARAM)&item);
}
HeapFree(GetProcessHeap(), 0, oldName);
return 0;