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
be43131b
Commit
be43131b
authored
Aug 25, 2008
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Aug 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Convert treeview init to Unicode.
parent
583bf6e4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
15 deletions
+16
-15
childwnd.c
programs/regedit/childwnd.c
+1
-1
main.h
programs/regedit/main.h
+2
-2
treeview.c
programs/regedit/treeview.c
+13
-12
No files found.
programs/regedit/childwnd.c
View file @
be43131b
...
...
@@ -304,7 +304,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
case
WM_CREATE
:
g_pChildWnd
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
ChildWnd
));
if
(
!
g_pChildWnd
)
return
0
;
LoadString
(
hInst
,
IDS_REGISTRY_ROOT_NAME
,
g_pChildWnd
->
szPath
,
MAX_PATH
);
LoadString
W
(
hInst
,
IDS_REGISTRY_ROOT_NAME
,
g_pChildWnd
->
szPath
,
MAX_PATH
);
g_pChildWnd
->
nSplitPos
=
250
;
g_pChildWnd
->
hWnd
=
hWnd
;
g_pChildWnd
->
hTreeWnd
=
CreateTreeView
(
hWnd
,
g_pChildWnd
->
szPath
,
TREE_WINDOW
);
...
...
programs/regedit/main.h
View file @
be43131b
...
...
@@ -72,7 +72,7 @@ typedef struct {
int
nFocusPanel
;
/* 0: left 1: right */
int
nSplitPos
;
WINDOWPLACEMENT
pos
;
T
CHAR
szPath
[
MAX_PATH
];
W
CHAR
szPath
[
MAX_PATH
];
}
ChildWnd
;
extern
ChildWnd
*
g_pChildWnd
;
...
...
@@ -128,7 +128,7 @@ extern BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Res
extern
BOOL
IsDefaultValue
(
HWND
hwndLV
,
int
i
);
/* treeview.c */
extern
HWND
CreateTreeView
(
HWND
hwndParent
,
LP
T
STR
pHostName
,
UINT
id
);
extern
HWND
CreateTreeView
(
HWND
hwndParent
,
LP
W
STR
pHostName
,
UINT
id
);
extern
BOOL
RefreshTreeView
(
HWND
hWndTV
);
extern
BOOL
OnTreeExpanding
(
HWND
hWnd
,
NMTREEVIEW
*
pnmtv
);
extern
LPTSTR
GetItemPath
(
HWND
hwndTV
,
HTREEITEM
hItem
,
HKEY
*
phRootKey
);
...
...
programs/regedit/treeview.c
View file @
be43131b
...
...
@@ -567,9 +567,9 @@ HWND StartKeyRename(HWND hwndTV)
return
TreeView_EditLabel
(
hwndTV
,
hItem
);
}
static
BOOL
InitTreeViewItems
(
HWND
hwndTV
,
LP
T
STR
pHostName
)
static
BOOL
InitTreeViewItems
(
HWND
hwndTV
,
LP
W
STR
pHostName
)
{
TVINSERTSTRUCT
tvins
;
TVINSERTSTRUCT
W
tvins
;
HTREEITEM
hRoot
;
static
WCHAR
hkcr
[]
=
{
'H'
,
'K'
,
'E'
,
'Y'
,
'_'
,
'C'
,
'L'
,
'A'
,
'S'
,
'S'
,
'E'
,
'S'
,
'_'
,
'R'
,
'O'
,
'O'
,
'T'
,
0
},
hkcu
[]
=
{
'H'
,
'K'
,
'E'
,
'Y'
,
'_'
,
'C'
,
'U'
,
'R'
,
'R'
,
'E'
,
'N'
,
'T'
,
'_'
,
'U'
,
'S'
,
'E'
,
'R'
,
0
},
...
...
@@ -581,7 +581,7 @@ static BOOL InitTreeViewItems(HWND hwndTV, LPTSTR pHostName)
tvins
.
u
.
item
.
mask
=
TVIF_TEXT
|
TVIF_IMAGE
|
TVIF_SELECTEDIMAGE
|
TVIF_CHILDREN
|
TVIF_PARAM
;
/* Set the text of the item. */
tvins
.
u
.
item
.
pszText
=
pHostName
;
tvins
.
u
.
item
.
cchTextMax
=
lstrlen
(
pHostName
);
tvins
.
u
.
item
.
cchTextMax
=
lstrlen
W
(
pHostName
);
/* Assume the item is not a parent item, so give it an image. */
tvins
.
u
.
item
.
iImage
=
Image_Root
;
tvins
.
u
.
item
.
iSelectedImage
=
Image_Root
;
...
...
@@ -591,7 +591,7 @@ static BOOL InitTreeViewItems(HWND hwndTV, LPTSTR pHostName)
tvins
.
hInsertAfter
=
(
HTREEITEM
)
TVI_FIRST
;
tvins
.
hParent
=
TVI_ROOT
;
/* Add the item to the tree view control. */
if
(
!
(
hRoot
=
TreeView_InsertItem
(
hwndTV
,
&
tvins
)))
return
FALSE
;
if
(
!
(
hRoot
=
TreeView_InsertItem
W
(
hwndTV
,
&
tvins
)))
return
FALSE
;
if
(
!
AddEntryToTree
(
hwndTV
,
hRoot
,
hkcr
,
HKEY_CLASSES_ROOT
,
1
))
return
FALSE
;
if
(
!
AddEntryToTree
(
hwndTV
,
hRoot
,
hkcu
,
HKEY_CURRENT_USER
,
1
))
return
FALSE
;
...
...
@@ -601,8 +601,8 @@ static BOOL InitTreeViewItems(HWND hwndTV, LPTSTR pHostName)
if
(
!
AddEntryToTree
(
hwndTV
,
hRoot
,
hkdd
,
HKEY_DYN_DATA
,
1
))
return
FALSE
;
/* expand and select host name */
SendMessage
(
hwndTV
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
hRoot
);
SendMessage
(
hwndTV
,
TVM_SELECTITEM
,
TVGN_CARET
,
(
LPARAM
)
hRoot
);
SendMessage
W
(
hwndTV
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
hRoot
);
SendMessage
W
(
hwndTV
,
TVM_SELECTITEM
,
TVGN_CARET
,
(
LPARAM
)
hRoot
);
return
TRUE
;
}
...
...
@@ -624,13 +624,13 @@ static BOOL InitTreeViewImageLists(HWND hwndTV)
return
FALSE
;
/* Add the open file, closed file, and document bitmaps. */
hico
=
LoadIcon
(
hInst
,
MAKEINTRESOURCE
(
IDI_OPEN_FILE
));
hico
=
LoadIcon
W
(
hInst
,
MAKEINTRESOURCEW
(
IDI_OPEN_FILE
));
Image_Open
=
ImageList_AddIcon
(
himl
,
hico
);
hico
=
LoadIcon
(
hInst
,
MAKEINTRESOURCE
(
IDI_CLOSED_FILE
));
hico
=
LoadIcon
W
(
hInst
,
MAKEINTRESOURCEW
(
IDI_CLOSED_FILE
));
Image_Closed
=
ImageList_AddIcon
(
himl
,
hico
);
hico
=
LoadIcon
(
hInst
,
MAKEINTRESOURCE
(
IDI_ROOT
));
hico
=
LoadIcon
W
(
hInst
,
MAKEINTRESOURCEW
(
IDI_ROOT
));
Image_Root
=
ImageList_AddIcon
(
himl
,
hico
);
/* Fail if not all of the images were added. */
...
...
@@ -640,7 +640,7 @@ static BOOL InitTreeViewImageLists(HWND hwndTV)
}
/* Associate the image list with the tree view control. */
SendMessage
(
hwndTV
,
TVM_SETIMAGELIST
,
TVSIL_NORMAL
,
(
LPARAM
)
himl
);
SendMessage
W
(
hwndTV
,
TVM_SETIMAGELIST
,
TVSIL_NORMAL
,
(
LPARAM
)
himl
);
return
TRUE
;
}
...
...
@@ -716,14 +716,15 @@ BOOL OnTreeExpanding(HWND hwndTV, NMTREEVIEW* pnmtv)
* Returns the handle to the new control if successful, or NULL otherwise.
* hwndParent - handle to the control's parent window.
*/
HWND
CreateTreeView
(
HWND
hwndParent
,
LP
T
STR
pHostName
,
UINT
id
)
HWND
CreateTreeView
(
HWND
hwndParent
,
LP
W
STR
pHostName
,
UINT
id
)
{
RECT
rcClient
;
HWND
hwndTV
;
WCHAR
TreeView
[]
=
{
'T'
,
'r'
,
'e'
,
'e'
,
' '
,
'V'
,
'i'
,
'e'
,
'w'
,
0
};
/* Get the dimensions of the parent window's client area, and create the tree view control. */
GetClientRect
(
hwndParent
,
&
rcClient
);
hwndTV
=
CreateWindowEx
(
WS_EX_CLIENTEDGE
,
WC_TREEVIEW
,
_T
(
"Tree View"
)
,
hwndTV
=
CreateWindowEx
W
(
WS_EX_CLIENTEDGE
,
WC_TREEVIEWW
,
TreeView
,
WS_VISIBLE
|
WS_CHILD
|
WS_TABSTOP
|
TVS_HASLINES
|
TVS_HASBUTTONS
|
TVS_LINESATROOT
,
0
,
0
,
rcClient
.
right
,
rcClient
.
bottom
,
hwndParent
,
(
HMENU
)
ULongToHandle
(
id
),
hInst
,
NULL
);
...
...
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