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
cb563dba
Commit
cb563dba
authored
Jun 16, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Jun 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Re-insert the default value item after deleting its data.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7f76cf6c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
7 deletions
+21
-7
edit.c
programs/regedit/edit.c
+2
-1
framewnd.c
programs/regedit/framewnd.c
+14
-1
listview.c
programs/regedit/listview.c
+4
-4
main.h
programs/regedit/main.h
+1
-1
No files found.
programs/regedit/edit.c
View file @
cb563dba
...
...
@@ -483,7 +483,8 @@ BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPW
}
/* Add the new item to the listview */
index
=
AddEntryToList
(
g_pChildWnd
->
hListWnd
,
valueName
,
valueType
,
(
BYTE
*
)
&
valueDword
,
sizeof
(
DWORD
));
index
=
AddEntryToList
(
g_pChildWnd
->
hListWnd
,
valueName
,
valueType
,
(
BYTE
*
)
&
valueDword
,
sizeof
(
DWORD
),
-
1
);
item
.
state
=
LVIS_FOCUSED
|
LVIS_SELECTED
;
item
.
stateMask
=
LVIS_FOCUSED
|
LVIS_SELECTED
;
SendMessageW
(
g_pChildWnd
->
hListWnd
,
LVM_SETITEMSTATE
,
index
,
(
LPARAM
)
&
item
);
...
...
programs/regedit/framewnd.c
View file @
cb563dba
...
...
@@ -806,7 +806,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
HeapFree
(
GetProcessHeap
(),
0
,
keyPath
);
}
else
if
(
hWndDelete
==
g_pChildWnd
->
hListWnd
)
{
unsigned
int
num_selected
,
index
;
unsigned
int
num_selected
,
index
,
focus_idx
;
WCHAR
*
keyPath
;
if
(
!
(
num_selected
=
SendMessageW
(
g_pChildWnd
->
hListWnd
,
LVM_GETSELECTEDCOUNT
,
0
,
0L
)))
...
...
@@ -821,7 +821,9 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
keyPath
=
GetItemPath
(
g_pChildWnd
->
hTreeWnd
,
0
,
&
hKeyRoot
);
focus_idx
=
SendMessageW
(
g_pChildWnd
->
hListWnd
,
LVM_GETNEXTITEM
,
-
1
,
MAKELPARAM
(
LVNI_FOCUSED
,
0
));
index
=
SendMessageW
(
g_pChildWnd
->
hListWnd
,
LVM_GETNEXTITEM
,
-
1
,
MAKELPARAM
(
LVNI_SELECTED
,
0
));
while
(
index
!=
-
1
)
{
WCHAR
*
valueName
=
GetItemText
(
g_pChildWnd
->
hListWnd
,
index
);
...
...
@@ -832,6 +834,17 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
HeapFree
(
GetProcessHeap
(),
0
,
valueName
);
SendMessageW
(
g_pChildWnd
->
hListWnd
,
LVM_DELETEITEM
,
index
,
0L
);
/* the default value item is always visible, so add it back in */
if
(
!
index
)
{
AddEntryToList
(
g_pChildWnd
->
hListWnd
,
NULL
,
REG_SZ
,
NULL
,
0
,
0
);
if
(
!
focus_idx
)
{
LVITEMW
item
;
item
.
state
=
item
.
stateMask
=
LVIS_FOCUSED
;
SendMessageW
(
g_pChildWnd
->
hListWnd
,
LVM_SETITEMSTATE
,
0
,
(
LPARAM
)
&
item
);
}
}
index
=
SendMessageW
(
g_pChildWnd
->
hListWnd
,
LVM_GETNEXTITEM
,
-
1
,
MAKELPARAM
(
LVNI_SELECTED
,
0
));
}
HeapFree
(
GetProcessHeap
(),
0
,
keyPath
);
...
...
programs/regedit/listview.c
View file @
cb563dba
...
...
@@ -157,7 +157,7 @@ void format_value_data(HWND hwndLV, int index, DWORD type, void *data, DWORD siz
}
}
int
AddEntryToList
(
HWND
hwndLV
,
WCHAR
*
Name
,
DWORD
dwValType
,
void
*
ValBuf
,
DWORD
dwCount
)
int
AddEntryToList
(
HWND
hwndLV
,
WCHAR
*
Name
,
DWORD
dwValType
,
void
*
ValBuf
,
DWORD
dwCount
,
int
pos
)
{
LINE_INFO
*
linfo
;
LVITEMW
item
;
...
...
@@ -178,7 +178,7 @@ int AddEntryToList(HWND hwndLV, WCHAR *Name, DWORD dwValType, void *ValBuf, DWOR
}
item
.
mask
=
LVIF_TEXT
|
LVIF_PARAM
|
LVIF_STATE
|
LVIF_IMAGE
;
item
.
iItem
=
SendMessageW
(
hwndLV
,
LVM_GETITEMCOUNT
,
0
,
0
)
;
item
.
iItem
=
(
pos
==
-
1
)
?
SendMessageW
(
hwndLV
,
LVM_GETITEMCOUNT
,
0
,
0
)
:
pos
;
item
.
iSubItem
=
0
;
item
.
state
=
0
;
item
.
stateMask
=
LVIS_FOCUSED
|
LVIS_SELECTED
;
...
...
@@ -557,7 +557,7 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR highli
valSize
=
max_val_size
;
if
(
RegQueryValueExW
(
hKey
,
NULL
,
NULL
,
&
valType
,
valBuf
,
&
valSize
)
==
ERROR_FILE_NOT_FOUND
)
{
AddEntryToList
(
hwndLV
,
NULL
,
REG_SZ
,
NULL
,
0
);
AddEntryToList
(
hwndLV
,
NULL
,
REG_SZ
,
NULL
,
0
,
-
1
);
}
for
(
index
=
0
;
index
<
val_count
;
index
++
)
{
valNameLen
=
max_val_name_len
;
...
...
@@ -566,7 +566,7 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR highli
errCode
=
RegEnumValueW
(
hKey
,
index
,
valName
,
&
valNameLen
,
NULL
,
&
valType
,
valBuf
,
&
valSize
);
if
(
errCode
!=
ERROR_SUCCESS
)
goto
done
;
valBuf
[
valSize
]
=
0
;
AddEntryToList
(
hwndLV
,
valName
[
0
]
?
valName
:
NULL
,
valType
,
valBuf
,
valSize
);
AddEntryToList
(
hwndLV
,
valName
[
0
]
?
valName
:
NULL
,
valType
,
valBuf
,
valSize
,
-
1
);
}
memset
(
&
item
,
0
,
sizeof
(
item
));
...
...
programs/regedit/main.h
View file @
cb563dba
...
...
@@ -118,7 +118,7 @@ extern void UpdateStatusBar(void);
/* listview.c */
extern
void
format_value_data
(
HWND
hwndLV
,
int
index
,
DWORD
type
,
void
*
data
,
DWORD
size
);
extern
int
AddEntryToList
(
HWND
hwndLV
,
WCHAR
*
Name
,
DWORD
dwValType
,
void
*
ValBuf
,
DWORD
dwCount
);
extern
int
AddEntryToList
(
HWND
hwndLV
,
WCHAR
*
Name
,
DWORD
dwValType
,
void
*
ValBuf
,
DWORD
dwCount
,
int
pos
);
extern
HWND
CreateListView
(
HWND
hwndParent
,
UINT
id
);
extern
BOOL
RefreshListView
(
HWND
hwndLV
,
HKEY
hKeyRoot
,
LPCWSTR
keyPath
,
LPCWSTR
highlightValue
);
extern
HWND
StartValueRename
(
HWND
hwndLV
);
...
...
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