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
3a4eaa2b
Commit
3a4eaa2b
authored
Mar 21, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Mar 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Add icons for the value pane.
- Display REG_MULTI_SZ values. - Make the lack of support for certain value types more noticeable to the user.
parent
06913278
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
9 deletions
+65
-9
listview.c
programs/regedit/listview.c
+65
-9
No files found.
programs/regedit/listview.c
View file @
3a4eaa2b
...
@@ -33,6 +33,9 @@
...
@@ -33,6 +33,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
regedit
);
WINE_DEFAULT_DEBUG_CHANNEL
(
regedit
);
static
INT
Image_String
;
static
INT
Image_Binary
;
typedef
struct
tagLINE_INFO
typedef
struct
tagLINE_INFO
{
{
DWORD
dwValType
;
DWORD
dwValType
;
...
@@ -92,6 +95,21 @@ LPCTSTR GetValueName(HWND hwndLV)
...
@@ -92,6 +95,21 @@ LPCTSTR GetValueName(HWND hwndLV)
return
g_valueName
;
return
g_valueName
;
}
}
/* convert '\0' separated string list into ',' separated string list */
static
void
MakeMULTISZDisplayable
(
LPTSTR
multi
)
{
do
{
for
(;
*
multi
;
multi
++
)
;
if
(
*
(
multi
+
1
))
{
*
multi
=
','
;
multi
++
;
}
}
while
(
*
multi
);
}
/*******************************************************************************
/*******************************************************************************
* Local module support methods
* Local module support methods
*/
*/
...
@@ -112,7 +130,7 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType,
...
@@ -112,7 +130,7 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType,
else
else
linfo
->
name
=
NULL
;
linfo
->
name
=
NULL
;
item
.
mask
=
LVIF_TEXT
|
LVIF_PARAM
|
LVIF_STATE
;
item
.
mask
=
LVIF_TEXT
|
LVIF_PARAM
|
LVIF_STATE
|
LVIF_IMAGE
;
item
.
iItem
=
ListView_GetItemCount
(
hwndLV
);
/*idx; */
item
.
iItem
=
ListView_GetItemCount
(
hwndLV
);
/*idx; */
item
.
iSubItem
=
0
;
item
.
iSubItem
=
0
;
item
.
state
=
0
;
item
.
state
=
0
;
...
@@ -122,10 +140,19 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType,
...
@@ -122,10 +140,19 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType,
if
(
bHighlight
)
{
if
(
bHighlight
)
{
item
.
stateMask
=
item
.
state
=
LVIS_FOCUSED
|
LVIS_SELECTED
;
item
.
stateMask
=
item
.
state
=
LVIS_FOCUSED
|
LVIS_SELECTED
;
}
}
item
.
iImage
=
0
;
switch
(
dwValType
)
{
case
REG_SZ
:
case
REG_EXPAND_SZ
:
case
REG_MULTI_SZ
:
item
.
iImage
=
Image_String
;
break
;
default:
item
.
iImage
=
Image_Binary
;
break
;
}
item
.
lParam
=
(
LPARAM
)
linfo
;
item
.
lParam
=
(
LPARAM
)
linfo
;
/* item.lParam = (LPARAM)ValBuf; */
#if (_WIN32_IE >= 0x0300)
#if (_WIN32_IE >= 0x0300)
item
.
iIndent
=
0
;
item
.
iIndent
=
0
;
#endif
#endif
...
@@ -133,7 +160,7 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType,
...
@@ -133,7 +160,7 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType,
index
=
ListView_InsertItem
(
hwndLV
,
&
item
);
index
=
ListView_InsertItem
(
hwndLV
,
&
item
);
if
(
index
!=
-
1
)
{
if
(
index
!=
-
1
)
{
/* LPTSTR pszText = NULL; */
/* LPTSTR pszText = NULL; */
LPTSTR
pszText
=
_T
(
"
value
"
);
LPTSTR
pszText
=
_T
(
"
(cannot display value)
"
);
switch
(
dwValType
)
{
switch
(
dwValType
)
{
case
REG_SZ
:
case
REG_SZ
:
case
REG_EXPAND_SZ
:
case
REG_EXPAND_SZ
:
...
@@ -161,6 +188,10 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType,
...
@@ -161,6 +188,10 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType,
HeapFree
(
GetProcessHeap
(),
0
,
strBinary
);
HeapFree
(
GetProcessHeap
(),
0
,
strBinary
);
}
}
break
;
break
;
case
REG_MULTI_SZ
:
MakeMULTISZDisplayable
(
ValBuf
);
ListView_SetItemText
(
hwndLV
,
index
,
2
,
ValBuf
);
break
;
default:
default:
/* lpsRes = convertHexToHexCSV(lpbData, dwLen); */
/* lpsRes = convertHexToHexCSV(lpbData, dwLen); */
ListView_SetItemText
(
hwndLV
,
index
,
2
,
pszText
);
ListView_SetItemText
(
hwndLV
,
index
,
2
,
pszText
);
...
@@ -169,6 +200,34 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType,
...
@@ -169,6 +200,34 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType,
}
}
}
}
static
BOOL
InitListViewImageList
(
HWND
hWndListView
)
{
HIMAGELIST
himl
;
HICON
hicon
;
INT
cx
=
GetSystemMetrics
(
SM_CXSMICON
);
INT
cy
=
GetSystemMetrics
(
SM_CYSMICON
);
himl
=
ImageList_Create
(
cx
,
cy
,
ILC_MASK
,
0
,
2
);
if
(
!
himl
)
return
FALSE
;
hicon
=
LoadImage
(
hInst
,
MAKEINTRESOURCE
(
IDI_STRING
),
IMAGE_ICON
,
cx
,
cy
,
LR_DEFAULTCOLOR
);
Image_String
=
ImageList_AddIcon
(
himl
,
hicon
);
hicon
=
LoadImage
(
hInst
,
MAKEINTRESOURCE
(
IDI_BIN
),
IMAGE_ICON
,
cx
,
cy
,
LR_DEFAULTCOLOR
);
Image_Binary
=
ImageList_AddIcon
(
himl
,
hicon
);
ListView_SetImageList
(
hWndListView
,
himl
,
LVSIL_SMALL
);
/* fail if some of the icons failed to load */
if
(
ImageList_GetImageCount
(
himl
)
<
2
)
return
FALSE
;
return
TRUE
;
}
static
BOOL
CreateListColumns
(
HWND
hWndListView
)
static
BOOL
CreateListColumns
(
HWND
hWndListView
)
{
{
TCHAR
szText
[
50
];
TCHAR
szText
[
50
];
...
@@ -397,11 +456,8 @@ HWND CreateListView(HWND hwndParent, int id)
...
@@ -397,11 +456,8 @@ HWND CreateListView(HWND hwndParent, int id)
if
(
!
hwndLV
)
return
NULL
;
if
(
!
hwndLV
)
return
NULL
;
ListView_SetExtendedListViewStyle
(
hwndLV
,
LVS_EX_FULLROWSELECT
);
ListView_SetExtendedListViewStyle
(
hwndLV
,
LVS_EX_FULLROWSELECT
);
/* Initialize the image list, and add items to the control. */
/* Initialize the image list */
/*
if
(
!
InitListViewImageList
(
hwndLV
))
goto
fail
;
if (!InitListViewImageLists(hwndLV)) goto fail;
if (!InitListViewItems(hwndLV, szName)) goto fail;
*/
if
(
!
CreateListColumns
(
hwndLV
))
goto
fail
;
if
(
!
CreateListColumns
(
hwndLV
))
goto
fail
;
g_orgListWndProc
=
SubclassWindow
(
hwndLV
,
ListWndProc
);
g_orgListWndProc
=
SubclassWindow
(
hwndLV
,
ListWndProc
);
return
hwndLV
;
return
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