regedit: Add Export option to context menu.

This commit is contained in:
Alexander Nicolaysen Sørnes 2008-05-17 22:20:55 +02:00 committed by Alexandre Julliard
parent 47b4960129
commit 96653ca60a
4 changed files with 10 additions and 4 deletions

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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