Regedit: Set up the export all/export branch UI; currently disabled for now

svn path=/trunk/; revision=18149
This commit is contained in:
Nathan Woods 2005-09-29 03:07:26 +00:00
parent a62c8ab75f
commit cb80311ddf
3 changed files with 44 additions and 24 deletions

View file

@ -349,11 +349,15 @@ END
* Dialog
*/
IDD_DIALOG1 DIALOG DISCARDABLE 50, 50, 268, 98
IDD_EXPORTRANGE DIALOG DISCARDABLE 50, 50, 370, 50
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
WS_BORDER
FONT 8, "MS Sans Serif"
BEGIN
GROUPBOX "Export Range",IDC_STATIC,2,0,366,48
CONTROL "&All",IDC_EXPORT_ALL,"Button",BS_AUTORADIOBUTTON,10,10, 29,11
CONTROL "S&elected Branch",IDC_EXPORT_BRANCH,"Button",BS_AUTORADIOBUTTON,10,22, 100,11
EDITTEXT IDC_EXPORT_BRANCH_TEXT,30,34,335,12
END
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 187, 95

View file

@ -183,25 +183,6 @@ static BOOL CheckCommDlgError(HWND hWnd)
return TRUE;
}
static UINT_PTR CALLBACK ImportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
{
OPENFILENAME* pOpenFileName;
OFNOTIFY* pOfNotify;
switch (uiMsg) {
case WM_INITDIALOG:
pOpenFileName = (OPENFILENAME*)lParam;
break;
case WM_NOTIFY:
pOfNotify = (OFNOTIFY*)lParam;
if (pOfNotify->hdr.code == CDN_INITDONE) {}
break;
default:
break;
}
return 0L;
}
#define MAX_CUSTOM_FILTER_SIZE 50
TCHAR CustomFilterBuffer[MAX_CUSTOM_FILTER_SIZE];
TCHAR FileNameBuffer[_MAX_PATH];
@ -311,6 +292,37 @@ static BOOL ImportRegistryFile(HWND hWnd)
}
static UINT_PTR CALLBACK ExportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
{
HWND hControl;
UINT_PTR iResult = 0;
switch(uiMsg) {
case WM_INITDIALOG:
hControl = GetDlgItem(hdlg, IDC_EXPORT_ALL);
if (hControl)
{
EnableWindow(hControl, FALSE);
SendMessage(hControl, BM_SETCHECK, BST_CHECKED, 0);
}
hControl = GetDlgItem(hdlg, IDC_EXPORT_BRANCH);
if (hControl)
{
EnableWindow(hControl, FALSE);
SendMessage(hControl, BM_SETCHECK, BST_UNCHECKED, 0);
}
hControl = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT);
if (hControl)
{
EnableWindow(hControl, FALSE);
}
break;
}
return iResult;
}
static BOOL ExportRegistryFile(HWND hWnd)
{
OPENFILENAME ofn;
@ -322,9 +334,9 @@ static BOOL ExportRegistryFile(HWND hWnd)
LoadString(hInst, IDS_EXPORT_REG_FILE, Caption, sizeof(Caption)/sizeof(TCHAR));
ofn.lpstrTitle = Caption;
/* ofn.lCustData = ;*/
ofn.Flags = OFN_ENABLETEMPLATE + OFN_EXPLORER;
ofn.lpfnHook = ImportRegistryFile_OFNHookProc;
ofn.lpTemplateName = MAKEINTRESOURCE(IDD_DIALOG1);
ofn.Flags = OFN_ENABLETEMPLATE | OFN_EXPLORER | OFN_ENABLEHOOK;
ofn.lpfnHook = ExportRegistryFile_OFNHookProc;
ofn.lpTemplateName = MAKEINTRESOURCE(IDD_EXPORTRANGE);
if (GetSaveFileName(&ofn)) {
BOOL result;
/* FIXME - convert strings to ascii! */

View file

@ -35,7 +35,7 @@
#define IDC_REGEDIT 109
#define IDC_REGEDIT_FRAME 110
#define IDR_REGEDIT_MENU 130
#define IDD_DIALOG1 131
#define IDD_EXPORTRANGE 131
#define IDI_OPEN_FILE 132
#define IDD_DIALOG2 132
#define IDI_CLOSED_FILE 133
@ -174,4 +174,8 @@
#define IDD_EDIT_MULTI_STRING 2006
#define IDD_EDIT_BIN_DATA 2007
#define IDC_EXPORT_ALL 2008
#define IDC_EXPORT_BRANCH 2009
#define IDC_EXPORT_BRANCH_TEXT 2010
#define IDC_STATIC -1