From: Gregor Schneider Date: Thu, 22 Apr 2010 11:25:56 +0000 (+0000) Subject: [REGEDIT] Only set a registry path if the root node is not selected, adjust checks X-Git-Tag: backups/header-work@57446~33^2~80 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=07d8f76a27ec0a57e9b72e5d3ce9cd65227b1f53;hp=2ea442a9df32289bd812714e08392290d4c876ce [REGEDIT] Only set a registry path if the root node is not selected, adjust checks See issue #5297 for more details. svn path=/trunk/; revision=46991 --- diff --git a/reactos/base/applications/regedit/framewnd.c b/reactos/base/applications/regedit/framewnd.c index 6a90cc3edd2..9f42346e550 100644 --- a/reactos/base/applications/regedit/framewnd.c +++ b/reactos/base/applications/regedit/framewnd.c @@ -356,11 +356,11 @@ static UINT_PTR CALLBACK ExportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, W hwndExportAll = GetDlgItem(hdlg, IDC_EXPORT_ALL); if (hwndExportAll) - SendMessage(hwndExportAll, BM_SETCHECK, pszSelectedKey[0] ? BST_UNCHECKED : BST_CHECKED, 0); + SendMessage(hwndExportAll, BM_SETCHECK, pszSelectedKey ? BST_UNCHECKED : BST_CHECKED, 0); hwndExportBranch = GetDlgItem(hdlg, IDC_EXPORT_BRANCH); if (hwndExportBranch) - SendMessage(hwndExportBranch, BM_SETCHECK, pszSelectedKey[0] ? BST_CHECKED : BST_UNCHECKED, 0); + SendMessage(hwndExportBranch, BM_SETCHECK, pszSelectedKey ? BST_CHECKED : BST_UNCHECKED, 0); hwndExportBranchText = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT); if (hwndExportBranchText) @@ -406,7 +406,12 @@ BOOL ExportRegistryFile(HWND hWnd) InitOpenFileName(hWnd, &ofn); LoadString(hInst, IDS_EXPORT_REG_FILE, Caption, sizeof(Caption)/sizeof(TCHAR)); ofn.lpstrTitle = Caption; - ofn.lCustData = (LPARAM) ExportKeyPath; + + /* Only set the path if a key (not the root node) is selected */ + if (hKeyRoot != 0) + { + ofn.lCustData = (LPARAM) ExportKeyPath; + } ofn.Flags = OFN_ENABLETEMPLATE | OFN_EXPLORER | OFN_ENABLEHOOK; ofn.lpfnHook = ExportRegistryFile_OFNHookProc; ofn.lpTemplateName = MAKEINTRESOURCE(IDD_EXPORTRANGE);