mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-14 18:25:40 +00:00
regedit: Use zero as a default for REG_DWORD and REG_QWORD values.
This commit is contained in:
parent
89bbd1327e
commit
93199da8c3
|
@ -184,15 +184,26 @@ static INT_PTR CALLBACK modify_string_dlgproc(HWND hwndDlg, UINT msg, WPARAM wpa
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL change_dword_base(HWND hwndDlg, BOOL toHex)
|
static void change_dword_base(HWND hwndDlg, BOOL toHex)
|
||||||
{
|
{
|
||||||
WCHAR buf[128];
|
WCHAR buf[64];
|
||||||
|
unsigned int len;
|
||||||
UINT64 val;
|
UINT64 val;
|
||||||
|
|
||||||
if (!GetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, buf, ARRAY_SIZE(buf))) return FALSE;
|
len = GetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, buf, ARRAY_SIZE(buf));
|
||||||
if (!swscanf(buf, toHex ? L"%I64u" : L"%I64x", &val)) return FALSE;
|
if (!len) SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, L"0");
|
||||||
wsprintfW(buf, toHex ? L"%I64x" : L"%I64u", val);
|
|
||||||
return SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, buf);
|
if ((isDecimal && !toHex) || (!isDecimal && toHex))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (len)
|
||||||
|
{
|
||||||
|
swscanf(buf, toHex ? L"%I64u" : L"%I64x", &val);
|
||||||
|
swprintf(buf, ARRAY_SIZE(buf), toHex ? L"%I64x" : L"%I64u", val);
|
||||||
|
SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
isDecimal = !toHex;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT msg, WPARAM wparam, LPARAM lparam)
|
static INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||||
|
@ -217,10 +228,10 @@ static INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT msg, WPARAM wpar
|
||||||
switch (LOWORD(wparam))
|
switch (LOWORD(wparam))
|
||||||
{
|
{
|
||||||
case IDC_DWORD_HEX:
|
case IDC_DWORD_HEX:
|
||||||
if (isDecimal && change_dword_base(hwndDlg, TRUE)) isDecimal = FALSE;
|
change_dword_base(hwndDlg, TRUE);
|
||||||
break;
|
break;
|
||||||
case IDC_DWORD_DEC:
|
case IDC_DWORD_DEC:
|
||||||
if (!isDecimal && change_dword_base(hwndDlg, FALSE)) isDecimal = TRUE;
|
change_dword_base(hwndDlg, FALSE);
|
||||||
break;
|
break;
|
||||||
case IDOK:
|
case IDOK:
|
||||||
params = (struct edit_params *)GetWindowLongPtrW(hwndDlg, DWLP_USER);
|
params = (struct edit_params *)GetWindowLongPtrW(hwndDlg, DWLP_USER);
|
||||||
|
|
Loading…
Reference in a new issue