Commit f3c4cca7 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

regedit: Add listview entries without refreshing the listview.

parent ebfe566c
...@@ -443,8 +443,9 @@ BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPW ...@@ -443,8 +443,9 @@ BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPW
WCHAR newValue[256]; WCHAR newValue[256];
DWORD valueDword = 0; DWORD valueDword = 0;
BOOL result = FALSE; BOOL result = FALSE;
int valueNum; int valueNum, index;
HKEY hKey; HKEY hKey;
LVITEMW item;
lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, KEY_READ | KEY_SET_VALUE, &hKey); lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, KEY_READ | KEY_SET_VALUE, &hKey);
if (lRet != ERROR_SUCCESS) { if (lRet != ERROR_SUCCESS) {
...@@ -470,6 +471,13 @@ BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPW ...@@ -470,6 +471,13 @@ BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPW
error_code_messagebox(hwnd, IDS_CREATE_VALUE_FAILED); error_code_messagebox(hwnd, IDS_CREATE_VALUE_FAILED);
goto done; 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; result = TRUE;
done: done:
......
...@@ -861,10 +861,8 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) ...@@ -861,10 +861,8 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
WCHAR* keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot); WCHAR* keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
WCHAR newKey[MAX_NEW_KEY_LEN]; WCHAR newKey[MAX_NEW_KEY_LEN];
if (CreateValue(hWnd, hKeyRoot, keyPath, valueType, newKey)) { if (CreateValue(hWnd, hKeyRoot, keyPath, valueType, newKey))
RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath, newKey);
StartValueRename(g_pChildWnd->hListWnd); StartValueRename(g_pChildWnd->hListWnd);
}
HeapFree(GetProcessHeap(), 0, keyPath); HeapFree(GetProcessHeap(), 0, keyPath);
} }
break; break;
......
...@@ -109,7 +109,7 @@ static void MakeMULTISZDisplayable(LPWSTR multi) ...@@ -109,7 +109,7 @@ static void MakeMULTISZDisplayable(LPWSTR multi)
/******************************************************************************* /*******************************************************************************
* Local module support methods * 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; LINE_INFO* linfo;
LVITEMW item; LVITEMW item;
...@@ -202,6 +202,7 @@ static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType, void *ValB ...@@ -202,6 +202,7 @@ static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType, void *ValB
} }
} }
} }
return index;
} }
static BOOL InitListViewImageList(HWND hWndListView) static BOOL InitListViewImageList(HWND hWndListView)
......
...@@ -117,6 +117,7 @@ extern void SetupStatusBar(HWND hWnd, BOOL bResize); ...@@ -117,6 +117,7 @@ extern void SetupStatusBar(HWND hWnd, BOOL bResize);
extern void UpdateStatusBar(void); extern void UpdateStatusBar(void);
/* listview.c */ /* listview.c */
extern int AddEntryToList(HWND hwndLV, WCHAR *Name, DWORD dwValType, void *ValBuf, DWORD dwCount);
extern HWND CreateListView(HWND hwndParent, UINT id); extern HWND CreateListView(HWND hwndParent, UINT id);
extern BOOL RefreshListView(HWND hwndLV, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR highlightValue); extern BOOL RefreshListView(HWND hwndLV, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR highlightValue);
extern HWND StartValueRename(HWND hwndLV); extern HWND StartValueRename(HWND hwndLV);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment