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
071b7dae
Commit
071b7dae
authored
Jan 03, 2004
by
Zimler Attila
Committed by
Alexandre Julliard
Jan 03, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for creating new keys.
parent
32c7454d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
0 deletions
+40
-0
En.rc
programs/regedit/En.rc
+1
-0
edit.c
programs/regedit/edit.c
+34
-0
framewnd.c
programs/regedit/framewnd.c
+3
-0
main.h
programs/regedit/main.h
+1
-0
resource.h
programs/regedit/resource.h
+1
-0
No files found.
programs/regedit/En.rc
View file @
071b7dae
...
...
@@ -201,6 +201,7 @@ BEGIN
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)"
IDS_NEWKEY "New Key"
END
/*****************************************************************/
...
...
programs/regedit/edit.c
View file @
071b7dae
...
...
@@ -91,6 +91,40 @@ INT_PTR CALLBACK modify_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
return
FALSE
;
}
BOOL
CreateKey
(
HKEY
hKey
)
{
LONG
lRet
;
HKEY
retKey
;
TCHAR
keyName
[
32
];
static
TCHAR
newKey
[
28
]
=
""
;
/* should be max keyName len - 4 */
HINSTANCE
hInstance
;
unsigned
int
keyNum
=
1
;
/* If we have illegal parameter return with operation failure */
if
(
!
hKey
)
return
FALSE
;
/* Load localized "new key" string. -4 is because we need max 4 character
to numbering. */
if
(
newKey
[
0
]
==
0
)
{
hInstance
=
GetModuleHandle
(
0
);
if
(
!
LoadString
(
hInstance
,
IDS_NEWKEY
,
newKey
,
COUNT_OF
(
newKey
)))
lstrcpy
(
newKey
,
"new key"
);
}
lstrcpy
(
keyName
,
newKey
);
/* try to find out a name for the newly create key.
We try it max 100 times. */
lRet
=
RegOpenKey
(
hKey
,
keyName
,
&
retKey
);
while
(
lRet
==
ERROR_SUCCESS
&&
keyNum
<
100
)
{
sprintf
(
keyName
,
"%s %u"
,
newKey
,
++
keyNum
);
lRet
=
RegOpenKey
(
hKey
,
keyName
,
&
retKey
);
}
if
(
lRet
==
ERROR_SUCCESS
)
return
FALSE
;
lRet
=
RegCreateKey
(
hKey
,
keyName
,
&
retKey
);
return
lRet
==
ERROR_SUCCESS
;
}
BOOL
ModifyValue
(
HWND
hwnd
,
HKEY
hKey
,
LPCTSTR
valueName
)
{
DWORD
valueDataLen
;
...
...
programs/regedit/framewnd.c
View file @
071b7dae
...
...
@@ -469,6 +469,9 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case
ID_EDIT_COPYKEYNAME
:
CopyKeyName
(
hWnd
,
_T
(
""
));
break
;
case
ID_EDIT_NEW_KEY
:
CreateKey
(
hKey
);
break
;
case
ID_REGISTRY_PRINTERSETUP
:
/*PRINTDLG pd;*/
/*PrintDlg(&pd);*/
...
...
programs/regedit/main.h
View file @
071b7dae
...
...
@@ -93,6 +93,7 @@ extern BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv);
extern
LPCTSTR
GetItemPath
(
HWND
hwndTV
,
HTREEITEM
hItem
,
HKEY
*
phRootKey
);
/* edit.c */
BOOL
CreateKey
(
HKEY
hKey
);
BOOL
ModifyValue
(
HWND
hwnd
,
HKEY
hKey
,
LPCTSTR
valueName
);
#endif
/* __MAIN_H__ */
programs/regedit/resource.h
View file @
071b7dae
...
...
@@ -106,6 +106,7 @@
#define IDS_BAD_VALUE 32837
#define IDS_UNSUPPORTED_TYPE 32838
#define IDS_TOO_BIG_VALUE 32839
#define IDS_NEWKEY 32840
#define IDD_EDIT_STRING 2000
#define IDC_VALUE_NAME 2001
...
...
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