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
a7f84cc0
Commit
a7f84cc0
authored
Jul 10, 2008
by
Andre Wisplinghoff
Committed by
Alexandre Julliard
Jul 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Implement deleting multiple values.
parent
e4078fb0
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
9 deletions
+34
-9
De.rc
programs/regedit/De.rc
+1
-0
En.rc
programs/regedit/En.rc
+1
-0
Fr.rc
programs/regedit/Fr.rc
+1
-0
edit.c
programs/regedit/edit.c
+4
-3
framewnd.c
programs/regedit/framewnd.c
+21
-2
listview.c
programs/regedit/listview.c
+3
-3
main.h
programs/regedit/main.h
+2
-1
resource.h
programs/regedit/resource.h
+1
-0
No files found.
programs/regedit/De.rc
View file @
a7f84cc0
...
...
@@ -299,6 +299,7 @@ BEGIN
IDS_TOO_BIG_VALUE "Der Wert ist zu gro (%ld)"
IDS_DELETE_BOX_TITLE "Bitte besttigen"
IDS_DELETE_BOX_TEXT "Wollen Sie '%s' wirklich lschen?"
IDS_DELETE_BOX_TEXT_MULTIPLE "Wollen Sie diese Werte wirklich lschen?"
IDS_NEWKEY "Neuer Schlssel #%d"
IDS_NEWVALUE "Neuer Wert #%d"
IDS_NOTFOUND "Suchfolge '%s' wurde nicht gefunden."
...
...
programs/regedit/En.rc
View file @
a7f84cc0
...
...
@@ -371,6 +371,7 @@ BEGIN
IDS_TOO_BIG_VALUE "Value is too big (%ld)"
IDS_DELETE_BOX_TITLE "Confirm Value Delete"
IDS_DELETE_BOX_TEXT "Are you sure you want to delete value '%s'?"
IDS_DELETE_BOX_TEXT_MULTIPLE "Are you sure you want to delete these values?"
IDS_NEWKEY "New Key #%d"
IDS_NEWVALUE "New Value #%d"
IDS_NOTFOUND "Search string '%s' not found"
...
...
programs/regedit/Fr.rc
View file @
a7f84cc0
...
...
@@ -294,6 +294,7 @@ BEGIN
IDS_TOO_BIG_VALUE "La valeur est trop grande (%ld)"
IDS_DELETE_BOX_TITLE "Confirmez l'effacement de valeur"
IDS_DELETE_BOX_TEXT "tes vous sr vous voulez supprimer la valeur '%s'?"
IDS_DELETE_BOX_TEXT_MULTIPLE "tes vous sr vous voulez supprimer cette valeurs?"
IDS_NEWKEY "Nouvelle Cl #%d"
IDS_NEWVALUE "Nouvelle Valeur #%d"
IDS_NOTFOUND "Occurence de '%s' non trouve"
...
...
programs/regedit/edit.c
View file @
a7f84cc0
...
...
@@ -413,7 +413,7 @@ done:
return
result
;
}
BOOL
DeleteValue
(
HWND
hwnd
,
HKEY
hKeyRoot
,
LPCTSTR
keyPath
,
LPCTSTR
valueName
)
BOOL
DeleteValue
(
HWND
hwnd
,
HKEY
hKeyRoot
,
LPCTSTR
keyPath
,
LPCTSTR
valueName
,
BOOL
showMessageBox
)
{
BOOL
result
=
FALSE
;
LONG
lRet
;
...
...
@@ -423,8 +423,9 @@ BOOL DeleteValue(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath, LPCTSTR valueName)
lRet
=
RegOpenKeyEx
(
hKeyRoot
,
keyPath
,
0
,
KEY_READ
|
KEY_SET_VALUE
,
&
hKey
);
if
(
lRet
!=
ERROR_SUCCESS
)
return
FALSE
;
if
(
messagebox
(
hwnd
,
MB_YESNO
|
MB_ICONEXCLAMATION
,
IDS_DELETE_BOX_TITLE
,
IDS_DELETE_BOX_TEXT
,
visibleValueName
)
!=
IDYES
)
goto
done
;
if
(
showMessageBox
)
if
(
messagebox
(
hwnd
,
MB_YESNO
|
MB_ICONEXCLAMATION
,
IDS_DELETE_BOX_TITLE
,
IDS_DELETE_BOX_TEXT
,
visibleValueName
)
!=
IDYES
)
goto
done
;
lRet
=
RegDeleteValue
(
hKey
,
valueName
?
valueName
:
""
);
if
(
lRet
!=
ERROR_SUCCESS
&&
valueName
)
{
...
...
programs/regedit/framewnd.c
View file @
a7f84cc0
...
...
@@ -629,9 +629,10 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LPCTSTR
valueName
;
TCHAR
newKey
[
MAX_NEW_KEY_LEN
];
DWORD
valueType
;
int
curIndex
;
BOOL
firstItem
=
TRUE
;
keyPath
=
GetItemPath
(
g_pChildWnd
->
hTreeWnd
,
0
,
&
hKeyRoot
);
valueName
=
GetValueName
(
g_pChildWnd
->
hListWnd
);
if
(
LOWORD
(
wParam
)
>=
ID_FAVORITE_FIRST
&&
LOWORD
(
wParam
)
<=
ID_FAVORITE_LAST
)
{
HKEY
hKey
;
...
...
@@ -674,11 +675,29 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
DeleteNode
(
g_pChildWnd
->
hTreeWnd
,
0
);
}
}
else
if
(
GetFocus
()
==
g_pChildWnd
->
hListWnd
)
{
if
(
DeleteValue
(
hWnd
,
hKeyRoot
,
keyPath
,
valueName
))
curIndex
=
ListView_GetNextItem
(
g_pChildWnd
->
hListWnd
,
-
1
,
LVNI_SELECTED
);
while
(
curIndex
!=
-
1
)
{
valueName
=
GetItemText
(
g_pChildWnd
->
hListWnd
,
curIndex
);
curIndex
=
ListView_GetNextItem
(
g_pChildWnd
->
hListWnd
,
curIndex
,
LVNI_SELECTED
);
if
(
curIndex
!=
-
1
&&
firstItem
)
{
TCHAR
title
[
256
];
TCHAR
text
[
1024
];
if
(
!
LoadString
(
hInst
,
IDS_DELETE_BOX_TITLE
,
title
,
COUNT_OF
(
title
)))
lstrcpy
(
title
,
"Error"
);
if
(
!
LoadString
(
hInst
,
IDS_DELETE_BOX_TEXT_MULTIPLE
,
text
,
COUNT_OF
(
text
)))
lstrcpy
(
text
,
"Unknown error string!"
);
if
(
MessageBox
(
hWnd
,
text
,
title
,
MB_YESNO
|
MB_ICONEXCLAMATION
)
!=
IDYES
)
break
;
}
if
(
!
DeleteValue
(
hWnd
,
hKeyRoot
,
keyPath
,
valueName
,
curIndex
==-
1
&&
firstItem
))
break
;
firstItem
=
FALSE
;
}
RefreshListView
(
g_pChildWnd
->
hListWnd
,
hKeyRoot
,
keyPath
,
NULL
);
}
break
;
case
ID_EDIT_MODIFY
:
valueName
=
GetValueName
(
g_pChildWnd
->
hListWnd
);
if
(
ModifyValue
(
hWnd
,
hKeyRoot
,
keyPath
,
valueName
))
RefreshListView
(
g_pChildWnd
->
hListWnd
,
hKeyRoot
,
keyPath
,
valueName
);
break
;
...
...
programs/regedit/listview.c
View file @
a7f84cc0
...
...
@@ -54,7 +54,7 @@ static TCHAR g_szValueNotSet[64];
static
int
default_column_widths
[
MAX_LIST_COLUMNS
]
=
{
200
,
175
,
400
};
static
int
column_alignment
[
MAX_LIST_COLUMNS
]
=
{
LVCFMT_LEFT
,
LVCFMT_LEFT
,
LVCFMT_LEFT
};
static
LPTSTR
get_item_text
(
HWND
hwndLV
,
int
item
)
LPTSTR
GetItemText
(
HWND
hwndLV
,
UINT
item
)
{
LPTSTR
newStr
,
curStr
;
unsigned
int
maxLen
=
128
;
...
...
@@ -88,7 +88,7 @@ LPCTSTR GetValueName(HWND hwndLV)
item
=
ListView_GetNextItem
(
hwndLV
,
-
1
,
LVNI_FOCUSED
);
if
(
item
==
-
1
)
return
NULL
;
g_valueName
=
get_item_t
ext
(
hwndLV
,
item
);
g_valueName
=
GetItemT
ext
(
hwndLV
,
item
);
return
g_valueName
;
}
...
...
@@ -391,7 +391,7 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
break
;
case
LVN_ENDLABELEDIT
:
{
LPNMLVDISPINFO
dispInfo
=
(
LPNMLVDISPINFO
)
lParam
;
LPTSTR
valueName
=
get_item_t
ext
(
hWnd
,
dispInfo
->
item
.
iItem
);
LPTSTR
valueName
=
GetItemT
ext
(
hWnd
,
dispInfo
->
item
.
iItem
);
LONG
ret
;
if
(
!
valueName
)
return
-
1
;
/* cannot rename a default value */
ret
=
RenameValue
(
hWnd
,
g_currentRootKey
,
g_currentPath
,
valueName
,
dispInfo
->
item
.
pszText
);
...
...
programs/regedit/main.h
View file @
a7f84cc0
...
...
@@ -109,6 +109,7 @@ extern void UpdateStatusBar(void);
extern
HWND
CreateListView
(
HWND
hwndParent
,
UINT
id
);
extern
BOOL
RefreshListView
(
HWND
hwndLV
,
HKEY
hKeyRoot
,
LPCTSTR
keyPath
,
LPCTSTR
highlightValue
);
extern
HWND
StartValueRename
(
HWND
hwndLV
);
extern
LPTSTR
GetItemText
(
HWND
hwndLV
,
UINT
item
);
extern
LPCTSTR
GetValueName
(
HWND
hwndLV
);
extern
BOOL
ListWndNotifyProc
(
HWND
hWnd
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
*
Result
);
extern
BOOL
IsDefaultValue
(
HWND
hwndLV
,
int
i
);
...
...
@@ -129,7 +130,7 @@ extern BOOL CreateKey(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath, LPTSTR newKeyNa
extern
BOOL
CreateValue
(
HWND
hwnd
,
HKEY
hKeyRoot
,
LPCTSTR
keyPath
,
DWORD
valueType
,
LPTSTR
valueName
);
extern
BOOL
ModifyValue
(
HWND
hwnd
,
HKEY
hKeyRoot
,
LPCTSTR
keyPath
,
LPCTSTR
valueName
);
extern
BOOL
DeleteKey
(
HWND
hwnd
,
HKEY
hKeyRoot
,
LPCTSTR
keyPath
);
extern
BOOL
DeleteValue
(
HWND
hwnd
,
HKEY
hKeyRoot
,
LPCTSTR
keyPath
,
LPCTSTR
valueName
);
extern
BOOL
DeleteValue
(
HWND
hwnd
,
HKEY
hKeyRoot
,
LPCTSTR
keyPath
,
LPCTSTR
valueName
,
BOOL
showMessageBox
);
extern
BOOL
RenameValue
(
HWND
hwnd
,
HKEY
hRootKey
,
LPCTSTR
keyPath
,
LPCTSTR
oldName
,
LPCTSTR
newName
);
extern
BOOL
RenameKey
(
HWND
hwnd
,
HKEY
hRootKey
,
LPCTSTR
keyPath
,
LPCTSTR
newName
);
extern
void
error
(
HWND
hwnd
,
INT
resId
,
...);
...
...
programs/regedit/resource.h
View file @
a7f84cc0
...
...
@@ -121,6 +121,7 @@
#define IDS_DELETE_BOX_TITLE 32840
#define IDS_DELETE_BOX_TEXT 32841
#define IDS_NOTFOUND 32842
#define IDS_DELETE_BOX_TEXT_MULTIPLE 32843
#define IDD_EDIT_DWORD 32850
#define IDC_DWORD_BASE 32852
#define IDC_DWORD_HEX 32853
...
...
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