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
5defba11
Commit
5defba11
authored
Sep 03, 2008
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Sep 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Convert open/save dialogues to unicode.
parent
720e8c62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
34 deletions
+39
-34
framewnd.c
programs/regedit/framewnd.c
+39
-34
No files found.
programs/regedit/framewnd.c
View file @
5defba11
...
...
@@ -43,9 +43,9 @@ static WCHAR favoriteName[128];
static
WCHAR
searchString
[
128
];
static
int
searchMask
=
SEARCH_KEYS
|
SEARCH_VALUES
|
SEARCH_CONTENT
;
static
T
CHAR
FileNameBuffer
[
_MAX_PATH
];
static
T
CHAR
FileTitleBuffer
[
_MAX_PATH
];
static
T
CHAR
FilterBuffer
[
_MAX_PATH
];
static
W
CHAR
FileNameBuffer
[
_MAX_PATH
];
static
W
CHAR
FileTitleBuffer
[
_MAX_PATH
];
static
W
CHAR
FilterBuffer
[
_MAX_PATH
];
/*******************************************************************************
* Local module support methods
...
...
@@ -247,42 +247,40 @@ static BOOL CheckCommDlgError(HWND hWnd)
return
TRUE
;
}
static
void
ExportRegistryFile_StoreSelection
(
HWND
hdlg
,
OPENFILENAME
*
pOpenFileName
)
static
void
ExportRegistryFile_StoreSelection
(
HWND
hdlg
,
OPENFILENAME
W
*
pOpenFileName
)
{
if
(
IsDlgButtonChecked
(
hdlg
,
IDC_EXPORT_SELECTED
))
{
INT
len
=
SendDlgItemMessage
(
hdlg
,
IDC_EXPORT_PATH
,
WM_GETTEXTLENGTH
,
0
,
0
);
pOpenFileName
->
lCustData
=
(
LPARAM
)
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
T
CHAR
));
SendDlgItemMessage
(
hdlg
,
IDC_EXPORT_PATH
,
WM_GETTEXT
,
len
+
1
,
pOpenFileName
->
lCustData
);
INT
len
=
SendDlgItemMessage
W
(
hdlg
,
IDC_EXPORT_PATH
,
WM_GETTEXTLENGTH
,
0
,
0
);
pOpenFileName
->
lCustData
=
(
LPARAM
)
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
W
CHAR
));
SendDlgItemMessage
W
(
hdlg
,
IDC_EXPORT_PATH
,
WM_GETTEXT
,
len
+
1
,
pOpenFileName
->
lCustData
);
}
else
pOpenFileName
->
lCustData
=
(
LPARAM
)
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
T
CHAR
));
pOpenFileName
->
lCustData
=
(
LPARAM
)
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
W
CHAR
));
}
static
UINT
CALLBACK
ExportRegistryFile_OFNHookProc
(
HWND
hdlg
,
UINT
uiMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
static
OPENFILENAME
*
pOpenFileName
;
OFNOTIFY
*
pOfNotify
;
static
OPENFILENAME
W
*
pOpenFileName
;
OFNOTIFY
W
*
pOfNotify
;
switch
(
uiMsg
)
{
case
WM_INITDIALOG
:
pOpenFileName
=
(
OPENFILENAME
*
)
lParam
;
pOpenFileName
=
(
OPENFILENAME
W
*
)
lParam
;
break
;
case
WM_COMMAND
:
if
(
LOWORD
(
wParam
)
==
IDC_EXPORT_PATH
&&
HIWORD
(
wParam
)
==
EN_UPDATE
)
CheckRadioButton
(
hdlg
,
IDC_EXPORT_ALL
,
IDC_EXPORT_SELECTED
,
IDC_EXPORT_SELECTED
);
break
;
case
WM_NOTIFY
:
pOfNotify
=
(
OFNOTIFY
*
)
lParam
;
pOfNotify
=
(
OFNOTIFY
W
*
)
lParam
;
switch
(
pOfNotify
->
hdr
.
code
)
{
case
CDN_INITDONE
:
{
WCHAR
*
pathW
=
GetItemFullPath
(
g_pChildWnd
->
hTreeWnd
,
NULL
,
FALSE
);
CHAR
*
pathA
=
GetMultiByteString
(
pathW
);
SendDlgItemMessage
(
hdlg
,
IDC_EXPORT_PATH
,
WM_SETTEXT
,
0
,
(
LPARAM
)
pathA
);
HeapFree
(
GetProcessHeap
(),
0
,
pathW
);
HeapFree
(
GetProcessHeap
(),
0
,
pathA
);
WCHAR
*
path
=
GetItemFullPath
(
g_pChildWnd
->
hTreeWnd
,
NULL
,
FALSE
);
SendDlgItemMessageW
(
hdlg
,
IDC_EXPORT_PATH
,
WM_SETTEXT
,
0
,
(
LPARAM
)
path
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
CheckRadioButton
(
hdlg
,
IDC_EXPORT_ALL
,
IDC_EXPORT_SELECTED
,
pOpenFileName
->
lCustData
?
IDC_EXPORT_SELECTED
:
IDC_EXPORT_ALL
);
break
;
}
...
...
@@ -298,15 +296,15 @@ static UINT CALLBACK ExportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, WPARA
}
static
BOOL
InitOpenFileName
(
HWND
hWnd
,
OPENFILENAME
*
pofn
)
static
BOOL
InitOpenFileName
(
HWND
hWnd
,
OPENFILENAME
W
*
pofn
)
{
memset
(
pofn
,
0
,
sizeof
(
OPENFILENAME
));
pofn
->
lStructSize
=
sizeof
(
OPENFILENAME
);
memset
(
pofn
,
0
,
sizeof
(
OPENFILENAME
W
));
pofn
->
lStructSize
=
sizeof
(
OPENFILENAME
W
);
pofn
->
hwndOwner
=
hWnd
;
pofn
->
hInstance
=
hInst
;
if
(
FilterBuffer
[
0
]
==
0
)
LoadString
(
hInst
,
IDS_FILEDIALOG_FILTER
,
FilterBuffer
,
_MAX_PATH
);
LoadString
W
(
hInst
,
IDS_FILEDIALOG_FILTER
,
FilterBuffer
,
_MAX_PATH
);
pofn
->
lpstrFilter
=
FilterBuffer
;
pofn
->
nFilterIndex
=
1
;
pofn
->
lpstrFile
=
FileNameBuffer
;
...
...
@@ -336,17 +334,20 @@ static BOOL import_registry_filename(LPTSTR filename)
static
BOOL
ImportRegistryFile
(
HWND
hWnd
)
{
OPENFILENAME
ofn
;
T
CHAR
title
[
128
];
OPENFILENAME
W
ofn
;
W
CHAR
title
[
128
];
InitOpenFileName
(
hWnd
,
&
ofn
);
LoadString
(
hInst
,
IDS_FILEDIALOG_IMPORT_TITLE
,
title
,
COUNT_OF
(
title
));
LoadString
W
(
hInst
,
IDS_FILEDIALOG_IMPORT_TITLE
,
title
,
COUNT_OF
(
title
));
ofn
.
lpstrTitle
=
title
;
if
(
GetOpenFileName
(
&
ofn
))
{
if
(
!
import_registry_filename
(
ofn
.
lpstrFile
))
{
if
(
GetOpenFileNameW
(
&
ofn
))
{
CHAR
*
fileA
=
GetMultiByteString
(
ofn
.
lpstrFile
);
if
(
!
import_registry_filename
(
fileA
))
{
/*printf("Can't open file \"%s\"\n", ofn.lpstrFile);*/
HeapFree
(
GetProcessHeap
(),
0
,
fileA
);
return
FALSE
;
}
HeapFree
(
GetProcessHeap
(),
0
,
fileA
);
}
else
{
CheckCommDlgError
(
hWnd
);
}
...
...
@@ -357,21 +358,25 @@ static BOOL ImportRegistryFile(HWND hWnd)
static
BOOL
ExportRegistryFile
(
HWND
hWnd
,
BOOL
export_branch
)
{
OPENFILENAME
ofn
;
T
CHAR
ExportKeyPath
[
_MAX_PATH
];
T
CHAR
title
[
128
];
OPENFILENAME
W
ofn
;
W
CHAR
ExportKeyPath
[
_MAX_PATH
];
W
CHAR
title
[
128
];
ExportKeyPath
[
0
]
=
_T
(
'\0'
)
;
ExportKeyPath
[
0
]
=
0
;
InitOpenFileName
(
hWnd
,
&
ofn
);
LoadString
(
hInst
,
IDS_FILEDIALOG_EXPORT_TITLE
,
title
,
COUNT_OF
(
title
));
LoadString
W
(
hInst
,
IDS_FILEDIALOG_EXPORT_TITLE
,
title
,
COUNT_OF
(
title
));
ofn
.
lpstrTitle
=
title
;
ofn
.
lCustData
=
export_branch
;
ofn
.
Flags
=
OFN_ENABLETEMPLATE
|
OFN_ENABLEHOOK
|
OFN_EXPLORER
|
OFN_HIDEREADONLY
|
OFN_OVERWRITEPROMPT
;
ofn
.
lpfnHook
=
ExportRegistryFile_OFNHookProc
;
ofn
.
lpTemplateName
=
MAKEINTRESOURCE
(
IDD_EXPORT_TEMPLATE
);
if
(
GetSaveFileName
(
&
ofn
))
{
ofn
.
lpTemplateName
=
MAKEINTRESOURCE
W
(
IDD_EXPORT_TEMPLATE
);
if
(
GetSaveFileName
W
(
&
ofn
))
{
BOOL
result
;
result
=
export_registry_key
(
ofn
.
lpstrFile
,
(
LPTSTR
)
ofn
.
lCustData
);
CHAR
*
fileA
=
GetMultiByteString
(
ofn
.
lpstrFile
);
CHAR
*
sectionA
=
GetMultiByteString
((
LPWSTR
)
ofn
.
lCustData
);
result
=
export_registry_key
(
fileA
,
sectionA
);
HeapFree
(
GetProcessHeap
(),
0
,
fileA
);
HeapFree
(
GetProcessHeap
(),
0
,
sectionA
);
if
(
!
result
)
{
/*printf("Can't open file \"%s\"\n", ofn.lpstrFile);*/
return
FALSE
;
...
...
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