GROUPBOX "Explorer",IDC_STATIC,7,7,218,80
CONTROL "E&nable advanced menu",IDC_EXPLORER_ADVANCED,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,27,28,190,10
- CONTROL "In&clude subfolders by default",IDC_EXPLORER_SUBFOLDERS,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,27,38,190,10
CONTROL "&Add to context menu",IDC_EXPLORER_CONTEXT,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,17,18,200,10
PUSHBUTTON "&Register shell extension",IDC_REGISTER_SHELLEXTENSION,17,48,200,14
/// Flags for enabling and mode of extension
#define CONTEXT_F_ENABLED 0x01
#define CONTEXT_F_ADVANCED 0x02
-#define CONTEXT_F_SUBFOLDERS 0x04
// registry dir to WinMerge
static LPCTSTR f_RegDir = _T("Software\\Thingamahoochie\\WinMerge");
: OptionsPanel(optionsMgr, PropShell::IDD)
, m_bContextAdded(FALSE)
, m_bContextAdvanced(FALSE)
-, m_bContextSubfolders(FALSE)
{
}
UpdateButtons();
GetContextRegValues();
AdvancedContextMenuCheck();
- SubfolderOptionCheck();
UpdateData(FALSE);
SetTimer(0, 1000, NULL);
//{{AFX_DATA_MAP(PropShell)
DDX_Check(pDX, IDC_EXPLORER_CONTEXT, m_bContextAdded);
DDX_Check(pDX, IDC_EXPLORER_ADVANCED, m_bContextAdvanced);
- DDX_Check(pDX, IDC_EXPLORER_SUBFOLDERS, m_bContextSubfolders);
//}}AFX_DATA_MAP
}
if (dwContextEnabled & CONTEXT_F_ADVANCED)
m_bContextAdvanced = TRUE;
-
- if (dwContextEnabled & CONTEXT_F_SUBFOLDERS)
- m_bContextSubfolders = TRUE;
}
/// Set registry values for ShellExtension
void PropShell::OnAddToExplorer()
{
AdvancedContextMenuCheck();
- SubfolderOptionCheck();
UpdateButtons();
}
else
dwContextEnabled &= ~CONTEXT_F_ADVANCED;
- if (m_bContextSubfolders)
- dwContextEnabled |= CONTEXT_F_SUBFOLDERS;
- else
- dwContextEnabled &= ~CONTEXT_F_SUBFOLDERS;
-
retVal = reg.WriteDword(f_RegValueEnabled, dwContextEnabled);
if (retVal != ERROR_SUCCESS)
{
}
}
-/// Enable/Disable "Include subfolders by default" checkbox.
-void PropShell::SubfolderOptionCheck()
-{
- if (!IsDlgButtonChecked(IDC_EXPLORER_CONTEXT))
- {
- CheckDlgButton(IDC_EXPLORER_SUBFOLDERS, FALSE);
- m_bContextSubfolders = FALSE;
- }
-}
-
void PropShell::UpdateButtons()
{
bool registered = IsShellExtensionRegistered();
GetDlgItem(IDC_UNREGISTER_SHELLEXTENSION)->EnableWindow(registered);
GetDlgItem(IDC_EXPLORER_ADVANCED)->EnableWindow(
GetDlgItem(IDC_EXPLORER_CONTEXT)->IsWindowEnabled() && IsDlgButtonChecked(IDC_EXPLORER_CONTEXT));
- GetDlgItem(IDC_EXPLORER_SUBFOLDERS)->EnableWindow(
- GetDlgItem(IDC_EXPLORER_CONTEXT)->IsWindowEnabled() && IsDlgButtonChecked(IDC_EXPLORER_CONTEXT));
}
void PropShell::OnRegisterShellExtension()