Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d2664e0f
Commit
d2664e0f
authored
Aug 31, 2008
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Sep 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Set the unicode flag for the listview.
parent
d0991c92
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
32 deletions
+27
-32
edit.c
programs/regedit/edit.c
+3
-3
listview.c
programs/regedit/listview.c
+21
-23
main.c
programs/regedit/main.c
+2
-4
main.h
programs/regedit/main.h
+1
-2
No files found.
programs/regedit/edit.c
View file @
d2664e0f
...
...
@@ -165,7 +165,7 @@ static INT_PTR CALLBACK bin_modify_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wPara
if
(
params
->
lpszValueName
)
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_NAME
,
params
->
lpszValueName
);
else
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_NAME
,
g_pszDefaultValueName
W
);
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_NAME
,
g_pszDefaultValueName
);
SendDlgItemMessage
(
hwndDlg
,
IDC_VALUE_DATA
,
HEM_SETDATA
,
(
WPARAM
)
params
->
cbData
,
(
LPARAM
)
params
->
pData
);
return
TRUE
;
case
WM_COMMAND
:
...
...
@@ -299,7 +299,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
return
FALSE
;
}
editValueName
=
valueName
?
valueName
:
g_pszDefaultValueName
W
;
editValueName
=
valueName
?
valueName
:
g_pszDefaultValueName
;
if
(
!
(
stringValueData
=
read_value
(
hwnd
,
hKey
,
valueName
,
&
type
,
&
len
)))
goto
done
;
if
(
(
type
==
REG_SZ
)
||
(
type
==
REG_EXPAND_SZ
)
)
{
...
...
@@ -428,7 +428,7 @@ BOOL DeleteValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName, B
BOOL
result
=
FALSE
;
LONG
lRet
;
HKEY
hKey
;
LPCWSTR
visibleValueName
=
valueName
?
valueName
:
g_pszDefaultValueName
W
;
LPCWSTR
visibleValueName
=
valueName
?
valueName
:
g_pszDefaultValueName
;
WCHAR
empty
=
0
;
lRet
=
RegOpenKeyExW
(
hKeyRoot
,
keyPath
,
0
,
KEY_READ
|
KEY_SET_VALUE
,
&
hKey
);
...
...
programs/regedit/listview.c
View file @
d2664e0f
...
...
@@ -2,6 +2,7 @@
* Regedit listviews
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
* Copyright (C) 2008 Alexander N. Sørnes <alex@thehandofagony.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -49,8 +50,7 @@ static BOOL g_invertSort = FALSE;
static
LPWSTR
g_valueName
;
static
LPWSTR
g_currentPath
;
static
HKEY
g_currentRootKey
;
static
WCHAR
g_szValueNotSetW
[
64
];
static
TCHAR
g_szValueNotSet
[
64
];
static
WCHAR
g_szValueNotSet
[
64
];
#define MAX_LIST_COLUMNS (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
static
int
default_column_widths
[
MAX_LIST_COLUMNS
]
=
{
200
,
175
,
400
};
...
...
@@ -192,7 +192,7 @@ static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType,
if
(
ValBuf
)
{
ListView_SetItemTextW
(
hwndLV
,
index
,
2
,
ValBuf
);
}
else
{
ListView_SetItemTextW
(
hwndLV
,
index
,
2
,
g_szValueNotSet
W
);
ListView_SetItemTextW
(
hwndLV
,
index
,
2
,
g_szValueNotSet
);
}
break
;
case
REG_DWORD
:
{
...
...
@@ -280,10 +280,10 @@ static BOOL CreateListColumns(HWND hWndListView)
/* OnGetDispInfo - processes the LVN_GETDISPINFO notification message. */
static
void
OnGetDispInfo
(
NMLVDISPINFO
*
plvdi
)
static
void
OnGetDispInfo
(
NMLVDISPINFO
W
*
plvdi
)
{
static
T
CHAR
buffer
[
200
];
static
T
CHAR
reg_szT
[]
=
{
'R'
,
'E'
,
'G'
,
'_'
,
'S'
,
'Z'
,
0
},
static
W
CHAR
buffer
[
200
];
static
W
CHAR
reg_szT
[]
=
{
'R'
,
'E'
,
'G'
,
'_'
,
'S'
,
'Z'
,
0
},
reg_expand_szT
[]
=
{
'R'
,
'E'
,
'G'
,
'_'
,
'E'
,
'X'
,
'P'
,
'A'
,
'N'
,
'D'
,
'_'
,
'S'
,
'Z'
,
0
},
reg_binaryT
[]
=
{
'R'
,
'E'
,
'G'
,
'_'
,
'B'
,
'I'
,
'N'
,
'A'
,
'R'
,
'Y'
,
0
},
reg_dwordT
[]
=
{
'R'
,
'E'
,
'G'
,
'_'
,
'D'
,
'W'
,
'O'
,
'R'
,
'D'
,
0
},
...
...
@@ -300,7 +300,7 @@ static void OnGetDispInfo(NMLVDISPINFO* plvdi)
switch
(
plvdi
->
item
.
iSubItem
)
{
case
0
:
plvdi
->
item
.
pszText
=
(
LPSTR
)
g_pszDefaultValueName
;
plvdi
->
item
.
pszText
=
g_pszDefaultValueName
;
break
;
case
1
:
switch
(((
LINE_INFO
*
)
plvdi
->
item
.
lParam
)
->
dwValType
)
{
...
...
@@ -333,9 +333,9 @@ static void OnGetDispInfo(NMLVDISPINFO* plvdi)
break
;
default:
{
T
CHAR
szUnknownFmt
[
64
];
LoadString
(
hInst
,
IDS_REGISTRY_UNKNOWN_TYPE
,
szUnknownFmt
,
COUNT_OF
(
szUnknownFmt
));
wsprintf
(
buffer
,
szUnknownFmt
,
plvdi
->
item
.
lParam
);
W
CHAR
szUnknownFmt
[
64
];
LoadString
W
(
hInst
,
IDS_REGISTRY_UNKNOWN_TYPE
,
szUnknownFmt
,
COUNT_OF
(
szUnknownFmt
));
wsprintf
W
(
buffer
,
szUnknownFmt
,
plvdi
->
item
.
lParam
);
plvdi
->
item
.
pszText
=
buffer
;
break
;
}
...
...
@@ -403,12 +403,12 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
case
WM_NOTIFY_REFLECT
:
switch
(((
LPNMHDR
)
lParam
)
->
code
)
{
case
LVN_BEGINLABELEDIT
:
if
(
!
((
NMLVDISPINFO
*
)
lParam
)
->
item
.
iItem
)
case
LVN_BEGINLABELEDIT
W
:
if
(
!
((
NMLVDISPINFO
W
*
)
lParam
)
->
item
.
iItem
)
return
1
;
return
0
;
case
LVN_GETDISPINFO
:
OnGetDispInfo
((
NMLVDISPINFO
*
)
lParam
);
case
LVN_GETDISPINFO
W
:
OnGetDispInfo
((
NMLVDISPINFO
W
*
)
lParam
);
break
;
case
LVN_COLUMNCLICK
:
if
(
g_columnToSort
==
((
LPNMLISTVIEW
)
lParam
)
->
iSubItem
)
...
...
@@ -418,20 +418,18 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
g_invertSort
=
FALSE
;
}
SendMessage
(
hWnd
,
LVM_SORTITEMS
,
(
WPARAM
)
hWnd
,
(
LPARAM
)
CompareFunc
);
SendMessage
W
(
hWnd
,
LVM_SORTITEMS
,
(
WPARAM
)
hWnd
,
(
LPARAM
)
CompareFunc
);
break
;
case
LVN_ENDLABELEDIT
:
{
LPNMLVDISPINFO
dispInfo
=
(
LPNMLVDISPINFO
)
lParam
;
case
LVN_ENDLABELEDIT
W
:
{
LPNMLVDISPINFO
W
dispInfo
=
(
LPNMLVDISPINFOW
)
lParam
;
LPWSTR
oldName
=
GetItemTextW
(
hWnd
,
dispInfo
->
item
.
iItem
);
WCHAR
*
newName
=
GetWideString
(
dispInfo
->
item
.
pszText
);
LONG
ret
;
if
(
!
oldName
)
return
-
1
;
/* cannot rename a default value */
ret
=
RenameValue
(
hWnd
,
g_currentRootKey
,
g_currentPath
,
oldName
,
newName
);
ret
=
RenameValue
(
hWnd
,
g_currentRootKey
,
g_currentPath
,
oldName
,
dispInfo
->
item
.
pszText
);
if
(
ret
)
{
RefreshListView
(
hWnd
,
g_currentRootKey
,
g_currentPath
,
newName
);
RefreshListView
(
hWnd
,
g_currentRootKey
,
g_currentPath
,
dispInfo
->
item
.
pszText
);
}
HeapFree
(
GetProcessHeap
(),
0
,
newName
);
HeapFree
(
GetProcessHeap
(),
0
,
oldName
);
return
0
;
}
...
...
@@ -496,8 +494,7 @@ HWND CreateListView(HWND hwndParent, UINT id)
WCHAR
ListView
[]
=
{
'L'
,
'i'
,
's'
,
't'
,
' '
,
'V'
,
'i'
,
'e'
,
'w'
,
0
};
/* prepare strings */
LoadString
(
hInst
,
IDS_REGISTRY_VALUE_NOT_SET
,
g_szValueNotSet
,
COUNT_OF
(
g_szValueNotSet
));
LoadStringW
(
hInst
,
IDS_REGISTRY_VALUE_NOT_SET
,
g_szValueNotSetW
,
COUNT_OF
(
g_szValueNotSetW
));
LoadStringW
(
hInst
,
IDS_REGISTRY_VALUE_NOT_SET
,
g_szValueNotSet
,
COUNT_OF
(
g_szValueNotSet
));
/* Get the dimensions of the parent window's client area, and create the list view control. */
GetClientRect
(
hwndParent
,
&
rcClient
);
...
...
@@ -506,6 +503,7 @@ HWND CreateListView(HWND hwndParent, UINT id)
0
,
0
,
rcClient
.
right
,
rcClient
.
bottom
,
hwndParent
,
(
HMENU
)
ULongToHandle
(
id
),
hInst
,
NULL
);
if
(
!
hwndLV
)
return
NULL
;
SendMessageW
(
hwndLV
,
LVM_SETUNICODEFORMAT
,
TRUE
,
0
);
SendMessageW
(
hwndLV
,
LVM_SETEXTENDEDLISTVIEWSTYLE
,
0
,
LVS_EX_FULLROWSELECT
);
/* Initialize the image list */
...
...
programs/regedit/main.c
View file @
d2664e0f
...
...
@@ -29,8 +29,7 @@
#define REGEDIT_DECLARE_FUNCTIONS
#include "main.h"
TCHAR
g_pszDefaultValueName
[
64
];
WCHAR
g_pszDefaultValueNameW
[
64
];
WCHAR
g_pszDefaultValueName
[
64
];
BOOL
ProcessCmdLine
(
LPSTR
lpCmdLine
);
...
...
@@ -183,8 +182,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
/* Initialize global strings */
LoadString
(
hInstance
,
IDS_APP_TITLE
,
szTitle
,
COUNT_OF
(
szTitle
));
LoadString
(
hInstance
,
IDS_REGISTRY_DEFAULT_VALUE
,
g_pszDefaultValueName
,
COUNT_OF
(
g_pszDefaultValueName
));
LoadStringW
(
hInstance
,
IDS_REGISTRY_DEFAULT_VALUE
,
g_pszDefaultValueNameW
,
COUNT_OF
(
g_pszDefaultValueNameW
));
LoadStringW
(
hInstance
,
IDS_REGISTRY_DEFAULT_VALUE
,
g_pszDefaultValueName
,
COUNT_OF
(
g_pszDefaultValueName
));
/* Store instance handle in our global variable */
hInst
=
hInstance
;
...
...
programs/regedit/main.h
View file @
d2664e0f
...
...
@@ -90,8 +90,7 @@ extern enum OPTION_FLAGS Options;
extern
TCHAR
szTitle
[];
extern
const
TCHAR
szFrameClass
[];
extern
const
TCHAR
szChildClass
[];
extern
TCHAR
g_pszDefaultValueName
[];
extern
WCHAR
g_pszDefaultValueNameW
[];
extern
WCHAR
g_pszDefaultValueName
[];
/* Registry class names and their indexes */
extern
const
WCHAR
*
reg_class_namesW
[];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment