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
aa42d81e
Commit
aa42d81e
authored
Jul 12, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Jul 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Move treeview notify messages to a separate function.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9e1278dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
50 deletions
+64
-50
childwnd.c
programs/regedit/childwnd.c
+64
-50
No files found.
programs/regedit/childwnd.c
View file @
aa42d81e
...
...
@@ -293,6 +293,67 @@ static void set_last_key(HWND hwndTV)
}
}
static
int
treeview_notify
(
HWND
hWnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(((
NMHDR
*
)
lParam
)
->
code
)
{
case
NM_SETFOCUS
:
g_pChildWnd
->
nFocusPanel
=
0
;
break
;
case
TVN_BEGINLABELEDITW
:
{
HKEY
hRootKey
;
WCHAR
*
path
;
if
(
!
GetWindowLongPtrW
(
g_pChildWnd
->
hTreeWnd
,
GWLP_USERDATA
))
return
1
;
path
=
GetItemPath
(
g_pChildWnd
->
hTreeWnd
,
0
,
&
hRootKey
);
if
(
!
path
||
!*
path
)
return
1
;
return
0
;
}
case
TVN_ENDLABELEDITW
:
{
HKEY
hRootKey
;
NMTVDISPINFOW
*
dispInfo
=
(
NMTVDISPINFOW
*
)
lParam
;
WCHAR
*
path
=
GetItemPath
(
g_pChildWnd
->
hTreeWnd
,
0
,
&
hRootKey
);
BOOL
res
=
RenameKey
(
hWnd
,
hRootKey
,
path
,
dispInfo
->
item
.
pszText
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
if
(
res
)
{
TVITEMW
item
;
WCHAR
*
fullPath
;
item
.
mask
=
TVIF_HANDLE
|
TVIF_TEXT
;
item
.
hItem
=
dispInfo
->
item
.
hItem
;
item
.
pszText
=
dispInfo
->
item
.
pszText
;
SendMessageW
(
g_pChildWnd
->
hTreeWnd
,
TVM_SETITEMW
,
0
,
(
LPARAM
)
&
item
);
path
=
GetItemPath
(
g_pChildWnd
->
hTreeWnd
,
0
,
&
hRootKey
);
update_listview_path
(
path
);
fullPath
=
GetPathFullPath
(
g_pChildWnd
->
hTreeWnd
,
path
);
SendMessageW
(
hStatusBar
,
SB_SETTEXTW
,
0
,
(
LPARAM
)
fullPath
);
HeapFree
(
GetProcessHeap
(),
0
,
fullPath
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
}
SetWindowLongPtrW
(
g_pChildWnd
->
hTreeWnd
,
GWLP_USERDATA
,
0
);
return
res
;
}
case
TVN_ITEMEXPANDINGW
:
return
!
OnTreeExpanding
(
g_pChildWnd
->
hTreeWnd
,
(
NMTREEVIEWW
*
)
lParam
);
case
TVN_SELCHANGEDW
:
OnTreeSelectionChanged
(
g_pChildWnd
->
hTreeWnd
,
g_pChildWnd
->
hListWnd
,
((
NMTREEVIEWW
*
)
lParam
)
->
itemNew
.
hItem
,
TRUE
);
break
;
}
return
0
;
}
#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
...
...
@@ -427,57 +488,10 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
break
;
case
WM_NOTIFY
:
if
(((
int
)
wParam
==
TREE_WINDOW
)
&&
(
g_pChildWnd
!=
NULL
))
{
switch
(((
LPNMHDR
)
lParam
)
->
code
)
{
case
TVN_ITEMEXPANDINGW
:
return
!
OnTreeExpanding
(
g_pChildWnd
->
hTreeWnd
,
(
NMTREEVIEWW
*
)
lParam
);
case
TVN_SELCHANGEDW
:
OnTreeSelectionChanged
(
g_pChildWnd
->
hTreeWnd
,
g_pChildWnd
->
hListWnd
,
((
NMTREEVIEWW
*
)
lParam
)
->
itemNew
.
hItem
,
TRUE
);
break
;
case
NM_SETFOCUS
:
g_pChildWnd
->
nFocusPanel
=
0
;
break
;
case
TVN_BEGINLABELEDITW
:
{
HKEY
hRootKey
;
LPWSTR
path
;
if
(
!
GetWindowLongPtrW
(
g_pChildWnd
->
hTreeWnd
,
GWLP_USERDATA
))
return
1
;
path
=
GetItemPath
(
g_pChildWnd
->
hTreeWnd
,
0
,
&
hRootKey
);
if
(
!
path
||
!*
path
)
return
1
;
return
0
;
}
case
TVN_ENDLABELEDITW
:
{
HKEY
hRootKey
;
LPNMTVDISPINFOW
dispInfo
=
(
LPNMTVDISPINFOW
)
lParam
;
LPWSTR
path
=
GetItemPath
(
g_pChildWnd
->
hTreeWnd
,
0
,
&
hRootKey
);
BOOL
res
=
RenameKey
(
hWnd
,
hRootKey
,
path
,
dispInfo
->
item
.
pszText
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
if
(
res
)
{
TVITEMW
item
;
WCHAR
*
fullPath
;
item
.
mask
=
TVIF_HANDLE
|
TVIF_TEXT
;
item
.
hItem
=
dispInfo
->
item
.
hItem
;
item
.
pszText
=
dispInfo
->
item
.
pszText
;
SendMessageW
(
g_pChildWnd
->
hTreeWnd
,
TVM_SETITEMW
,
0
,
(
LPARAM
)
&
item
);
path
=
GetItemPath
(
g_pChildWnd
->
hTreeWnd
,
0
,
&
hRootKey
);
fullPath
=
GetPathFullPath
(
g_pChildWnd
->
hTreeWnd
,
path
);
SendMessageW
(
hStatusBar
,
SB_SETTEXTW
,
0
,
(
LPARAM
)
fullPath
);
HeapFree
(
GetProcessHeap
(),
0
,
fullPath
);
update_listview_path
(
path
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
}
SetWindowLongPtrW
(
g_pChildWnd
->
hTreeWnd
,
GWLP_USERDATA
,
0
);
return
res
;
}
default:
return
0
;
/* goto def; */
}
}
else
if
((
int
)
wParam
==
LIST_WINDOW
&&
g_pChildWnd
!=
NULL
)
{
if
(
wParam
==
TREE_WINDOW
&&
g_pChildWnd
)
return
treeview_notify
(
hWnd
,
message
,
wParam
,
lParam
);
else
if
(
wParam
==
LIST_WINDOW
&&
g_pChildWnd
)
return
SendMessageW
(
g_pChildWnd
->
hListWnd
,
WM_NOTIFY_REFLECT
,
wParam
,
lParam
);
}
break
;
case
WM_SIZE
:
...
...
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