Module: wine Branch: master Commit: f3c4cca7bf8ffa82c36d619e283fd13979ca68dd URL: http://source.winehq.org/git/wine.git/?a=commit;h=f3c4cca7bf8ffa82c36d619e28...
Author: Hugh McMaster hugh.mcmaster@outlook.com Date: Mon May 29 08:20:34 2017 +0000
regedit: Add listview entries without refreshing the listview.
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
programs/regedit/edit.c | 10 +++++++++- programs/regedit/framewnd.c | 4 +--- programs/regedit/listview.c | 3 ++- programs/regedit/main.h | 1 + 4 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/programs/regedit/edit.c b/programs/regedit/edit.c index 28ea474..97a283f 100644 --- a/programs/regedit/edit.c +++ b/programs/regedit/edit.c @@ -443,8 +443,9 @@ BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPW WCHAR newValue[256]; DWORD valueDword = 0; BOOL result = FALSE; - int valueNum; + int valueNum, index; HKEY hKey; + LVITEMW item;
lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, KEY_READ | KEY_SET_VALUE, &hKey); if (lRet != ERROR_SUCCESS) { @@ -470,6 +471,13 @@ BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPW error_code_messagebox(hwnd, IDS_CREATE_VALUE_FAILED); goto done; } + + /* Add the new item to the listview */ + index = AddEntryToList(g_pChildWnd->hListWnd, valueName, valueType, (BYTE *)&valueDword, sizeof(DWORD)); + item.state = LVIS_FOCUSED | LVIS_SELECTED; + item.stateMask = LVIS_FOCUSED | LVIS_SELECTED; + SendMessageW(g_pChildWnd->hListWnd, LVM_SETITEMSTATE, index, (LPARAM)&item); + result = TRUE;
done: diff --git a/programs/regedit/framewnd.c b/programs/regedit/framewnd.c index a81c174..93a5e4f 100644 --- a/programs/regedit/framewnd.c +++ b/programs/regedit/framewnd.c @@ -861,10 +861,8 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { WCHAR* keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot); WCHAR newKey[MAX_NEW_KEY_LEN]; - if (CreateValue(hWnd, hKeyRoot, keyPath, valueType, newKey)) { - RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath, newKey); + if (CreateValue(hWnd, hKeyRoot, keyPath, valueType, newKey)) StartValueRename(g_pChildWnd->hListWnd); - } HeapFree(GetProcessHeap(), 0, keyPath); } break; diff --git a/programs/regedit/listview.c b/programs/regedit/listview.c index e485c77..123949f 100644 --- a/programs/regedit/listview.c +++ b/programs/regedit/listview.c @@ -109,7 +109,7 @@ static void MakeMULTISZDisplayable(LPWSTR multi) /******************************************************************************* * Local module support methods */ -static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType, void *ValBuf, DWORD dwCount) +int AddEntryToList(HWND hwndLV, WCHAR *Name, DWORD dwValType, void *ValBuf, DWORD dwCount) { LINE_INFO* linfo; LVITEMW item; @@ -202,6 +202,7 @@ static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType, void *ValB } } } + return index; }
static BOOL InitListViewImageList(HWND hWndListView) diff --git a/programs/regedit/main.h b/programs/regedit/main.h index a8e464e..b4b0307 100644 --- a/programs/regedit/main.h +++ b/programs/regedit/main.h @@ -117,6 +117,7 @@ extern void SetupStatusBar(HWND hWnd, BOOL bResize); extern void UpdateStatusBar(void);
/* listview.c */ +extern int AddEntryToList(HWND hwndLV, WCHAR *Name, DWORD dwValType, void *ValBuf, DWORD dwCount); extern HWND CreateListView(HWND hwndParent, UINT id); extern BOOL RefreshListView(HWND hwndLV, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR highlightValue); extern HWND StartValueRename(HWND hwndLV);