#include <stdio.h>
#include "main.h"
+#include "regproc.h"
#define CX_ICON 16
#define CY_ICON 16
if (!g_valueName) return NULL;
*g_valueName = 0;
maxLen = HeapSize(GetProcessHeap(), 0, g_valueName);
- if (maxLen == (SIZE_T) - 1) return NULL;
+ if (maxLen == -1) return NULL;
item = ListView_GetNextItem(hwndLV, iStartAt, LVNI_SELECTED);
if (item == -1) return NULL;
{
PLINE_INFO lineinfo;
LVITEM Item;
-
+
Item.mask = LVIF_PARAM;
Item.iItem = i;
if(ListView_GetItem(hwndLV, &Item))
break;
case REG_MULTI_SZ:
{
- LPTSTR src, str, cursrc;
+ LPTSTR src, str;
if(dwCount >= 2)
{
src = (LPTSTR)ValBuf;
LPTSTR strBinary;
if(dwCount > 0)
{
- strBinary = HeapAlloc(GetProcessHeap(), 0, (dwCount * sizeof(TCHAR) * 3) + 1);
+ strBinary = HeapAlloc(GetProcessHeap(), 0, (dwCount * sizeof(TCHAR) * 3) + sizeof(TCHAR));
for (i = 0; i < dwCount; i++)
{
wsprintf( strBinary + i*3, _T("%02X "), pData[i] );
else
{
TCHAR szText[128];
- LoadString(hInst, IDS_BINARY_EMPTY, szText, sizeof(szText)/sizeof(TCHAR));
- ListView_SetItemText(hwndLV, index, 2, szText);
+ LoadString(hInst, IDS_BINARY_EMPTY, szText, sizeof(szText)/sizeof(TCHAR));
+ ListView_SetItemText(hwndLV, index, 2, szText);
}
}
break;
hico = LoadIcon(hInst, MAKEINTRESOURCE(IDI_BIN));
Image_Bin = ImageList_AddIcon(himl, hico);
-
+
hico = LoadIcon(hInst, MAKEINTRESOURCE(IDI_STRING));
Image_String = ImageList_AddIcon(himl, hico);
-
+
/* Fail if not all of the images were added. */
if (ImageList_GetImageCount(himl) < NUM_ICONS)
break;
case 1:
switch (((LINE_INFO*)plvdi->item.lParam)->dwValType) {
+ case REG_NONE:
+ plvdi->item.pszText = _T("REG_NONE");
+ break;
case REG_SZ:
plvdi->item.pszText = _T("REG_SZ");
break;
case REG_BINARY:
plvdi->item.pszText = _T("REG_BINARY");
break;
- case REG_DWORD:
+ case REG_DWORD: /* REG_DWORD_LITTLE_ENDIAN */
plvdi->item.pszText = _T("REG_DWORD");
break;
case REG_DWORD_BIG_ENDIAN:
plvdi->item.pszText = _T("REG_DWORD_BIG_ENDIAN");
break;
- case REG_MULTI_SZ:
- plvdi->item.pszText = _T("REG_MULTI_SZ");
- break;
case REG_LINK:
plvdi->item.pszText = _T("REG_LINK");
break;
+ case REG_MULTI_SZ:
+ plvdi->item.pszText = _T("REG_MULTI_SZ");
+ break;
case REG_RESOURCE_LIST:
plvdi->item.pszText = _T("REG_RESOURCE_LIST");
break;
case REG_RESOURCE_REQUIREMENTS_LIST:
plvdi->item.pszText = _T("REG_RESOURCE_REQUIREMENTS_LIST");
break;
- case REG_NONE:
- plvdi->item.pszText = _T("REG_NONE");
+ case REG_QWORD: /* REG_QWORD_LITTLE_ENDIAN */
+ plvdi->item.pszText = _T("REG_QWORD");
break;
default: {
TCHAR buf2[200];
LINE_INFO*l, *r;
l = (LINE_INFO*)lParam1;
r = (LINE_INFO*)lParam2;
-
- if (g_columnToSort == ~0UL)
+
+ if (g_columnToSort == ~0UL)
g_columnToSort = 0;
-
+
if (g_columnToSort == 1 && l->dwValType != r->dwValType)
return g_invertSort ? (int)r->dwValType - (int)l->dwValType : (int)l->dwValType - (int)r->dwValType;
if (g_columnToSort == 2) {
return g_invertSort ? _tcscmp(r->name, l->name) : _tcscmp(l->name, r->name);
}
-static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- switch (LOWORD(wParam)) {
- /* case ID_FILE_OPEN: */
- /* break; */
- default:
- return FALSE;
- }
- return TRUE;
-}
-
BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
{
NMLVDISPINFO* Info;
OnGetDispInfo((NMLVDISPINFO*)lParam);
return TRUE;
case LVN_COLUMNCLICK:
- if (g_columnToSort == ((LPNMLISTVIEW)lParam)->iSubItem)
+ if (g_columnToSort == (DWORD)((LPNMLISTVIEW)lParam)->iSubItem)
g_invertSort = !g_invertSort;
else {
g_columnToSort = ((LPNMLISTVIEW)lParam)->iSubItem;
g_invertSort = FALSE;
}
-
+
ListView_SortItems(hWnd, CompareFunc, (WPARAM)hWnd);
return TRUE;
case NM_DBLCLK:
}
else
{
- LONG ret;
//if((ret = RenameValue(lineinfo->name, Info->item.pszText)) != ERROR_SUCCESS)
{
TCHAR msg[128], caption[128];
-
+
LoadString(hInst, IDS_ERR_RENVAL_CAPTION, caption, sizeof(caption)/sizeof(TCHAR));
if(_tcslen(Info->item.pszText) == 0)
{
LoadString(hInst, IDS_ERR_RENVAL_TOEMPTY, msg, sizeof(msg)/sizeof(TCHAR));
+ MessageBox(0, msg, NULL, 0);
+ *Result = TRUE;
}
else
- _stprintf(msg, _T("rename from %s to %s"), lineinfo->name, Info->item.pszText);
- MessageBox(0, msg, NULL, 0);
- *Result = TRUE;
+ {
+ HKEY hKeyRoot;
+ LPCTSTR keyPath;
+ LONG lResult;
+ keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
+ lResult = RegRenameValue(hKeyRoot, keyPath, Info->item.pszText, lineinfo->name);
+ *Result = TRUE;
+ return (lResult == ERROR_SUCCESS);
+ }
}
}
}
0, 0, rcClient.right, rcClient.bottom,
hwndParent, (HMENU)id, hInst, NULL);
if (!hwndLV) return NULL;
-
+
/* Initialize the image list, and add items to the control. */
if (!CreateListColumns(hwndLV)) goto fail;
if (!InitListViewImageLists(hwndLV)) goto fail;
BOOL AddedDefault = FALSE;
if (!hwndLV) return FALSE;
-
+
ListView_EditLabel(hwndLV, -1);
-
+
SendMessage(hwndLV, WM_SETREDRAW, FALSE, 0);
count = ListView_GetItemCount(hwndLV);
for (i = 0; i < count; i++) {
}
g_columnToSort = ~0UL;
ListView_DeleteAllItems(hwndLV);
-
+
if(!hKey) return FALSE;
errCode = RegOpenKeyEx(hKey, keyPath, 0, KEY_READ, &hNewKey);
if (errCode != ERROR_SUCCESS) return FALSE;
/* get size information and resize the buffers if necessary */
- errCode = RegQueryInfoKey(hNewKey, NULL, NULL, NULL, NULL, &max_sub_key_len, NULL,
+ errCode = RegQueryInfoKey(hNewKey, NULL, NULL, NULL, NULL, &max_sub_key_len, NULL,
&val_count, &max_val_name_len, &max_val_size, NULL, NULL);
#define BUF_HEAD_SPACE 2 /* FIXME: check why this is required with ROS ??? */