regedit: Add option to export only a specified branch.
This commit is contained in:
parent
b0c4b88943
commit
22665d9d54
|
@ -292,13 +292,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
|
|
|
@ -254,13 +254,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
|
|
|
@ -308,13 +308,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
|
|
|
@ -207,6 +207,17 @@ BEGIN
|
|||
DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP
|
||||
END
|
||||
|
||||
IDD_EXPORT_TEMPLATE DIALOG DISCARDABLE 50, 50, 278, 54
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
GROUPBOX "&Export registry", IDC_EXPORT_BASE, 6, 6, 266, 42, WS_GROUP
|
||||
AUTORADIOBUTTON "&All", IDC_EXPORT_ALL, 12, 15, 244, 12
|
||||
AUTORADIOBUTTON "&Selected branch:", IDC_EXPORT_SELECTED, 12, 30, 70, 12
|
||||
EDITTEXT IDC_EXPORT_PATH, 82, 30, 184, 12
|
||||
END
|
||||
|
||||
IDD_FIND DIALOG DISCARDABLE 22, 17, 210, 85
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Find"
|
||||
|
@ -386,13 +397,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
|
|
|
@ -249,13 +249,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Diálogo"
|
||||
|
|
|
@ -319,13 +319,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Boîte de dialogue"
|
||||
|
|
|
@ -257,13 +257,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialógus"
|
||||
|
|
|
@ -302,13 +302,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialogo"
|
||||
|
|
|
@ -250,13 +250,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 9, "MS UI Gothic"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "ダイアログ"
|
||||
|
|
|
@ -324,13 +324,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "대화상자"
|
||||
|
|
|
@ -302,13 +302,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
|
|
|
@ -318,13 +318,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
|
|
|
@ -318,13 +318,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
|
|
|
@ -429,16 +429,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
|
|
|
@ -178,13 +178,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Äèàëîã"
|
||||
|
|
|
@ -178,13 +178,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
|
|
|
@ -302,13 +302,6 @@ END
|
|||
* Dialog
|
||||
*/
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
|
||||
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
|
||||
WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Ýletiþim Kutusu"
|
||||
|
|
|
@ -239,18 +239,46 @@ static BOOL CheckCommDlgError(HWND hWnd)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void ExportRegistryFile_StoreSelection(HWND hdlg, OPENFILENAME *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(TCHAR));
|
||||
SendDlgItemMessage(hdlg, IDC_EXPORT_PATH, WM_GETTEXT, len+1, pOpenFileName->lCustData);
|
||||
}
|
||||
else
|
||||
pOpenFileName->lCustData = (LPARAM)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(TCHAR));
|
||||
}
|
||||
|
||||
static UINT_PTR CALLBACK ExportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
OPENFILENAME* pOpenFileName;
|
||||
OFNOTIFY* pOfNotify;
|
||||
static OPENFILENAME* pOpenFileName;
|
||||
OFNOTIFY *pOfNotify;
|
||||
LPTSTR path;
|
||||
|
||||
switch (uiMsg) {
|
||||
case WM_INITDIALOG:
|
||||
pOpenFileName = (OPENFILENAME*)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;
|
||||
if (pOfNotify->hdr.code == CDN_INITDONE) {}
|
||||
switch (pOfNotify->hdr.code)
|
||||
{
|
||||
case CDN_INITDONE:
|
||||
path = GetItemFullPath(g_pChildWnd->hTreeWnd, NULL, FALSE);
|
||||
SendDlgItemMessage(hdlg, IDC_EXPORT_PATH, WM_SETTEXT, 0, (LPARAM)path);
|
||||
HeapFree(GetProcessHeap(), 0, path);
|
||||
CheckRadioButton(hdlg, IDC_EXPORT_ALL, IDC_EXPORT_SELECTED, IDC_EXPORT_ALL);
|
||||
break;
|
||||
case CDN_FILEOK:
|
||||
ExportRegistryFile_StoreSelection(hdlg, pOpenFileName);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -312,13 +340,13 @@ static BOOL ExportRegistryFile(HWND hWnd)
|
|||
InitOpenFileName(hWnd, &ofn);
|
||||
LoadString(hInst, IDS_FILEDIALOG_EXPORT_TITLE, title, COUNT_OF(title));
|
||||
ofn.lpstrTitle = title;
|
||||
/* ofn.lCustData = ;*/
|
||||
ofn.Flags = OFN_ENABLETEMPLATE | OFN_EXPLORER | OFN_HIDEREADONLY;
|
||||
ofn.lCustData = 0;
|
||||
ofn.Flags = OFN_ENABLETEMPLATE | OFN_ENABLEHOOK | OFN_EXPLORER | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
|
||||
ofn.lpfnHook = ExportRegistryFile_OFNHookProc;
|
||||
ofn.lpTemplateName = MAKEINTRESOURCE(IDD_DIALOG1);
|
||||
ofn.lpTemplateName = MAKEINTRESOURCE(IDD_EXPORT_TEMPLATE);
|
||||
if (GetSaveFileName(&ofn)) {
|
||||
BOOL result;
|
||||
result = export_registry_key(ofn.lpstrFile, ExportKeyPath);
|
||||
result = export_registry_key(ofn.lpstrFile, (LPTSTR)ofn.lCustData);
|
||||
if (!result) {
|
||||
/*printf("Can't open file \"%s\"\n", ofn.lpstrFile);*/
|
||||
return FALSE;
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#define IDC_REGEDIT 109
|
||||
#define IDC_REGEDIT_FRAME 110
|
||||
#define IDR_REGEDIT_MENU 130
|
||||
#define IDD_DIALOG1 131
|
||||
#define IDD_EXPORT_TEMPLATE 131
|
||||
#define IDI_OPEN_FILE 132
|
||||
#define IDD_DIALOG2 132
|
||||
#define IDI_CLOSED_FILE 133
|
||||
|
@ -145,4 +145,9 @@
|
|||
#define IDC_FIND_CONTENT 2007
|
||||
#define IDC_FIND_WHOLE 2008
|
||||
|
||||
#define IDC_EXPORT_BASE 100
|
||||
#define IDC_EXPORT_ALL 101
|
||||
#define IDC_EXPORT_SELECTED 102
|
||||
#define IDC_EXPORT_PATH 103
|
||||
|
||||
#define IDC_STATIC -1
|
||||
|
|
Loading…
Reference in New Issue