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
5ce04f7f
Commit
5ce04f7f
authored
Jul 02, 2009
by
Vladimir Pankratov
Committed by
Alexandre Julliard
Jul 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Implement open last key at startup.
parent
3cbeae82
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
childwnd.c
programs/regedit/childwnd.c
+51
-0
No files found.
programs/regedit/childwnd.c
View file @
5ce04f7f
...
...
@@ -24,6 +24,7 @@
#include <stdio.h>
#include "main.h"
#include "regproc.h"
#include "wine/debug.h"
#include "wine/unicode.h"
...
...
@@ -33,6 +34,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(regedit);
ChildWnd
*
g_pChildWnd
;
static
int
last_split
;
static
const
WCHAR
wszLastKey
[]
=
{
'L'
,
'a'
,
's'
,
't'
,
'K'
,
'e'
,
'y'
,
0
};
static
const
WCHAR
wszKeyName
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'A'
,
'p'
,
'p'
,
'l'
,
'e'
,
't'
,
's'
,
'\\'
,
'R'
,
'e'
,
'g'
,
'e'
,
'd'
,
'i'
,
't'
,
0
};
/*******************************************************************************
* Local module support methods
*/
...
...
@@ -222,6 +230,47 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
/*******************************************************************************
* get_last_key [internal]
*
* open last key
*
*/
static
void
get_last_key
(
HWND
hwndTV
)
{
HKEY
hkey
;
WCHAR
wszVal
[
KEY_MAX_LEN
];
DWORD
dwSize
=
sizeof
(
wszVal
);
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
));
RegCloseKey
(
hkey
);
}
}
/*******************************************************************************
* set_last_key [internal]
*
* save last key
*
*/
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
)
{
wszVal
=
GetItemFullPath
(
g_pChildWnd
->
hTreeWnd
,
TreeView_GetSelection
(
g_pChildWnd
->
hTreeWnd
),
FALSE
);
RegSetValueExW
(
hkey
,
wszLastKey
,
0
,
REG_SZ
,
(
LPBYTE
)
wszVal
,
KEY_MAX_LEN
*
sizeof
(
WCHAR
));
HeapFree
(
GetProcessHeap
(),
0
,
wszVal
);
RegCloseKey
(
hkey
);
}
}
/*******************************************************************************
*
* FUNCTION: ChildWndProc(HWND, unsigned, WORD, LONG)
*
...
...
@@ -245,6 +294,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
g_pChildWnd
->
hListWnd
=
CreateListView
(
hWnd
,
LIST_WINDOW
/*, g_pChildWnd->szPath*/
);
g_pChildWnd
->
nFocusPanel
=
1
;
SetFocus
(
g_pChildWnd
->
hTreeWnd
);
get_last_key
(
g_pChildWnd
->
hTreeWnd
);
break
;
case
WM_COMMAND
:
if
(
!
_CmdWndProc
(
hWnd
,
message
,
wParam
,
lParam
))
{
...
...
@@ -266,6 +316,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
}
goto
def
;
case
WM_DESTROY
:
set_last_key
(
g_pChildWnd
->
hTreeWnd
);
HeapFree
(
GetProcessHeap
(),
0
,
g_pChildWnd
);
g_pChildWnd
=
NULL
;
PostQuitMessage
(
0
);
...
...
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