*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <regedit.h>
while(RemoveMenu(hMenu, s_nFavoriteMenuSubPos, MF_BYPOSITION))
;
}
-
+
lResult = RegOpenKey(HKEY_CURRENT_USER, s_szFavoritesRegKey, &hKey);
if (lResult != ERROR_SUCCESS)
goto done;
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)
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);
LVFINDINFO lvfi;
if (RegOpenKey(hRootKey, pszKeyPath, &hKey) != ERROR_SUCCESS)
- return FALSE;
+ return FALSE;
LoadString(hInst, IDS_NEW_VALUE, szNewValueFormat, sizeof(szNewValueFormat)
/ sizeof(szNewValueFormat[0]));
IDsObjectPicker *ObjectPicker;
TCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
HRESULT hRet;
-
+
hRet = CoInitialize(NULL);
if (SUCCEEDED(hRet))
{
}
}
}
- } else
+ } else
if (GetFocus() == g_pChildWnd->hTreeWnd)
{
if (keyPath == 0 || *keyPath == 0)
{
- MessageBeep(MB_ICONHAND);
+ MessageBeep(MB_ICONHAND);
} else
if (DeleteKey(hWnd, hKeyRoot, keyPath))
{
return DefWindowProc(hWnd, message, wParam, lParam);
break;
case WM_ACTIVATE:
- if (LOWORD(hWnd))
+ if (LOWORD(hWnd))
SetFocus(g_pChildWnd->hWnd);
break;
case WM_SIZE: