diff --git a/programs/regedit/En.rc b/programs/regedit/En.rc index c8c497fdc6b..c11345b2e5b 100644 --- a/programs/regedit/En.rc +++ b/programs/regedit/En.rc @@ -175,6 +175,7 @@ BEGIN MENUITEM "&Delete\tDel", ID_EDIT_DELETE MENUITEM "&Rename\tF2", ID_EDIT_RENAME MENUITEM SEPARATOR + MENUITEM "&Export . . .", ID_EDIT_EXPORT MENUITEM "&Copy Key Name", ID_EDIT_COPYKEYNAME MENUITEM SEPARATOR MENUITEM "&Find\tCtrl+F", ID_EDIT_FIND, GRAYED diff --git a/programs/regedit/No.rc b/programs/regedit/No.rc index ee57f2a60a7..e487ab40953 100644 --- a/programs/regedit/No.rc +++ b/programs/regedit/No.rc @@ -106,6 +106,7 @@ BEGIN MENUITEM "&Slett\tDel", ID_EDIT_DELETE MENUITEM "&Gi nytt navn\tF2", ID_EDIT_RENAME MENUITEM SEPARATOR + MENUITEM "&Eksporter . . .", ID_EDIT_EXPORT MENUITEM "&Kopier nøkkelnavn", ID_EDIT_COPYKEYNAME MENUITEM SEPARATOR MENUITEM "&Finn\tCtrl+F", ID_EDIT_FIND, GRAYED diff --git a/programs/regedit/framewnd.c b/programs/regedit/framewnd.c index 3dd9d967961..b1f8a5608f7 100644 --- a/programs/regedit/framewnd.c +++ b/programs/regedit/framewnd.c @@ -277,7 +277,7 @@ static UINT CALLBACK ExportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, WPARA 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); + CheckRadioButton(hdlg, IDC_EXPORT_ALL, IDC_EXPORT_SELECTED, pOpenFileName->lCustData ? IDC_EXPORT_SELECTED : IDC_EXPORT_ALL); break; case CDN_FILEOK: ExportRegistryFile_StoreSelection(hdlg, pOpenFileName); @@ -332,7 +332,7 @@ static BOOL ImportRegistryFile(HWND hWnd) } -static BOOL ExportRegistryFile(HWND hWnd) +static BOOL ExportRegistryFile(HWND hWnd, BOOL export_branch) { OPENFILENAME ofn; TCHAR ExportKeyPath[_MAX_PATH]; @@ -342,7 +342,7 @@ static BOOL ExportRegistryFile(HWND hWnd) InitOpenFileName(hWnd, &ofn); LoadString(hInst, IDS_FILEDIALOG_EXPORT_TITLE, title, COUNT_OF(title)); ofn.lpstrTitle = title; - ofn.lCustData = 0; + 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); @@ -635,8 +635,11 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case ID_REGISTRY_IMPORTREGISTRYFILE: ImportRegistryFile(hWnd); break; + case ID_EDIT_EXPORT: + ExportRegistryFile(hWnd, TRUE); + break; case ID_REGISTRY_EXPORTREGISTRYFILE: - ExportRegistryFile(hWnd); + ExportRegistryFile(hWnd, FALSE); break; case ID_REGISTRY_CONNECTNETWORKREGISTRY: break; diff --git a/programs/regedit/resource.h b/programs/regedit/resource.h index 8e703fb40ec..711dada0c30 100644 --- a/programs/regedit/resource.h +++ b/programs/regedit/resource.h @@ -133,6 +133,7 @@ #define ID_FAVORITE_FIRST 33000 #define ID_FAVORITE_LAST 33099 #define ID_EDIT_NEW_MULTI_STRINGVALUE 33100 +#define ID_EDIT_EXPORT 33101 #define IDD_EDIT_STRING 2000 #define IDC_VALUE_NAME 2001