Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
61197df7
Commit
61197df7
authored
Mar 12, 2004
by
Zimler Attila
Committed by
Alexandre Julliard
Mar 12, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add delete key support.
parent
ced6ca78
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
3 deletions
+39
-3
En.rc
programs/regedit/En.rc
+1
-0
Makefile.in
programs/regedit/Makefile.in
+1
-1
edit.c
programs/regedit/edit.c
+25
-0
framewnd.c
programs/regedit/framewnd.c
+8
-2
main.h
programs/regedit/main.h
+3
-0
resource.h
programs/regedit/resource.h
+1
-0
No files found.
programs/regedit/En.rc
View file @
61197df7
...
...
@@ -228,6 +228,7 @@ END
STRINGTABLE DISCARDABLE
BEGIN
IDS_ERROR "Error"
IDS_BAD_KEY "Can't query key '%s'"
IDS_BAD_VALUE "Can't query value '%s'"
IDS_UNSUPPORTED_TYPE "Can't edit keys of this type (%ld)"
IDS_TOO_BIG_VALUE "Value is too big (%ld)"
...
...
programs/regedit/Makefile.in
View file @
61197df7
...
...
@@ -5,7 +5,7 @@ VPATH = @srcdir@
MODULE
=
regedit.exe
APPMODE
=
-mwindows
IMPORTS
=
msvcrt advapi32 kernel32
DELAYIMPORTS
=
shell32 comdlg32 comctl32 user32 gdi32
DELAYIMPORTS
=
sh
lwapi sh
ell32 comdlg32 comctl32 user32 gdi32
EXTRAINCL
=
-I
$(TOPSRCDIR)
/include/msvcrt
EXTRADEFS
=
-DNO_LIBWINE_PORT
...
...
programs/regedit/edit.c
View file @
61197df7
...
...
@@ -28,6 +28,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <shellapi.h>
#include <shlwapi.h>
#include "main.h"
#include "regproc.h"
...
...
@@ -228,6 +229,30 @@ done:
return
result
;
}
BOOL
DeleteKey
(
HWND
hwnd
,
HKEY
hKeyRoot
,
LPCTSTR
keyPath
)
{
BOOL
result
=
FALSE
;
LONG
lRet
;
HKEY
hKey
;
lRet
=
RegOpenKeyEx
(
hKeyRoot
,
keyPath
,
0
,
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
,
keyPath
)
!=
IDYES
)
goto
done
;
lRet
=
SHDeleteKey
(
hKeyRoot
,
keyPath
);
if
(
lRet
!=
ERROR_SUCCESS
)
{
error
(
hwnd
,
IDS_BAD_KEY
,
keyPath
);
goto
done
;
}
result
=
TRUE
;
done:
RegCloseKey
(
hKey
);
return
result
;
}
BOOL
DeleteValue
(
HWND
hwnd
,
HKEY
hKeyRoot
,
LPCTSTR
keyPath
,
LPCTSTR
valueName
)
{
BOOL
result
=
FALSE
;
...
...
programs/regedit/framewnd.c
View file @
61197df7
...
...
@@ -458,8 +458,13 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
PrintRegistryHive
(
hWnd
,
_T
(
""
));
break
;
case
ID_EDIT_DELETE
:
if
(
DeleteValue
(
hWnd
,
hKeyRoot
,
keyPath
,
valueName
))
RefreshListView
(
g_pChildWnd
->
hListWnd
,
hKeyRoot
,
keyPath
);
if
(
GetFocus
()
==
g_pChildWnd
->
hTreeWnd
)
{
if
(
DeleteKey
(
hWnd
,
hKeyRoot
,
keyPath
))
;
/* FIXME: TreeView should be refreshed */
}
else
if
(
GetFocus
()
==
g_pChildWnd
->
hListWnd
)
{
if
(
DeleteValue
(
hWnd
,
hKeyRoot
,
keyPath
,
valueName
))
RefreshListView
(
g_pChildWnd
->
hListWnd
,
hKeyRoot
,
keyPath
);
}
break
;
case
ID_EDIT_MODIFY
:
if
(
ModifyValue
(
hWnd
,
hKeyRoot
,
keyPath
,
valueName
))
...
...
@@ -470,6 +475,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
break
;
case
ID_EDIT_NEW_KEY
:
CreateKey
(
hWnd
,
hKeyRoot
,
keyPath
);
/* FIXME: TreeView should be refreshed */
break
;
case
ID_EDIT_NEW_STRINGVALUE
:
valueType
=
REG_SZ
;
...
...
programs/regedit/main.h
View file @
61197df7
...
...
@@ -91,6 +91,8 @@ extern HWND CreateListView(HWND hwndParent, int id);
extern
BOOL
RefreshListView
(
HWND
hwndLV
,
HKEY
hKeyRoot
,
LPCTSTR
keyPath
);
extern
BOOL
StartValueRename
(
HWND
hwndLV
);
extern
LPCTSTR
GetValueName
(
HWND
hwndLV
);
extern
BOOL
ListWndNotifyProc
(
HWND
hWnd
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
*
Result
);
extern
BOOL
IsDefaultValue
(
HWND
hwndLV
,
int
i
);
/* treeview.c */
extern
HWND
CreateTreeView
(
HWND
hwndParent
,
LPTSTR
pHostName
,
int
id
);
...
...
@@ -101,6 +103,7 @@ extern LPCTSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey);
extern
BOOL
CreateKey
(
HWND
hwnd
,
HKEY
hKeyRoot
,
LPCTSTR
keyPath
);
extern
BOOL
CreateValue
(
HWND
hwnd
,
HKEY
hKeyRoot
,
LPCTSTR
keyPath
,
DWORD
valueType
);
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
RenameValue
(
HWND
hwnd
,
HKEY
hRootKey
,
LPCTSTR
keyPath
,
LPCTSTR
oldName
,
LPCTSTR
newName
);
...
...
programs/regedit/resource.h
View file @
61197df7
...
...
@@ -117,6 +117,7 @@
#define IDC_DWORD_DEC 32854
#define IDS_NEWKEY 32860
#define IDS_NEWVALUE 32861
#define IDS_BAD_KEY 32862
#define ID_EDIT_MODIFY_BIN 32870
#define IDD_EDIT_STRING 2000
...
...
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