本文整理汇总了C++中PWSprefs::OfferDeleteRegistry方法的典型用法代码示例。如果您正苦于以下问题:C++ PWSprefs::OfferDeleteRegistry方法的具体用法?C++ PWSprefs::OfferDeleteRegistry怎么用?C++ PWSprefs::OfferDeleteRegistry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PWSprefs
的用法示例。
在下文中一共展示了PWSprefs::OfferDeleteRegistry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInitDialog
BOOL COptionsSystem::OnInitDialog()
{
COptions_PropertyPage::OnInitDialog();
PWSprefs *prefs = PWSprefs::GetInstance();
if (!m_bShowConfigFile) {
GetDlgItem(IDC_STATIC_CONFIGFILE)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_STATIC_RWSTATUS)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_CONFIGFILE)->ShowWindow(SW_HIDE);
} else {
PWSprefs::ConfigOption configoption;
std::wstring wsCF = prefs->GetConfigFile(configoption);
std::wstring wsCO(L"");
switch (configoption) {
case PWSprefs::CF_NONE:
LoadAString(wsCF, IDS_NONE);
break;
case PWSprefs::CF_REGISTRY:
LoadAString(wsCF, IDS_REGISTRY);
break;
case PWSprefs::CF_FILE_RO:
LoadAString(wsCO, IDS_READ_ONLY);
break;
case PWSprefs::CF_FILE_RW:
case PWSprefs::CF_FILE_RW_NEW:
LoadAString(wsCO, IDS_READ_WRITE);
break;
default:
ASSERT(0);
}
GetDlgItem(IDC_CONFIGFILE)->SetWindowText(wsCF.c_str());
GetDlgItem(IDC_STATIC_RWSTATUS)->SetWindowText(wsCO.c_str());
}
bool bofferdeleteregistry = prefs->OfferDeleteRegistry();
bool boffermigrate2appdata = OfferConfigMigration();
if (!bofferdeleteregistry) {
GetDlgItem(IDC_REGDEL)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_REGDEL)->EnableWindow(FALSE);
}
if (!boffermigrate2appdata) {
GetDlgItem(IDC_MIGRATETOAPPDATA)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_MIGRATETOAPPDATA)->EnableWindow(FALSE);
}
if (!bofferdeleteregistry && !boffermigrate2appdata) {
GetDlgItem(IDC_CONFIG_GRP)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_HIDE);
} else {
GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_SHOW);
}
GetDlgItem(IDC_APPLYCONFIGCHANGES)->EnableWindow(FALSE);
CSpinButtonCtrl *pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_RESPIN);
pspin->SetBuddy(GetDlgItem(IDC_MAXREITEMS));
pspin->SetRange(0, ID_TRAYRECENT_ENTRYMAX - ID_TRAYRECENT_ENTRY1 + 1);
pspin->SetBase(10);
pspin->SetPos(m_MaxREItems);
pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_MRUSPIN);
pspin->SetBuddy(GetDlgItem(IDC_MAXMRUITEMS));
pspin->SetRange(0, ID_FILE_MRU_ENTRYMAX - ID_FILE_MRU_ENTRY1 + 1);
pspin->SetBase(10);
pspin->SetPos(m_MaxMRUItems);
OnUseSystemTray();
InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 2);
AddTool(IDC_REGDEL, IDS_REGDEL);
AddTool(IDC_MIGRATETOAPPDATA, IDS_MIGRATETOAPPDATA);
ActivateToolTip();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例2: OnInitDialog
BOOL COptionsSystem::OnInitDialog()
{
COptions_PropertyPage::OnInitDialog();
PWSprefs *prefs = PWSprefs::GetInstance();
PWSprefs::ConfigOption configoption;
StringX sx_CF = prefs->GetConfigFile(configoption).c_str();
std::wstring wsCO(L"");
switch (configoption) {
case PWSprefs::CF_NONE:
LoadAString(sx_CF, IDS_NONE);
break;
case PWSprefs::CF_REGISTRY:
LoadAString(sx_CF, IDS_REGISTRY);
break;
case PWSprefs::CF_FILE_RO:
LoadAString(wsCO, IDS_READ_ONLY);
break;
case PWSprefs::CF_FILE_RW:
case PWSprefs::CF_FILE_RW_NEW:
LoadAString(wsCO, IDS_READ_WRITE);
break;
default:
ASSERT(0);
}
CString cs_text;
// R/W status
GetDlgItem(IDC_STATIC_RWSTATUS)->SetWindowText(wsCO.c_str());
// Config file name & location
cs_text = PWSUtil::NormalizeTTT(sx_CF, 60).c_str();
GetDlgItem(IDC_CONFIGFILE)->SetWindowText(cs_text);
// Effective host & user used in config file
if (configoption == PWSprefs::CF_FILE_RO ||
configoption == PWSprefs::CF_FILE_RW ||
configoption == PWSprefs::CF_FILE_RW_NEW) {
stringT hn = SysInfo::GetInstance()->GetEffectiveHost();
PWSprefs::XMLify(charT('H'), hn);
stringT un = SysInfo::GetInstance()->GetEffectiveUser();
PWSprefs::XMLify(charT('u'), un);
cs_text.Format(IDS_HOSTUSER, static_cast<LPCWSTR>(hn.c_str()), static_cast<LPCWSTR>(un.c_str()));
GetDlgItem(IDC_STATIC_HOSTUSER)->SetWindowText(cs_text);
}
bool bofferdeleteregistry = prefs->OfferDeleteRegistry();
bool boffermigrate2appdata = OfferConfigMigration();
if (!bofferdeleteregistry) {
GetDlgItem(IDC_REGDEL)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_REGDEL)->EnableWindow(FALSE);
}
if (!boffermigrate2appdata) {
GetDlgItem(IDC_MIGRATETOAPPDATA)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_MIGRATETOAPPDATA)->EnableWindow(FALSE);
}
if (!bofferdeleteregistry && !boffermigrate2appdata) {
GetDlgItem(IDC_CONFIG_GRP)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_HIDE);
} else {
GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_SHOW);
}
GetDlgItem(IDC_APPLYCONFIGCHANGES)->EnableWindow(FALSE);
CSpinButtonCtrl *pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_RESPIN);
pspin->SetBuddy(GetDlgItem(IDC_MAXREITEMS));
pspin->SetRange(M_prefminREItems(), M_prefmaxREItems());
pspin->SetBase(10);
pspin->SetPos(m_MaxREItems);
pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_MRUSPIN);
pspin->SetBuddy(GetDlgItem(IDC_MAXMRUITEMS));
pspin->SetRange(M_prefminMRU(), M_prefmaxMRU());
pspin->SetBase(10);
pspin->SetPos(m_MaxMRUItems);
OnUseSystemTray();
if (InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 0)) {
m_Help1.Init(IDB_QUESTIONMARK);
m_Help2.Init(IDB_QUESTIONMARK);
// Note naming convention: string IDS_xxx corresponds to control IDC_xxx_HELP
AddTool(IDC_REGDELHELP, IDS_REGDEL);
AddTool(IDC_MIGRATETOAPPDATAHELP, IDS_MIGRATETOAPPDATA);
ActivateToolTip();
} else {
m_Help1.EnableWindow(FALSE);
m_Help1.ShowWindow(SW_HIDE);
m_Help2.EnableWindow(FALSE);
m_Help2.ShowWindow(SW_HIDE);
}
//.........这里部分代码省略.........