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
6827724e
Commit
6827724e
authored
Jun 13, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Make it possible for save/restore position on tree root.
parent
99549e1e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
childwnd.c
programs/regedit/childwnd.c
+18
-6
No files found.
programs/regedit/childwnd.c
View file @
6827724e
...
...
@@ -243,7 +243,14 @@ static void get_last_key(HWND hwndTV)
if
(
RegCreateKeyExW
(
HKEY_CURRENT_USER
,
wszKeyName
,
0
,
NULL
,
0
,
KEY_READ
,
NULL
,
&
hkey
,
NULL
)
==
ERROR_SUCCESS
)
{
if
(
RegQueryValueExW
(
hkey
,
wszLastKey
,
NULL
,
NULL
,
(
LPBYTE
)
wszVal
,
&
dwSize
)
==
ERROR_SUCCESS
)
SendMessageW
(
hwndTV
,
TVM_SELECTITEM
,
TVGN_CARET
,
(
LPARAM
)
FindPathInTree
(
hwndTV
,
wszVal
));
{
HTREEITEM
selection
;
if
(
!
strcmpW
(
wszVal
,
g_pChildWnd
->
szPath
))
selection
=
(
HTREEITEM
)
SendMessageW
(
g_pChildWnd
->
hTreeWnd
,
TVM_GETNEXTITEM
,
TVGN_ROOT
,
0
);
else
selection
=
FindPathInTree
(
hwndTV
,
wszVal
);
SendMessageW
(
hwndTV
,
TVM_SELECTITEM
,
TVGN_CARET
,
(
LPARAM
)
selection
);
}
RegCloseKey
(
hkey
);
}
...
...
@@ -258,15 +265,20 @@ static void get_last_key(HWND hwndTV)
static
void
set_last_key
(
HWND
hwndTV
)
{
HKEY
hkey
;
WCHAR
*
wszVal
;
if
(
RegCreateKeyExW
(
HKEY_CURRENT_USER
,
wszKeyName
,
0
,
NULL
,
0
,
KEY_WRITE
,
NULL
,
&
hkey
,
NULL
)
==
ERROR_SUCCESS
)
{
HTREEITEM
selection
=
(
HTREEITEM
)
SendMessageW
(
g_pChildWnd
->
hTreeWnd
,
TVM_GETNEXTITEM
,
TVGN_CARET
,
0
);
wszVal
=
GetItemFullPath
(
g_pChildWnd
->
hTreeWnd
,
selection
,
FALSE
);
RegSetValueExW
(
hkey
,
wszLastKey
,
0
,
REG_SZ
,
(
LPBYTE
)
wszVal
,
(
lstrlenW
(
wszVal
)
+
1
)
*
sizeof
(
WCHAR
));
HeapFree
(
GetProcessHeap
(),
0
,
wszVal
);
HTREEITEM
root
=
(
HTREEITEM
)
SendMessageW
(
g_pChildWnd
->
hTreeWnd
,
TVM_GETNEXTITEM
,
TVGN_ROOT
,
0
);
WCHAR
*
value
;
if
(
selection
==
root
)
value
=
g_pChildWnd
->
szPath
;
else
value
=
GetItemFullPath
(
g_pChildWnd
->
hTreeWnd
,
selection
,
FALSE
);
RegSetValueExW
(
hkey
,
wszLastKey
,
0
,
REG_SZ
,
(
LPBYTE
)
value
,
(
lstrlenW
(
value
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
selection
!=
root
)
HeapFree
(
GetProcessHeap
(),
0
,
value
);
RegCloseKey
(
hkey
);
}
}
...
...
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