BOOL CSSD::SaveToReg(CString RegPath) { CRegistry Reg; if (RegPath.IsEmpty()) RegPath = GetRegPath(); if (m_ssd.m_szName.IsEmpty() || m_ssd.m_szEmail.IsEmpty() || m_ssd.m_szSerial.IsEmpty()) return FALSE; if (!Reg.VerifyKey(HKEY_LOCAL_MACHINE, RegPath) && !Reg.CreateKey(HKEY_LOCAL_MACHINE, RegPath) ) return FALSE; if (!Reg.Open(HKEY_LOCAL_MACHINE, RegPath)) return FALSE; if (!Reg.WriteString(_T("Name"), m_ssd.m_szName) || !Reg.WriteString(_T("Email"), m_ssd.m_szEmail) || !Reg.WriteString(_T("SSD"), m_ssd.m_szSerial) ) return FALSE; Reg.Close(); return TRUE; }
void CGpsdoDownload::SaveSetting() { //m_nBaudrateIdx = ((CComboBox*)GetDlgItem(IDC_BAUDRATE_IDX))->GetCurSel(); CRegistry reg; reg.SetRootKey(HKEY_CURRENT_USER); if(reg.SetKey("Software\\GNSSViewer\\GPS", false)) { reg.WriteString("gpsdo_fw_dn_master_path", m_strMasterPath); reg.WriteString("gpsdo_fw_dn_slave_path", m_strSlavePath); //reg.WriteInt("fw_baudrate", m_nBaudrateIdx); } }
void CHostBaseDownloadDlg::GetValue() { m_nBaudrateIdx = ((CComboBox*)GetDlgItem(IDC_BAUDRATE_IDX))->GetCurSel(); GetDlgItem(IDC_IMG_PATH)->GetWindowText(m_strPath); m_nBufferIdx = ((CComboBox*)GetDlgItem(IDC_BUFFER_IDX))->GetCurSel(); CRegistry reg; reg.SetRootKey(HKEY_CURRENT_USER); if(reg.SetKey(VIEWER_REG_PATH, false)) { reg.WriteInt("hb_baudrate", m_nBaudrateIdx); reg.WriteString("hb_firmware", m_strPath); reg.WriteInt("hb_buffer", m_nBufferIdx); } }
void CParallelDownloadDlg::OnOK() { //m_nBaudrateIdx = ((CComboBox*)GetDlgItem(IDC_BAUDRATE_IDX))->GetCurSel(); m_nFlashType = ((CComboBox*)GetDlgItem(IDC_FLASH_TYPE))->GetCurSel(); GetDlgItem(IDC_IMG_PATH)->GetWindowText(m_strPath); // m_isInternal = ((CButton*)GetDlgItem(IDC_IN_LOADER))->GetCheck(); // m_nBufferIdx = ((CComboBox*)GetDlgItem(IDC_BUFFER_IDX))->GetCurSel(); CRegistry reg; reg.SetRootKey(HKEY_CURRENT_USER); if(reg.SetKey(VIEWER_REG_PATH, false)) { //reg.WriteInt("pl_baudrate", m_nBaudrateIdx); reg.WriteInt("pl_flashtype", m_nFlashType); reg.WriteString("pl_firmware", m_strPath); //reg.WriteInt("pl_internal", m_isInternal); //reg.WriteInt("pl_buffer", m_nBufferIdx); } CDialog::OnOK(); }
bool CSettings::SaveSettings() { SimpleXml xml; mgr_.saveToXmlNode(xml.getRoot("ImageUploader").GetChild("Settings")); #if !defined(IU_SERVERLISTTOOL) && !defined (IU_CLI) && !defined(IU_SHELLEXT) SaveConvertProfiles(xml.getRoot("ImageUploader").GetChild("Settings").GetChild("Image").GetChild("Profiles")); SaveServerProfiles( xml.getRoot("ImageUploader").GetChild("Settings").GetChild("Uploading").GetChild("ServerProfiles") ); #endif SaveAccounts(xml.getRoot("ImageUploader").GetChild("Settings").GetChild("ServersParams")); //std::cerr << "Saving setting to "<< IuCoreUtils::WstringToUtf8((LPCTSTR)fileName_); xml.SaveToFile(fileName_); #if !defined(IU_SERVERLISTTOOL) && !defined(IU_CLI) CRegistry Reg; Reg.SetRootKey(HKEY_CURRENT_USER); // if(ExplorerContextMenu) { bool canCreateRegistryKey = ( ExplorerContextMenu ); if ( Reg.SetKey("Software\\Zenden.ws\\Image Uploader", canCreateRegistryKey ) ) { if ( ExplorerContextMenu ) { Reg.WriteBool( "ExplorerCascadedMenu", ExplorerCascadedMenu ); Reg.WriteBool("ExplorerContextMenu", ExplorerContextMenu); Reg.WriteBool( "ExplorerVideoContextMenu", ExplorerVideoContextMenu ); Reg.WriteString( "Language", Language ); } else { Reg.DeleteValue("ExplorerCascadedMenu"); Reg.DeleteValue("ExplorerContextMenu"); Reg.DeleteValue("ExplorerVideoContextMenu"); Reg.DeleteValue("Language"); } } } /*else { //Reg.DeleteKey("Software\\Zenden.ws\\Image Uploader"); }*/ EnableAutostartup(AutoStartup); if (SendToContextMenu_changed || ExplorerContextMenu_changed) { AutoStartup_changed = false; BOOL b; if ( IsVista() && IsElevated(&b) != S_OK ) { // Start new elevated process ApplyRegistrySettings(); } else { // Process has already admin rights ApplyRegSettingsRightNow(); } } ExplorerContextMenu_changed = false; SendToContextMenu_changed = false; if (ShowTrayIcon_changed) { ShowTrayIcon_changed = false; if (ShowTrayIcon) { if (!IsRunningFloatingWnd()) { CmdLine.AddParam(_T("/tray")); floatWnd.CreateTrayIcon(); } } else { HWND TrayWnd = FindWindow(0, _T("ImageUploader_TrayWnd")); if (TrayWnd) { ::SendMessage( TrayWnd, WM_CLOSETRAYWND, 0, 0 ); } } } else if (ShowTrayIcon) { HWND TrayWnd = FindWindow(0, _T("ImageUploader_TrayWnd")); if (TrayWnd) SendMessage(TrayWnd, WM_RELOADSETTINGS, (floatWnd.m_hWnd) ? 1 : 0, (Settings.Hotkeys_changed) ? 0 : 1); } Settings.Hotkeys_changed = false; #endif return true; }
void CCCFixDlg::OnOK() { // Open registry CRegistry oReg; // Fix the .cc assocation key oReg.OpenKey(CLASSES_ROOT, ".cc", false); oReg.WriteString("", "cppfile"); oReg.CloseKey(); // Fix the .hh assocation key oReg.OpenKey(CLASSES_ROOT, ".hh", false); oReg.WriteString("", "hppfile"); oReg.CloseKey(); // Find and open the devstudio root key char strVCPPRoot[256] = ""; const char* strVCPPRoots[] = { "Software\\Microsoft\\Developer", "Software\\Microsoft\\DevStudio\\5.0", "Software\\Microsoft\\DevStudio\\6.0", }; for (int k=0; k<3; k++) { if (oReg.OpenKey(CURRENT_USER, strVCPPRoots[k], true)) { // Loop through possible compilers const int iNumCompilers = 6; const char* strCompilerKeys[iNumCompilers] = { "\\Build System\\Components\\Platforms\\Win32 (ALPHA)\\Tools\\C/C++ Compiler for Alpha", "\\Build System\\Components\\Platforms\\Win32 (PowerPC)\\Tools\\C/C++ Compiler for PowerPC", "\\Build System\\Components\\Platforms\\Win32 (x86)\\Tools\\32-bit C/C++ Compiler for 80x86", "\\Build System\\Components\\Platforms\\Win32 (WCE x86em)\\Tools\\C++ Compiler for 80x86em (Emulation)", "\\Build System\\Components\\Platforms\\Win32 (WCE MIPS)\\Tools\\C/C++ Compiler Mips R4100", "\\Build System\\Components\\Platforms\\Win32 (WCE SH)\\Tools\\C/C++ Compiler for SH", }; for (int i=0; i<iNumCompilers; i++) { char strKey[256] = ""; strcpy(strKey,strVCPPRoots[k]); strcat(strKey,strCompilerKeys[i]); // Try to open each key if (oReg.OpenKey(CURRENT_USER, strKey, true)) { char strInputSpec[256] = ""; // See if .cc is already in the Input_Spec oReg.ReadString("Input_Spec","",strInputSpec); oReg.CloseKey(); if (strlen(strInputSpec)>0 && strstr(strInputSpec,"*.cc")==NULL) { // If not, put it on the end oReg.OpenKey(CURRENT_USER, strKey, false); strcat(strInputSpec,";*.cc"); oReg.WriteString("Input_Spec",strInputSpec); oReg.CloseKey(); } } } //Fix IDE highlighting char strTextEditorKey[256] = ""; strcpy(strTextEditorKey,strVCPPRoots[k]); strcat(strTextEditorKey,"\\Text Editor\\Tabs/Language Settings\\C/C++"); if (oReg.OpenKey(CURRENT_USER,strTextEditorKey,true)) { char strFileExtensions[256] = ""; oReg.ReadString("FileExtensions","",strFileExtensions); oReg.CloseKey(); if (strlen(strFileExtensions)>0 && strstr(strFileExtensions,"cc")==NULL ) { strcat(strFileExtensions,";cc"); } if (strlen(strFileExtensions)>0 && strstr(strFileExtensions,"hh")==NULL ) { strcat(strFileExtensions,";hh"); } oReg.OpenKey(CURRENT_USER,strTextEditorKey,false); oReg.WriteString("FileExtensions",strFileExtensions); oReg.CloseKey(); } oReg.CloseKey(); } } CDoneDialog donedlg; donedlg.DoModal(); CDialog::OnOK(); }