Пример #1
0
BOOL CHostBaseDownloadDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	CComboBox* baudrateCombo = (CComboBox*)GetDlgItem(IDC_BAUDRATE_IDX);
	CComboBox* bufferCombo = (CComboBox*)GetDlgItem(IDC_BUFFER_IDX);

	if(_V8_SUPPORT)
	{
		baudrateCombo->ResetContent();
		for(int i=0; i<9; ++i)
		{
			CString strIdx;
			strIdx.Format("%d", CSerial::BaudrateTable[i]);
			baudrateCombo->AddString(strIdx);
		}
	}
	baudrateCombo->AddString("SPI");

	CRegistry reg;
	reg.SetRootKey(HKEY_CURRENT_USER);
	if(reg.SetKey("Software\\GNSSViewer\\GPS", true))
	{
		m_nBaudrateIdx = reg.ReadInt("hb_baudrate", g_setting.boostBaudIndex);
		m_strPath = reg.ReadString("hb_firmware", "");
		m_nBufferIdx = reg.ReadInt("hb_buffer", 0);
	}
	else
	{
		m_nBaudrateIdx = BAUDRATE_DEFAULT;
	}

	if(m_strPath.IsEmpty())
	{
		m_strPath = theApp.GetCurrrentDir();
		m_strPath += "\\host.bin";
	}

	baudrateCombo->SetCurSel(m_nBaudrateIdx);
	GetDlgItem(IDC_IMG_PATH)->SetWindowText(m_strPath);
	bufferCombo->SetCurSel(m_nBufferIdx);

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX 屬性頁應傳回 FALSE
}
Пример #2
0
BOOL CSSD::LoadFromReg(CString RegPath)
{
	CRegistry Reg;
	
	if (RegPath.IsEmpty())
		RegPath = GetRegPath();

	if (!Reg.Open(HKEY_LOCAL_MACHINE, RegPath))
		return FALSE;
	
	if (!Reg.ReadString(_T("Name"), m_ssd.m_szName) ||
		!Reg.ReadString(_T("Email"), m_ssd.m_szEmail) ||
		!Reg.ReadString(_T("SSD"), m_ssd.m_szSerial) )
		return FALSE;

	Reg.Close();
	
	return TRUE;
}
Пример #3
0
//////////////////////////////////////////////////////////////////////
//	GetOraNLSFromReg	CAMqa67738 & 67948
//
//	Retrieve the Oracle NLS_LANG varaible from the registry.  It 
//will only retrieve the NLS_LANG from the last installed Oracle.
//
//////////////////////////////////////////////////////////////////////
CString ArbI18N::GetOraNLSFromReg()
{
	CRegistry registry;
	CString cstrNLSLANG(_T(""));
	CString cstrValueName;

	BOOL fRetStatus = registry.Connect((HKEY)CRegistry::keyLocalMachine);
	if (!fRetStatus)
		return _T("");			// Failed to connect to the registry.

	// Get the ID of the last installed Oracle home.
	// Open the key for the last installed home ID
	CString cstrSubKey(_T("SOFTWARE\\ORACLE\\ALL_HOMES"));

	// Open the key for last home id and retrieve it.
	fRetStatus = registry.Open(cstrSubKey);
	if (!fRetStatus)
		return _T("");

	CString cstrLastHomeID;
	cstrValueName = _T("LAST_HOME");
	fRetStatus = registry.GetValue(cstrValueName, cstrLastHomeID);
	if (!fRetStatus)
		return _T("");

	// Open the key to the NLS_LANG and retrieve it.
	cstrSubKey = _T("SOFTWARE\\ORACLE\\HOME");
	cstrSubKey += cstrLastHomeID;
	cstrValueName = _T("NLS_LANG");
	fRetStatus = registry.Open(cstrSubKey);
	if (!fRetStatus)
		return _T("");

	fRetStatus = registry.GetValue(cstrValueName, cstrNLSLANG);
	if (!fRetStatus)
		return _T("");

	return cstrNLSLANG;
}	//GetOraNLSFromReg
Пример #4
0
//data为0去掉搜索和登录框,为1时显示
static bool MotifiInfomationKey( int data )
{
    TCHAR cadKey[MAX_PATH];
    _tcscpy( cadKey, _T( "Software\\Autodesk\\AutoCAD\\R18.0\\ACAD-8001:804\\InfoCenter" ) );

    DWORD dwAccess = KEY_ALL_ACCESS;
    //判断是否64位
    if( IsWow64() )
    {
        dwAccess |= KEY_WOW64_64KEY;
    }

    CRegistry reg;
    bool ret = reg.Open( cadKey, HKEY_CURRENT_USER, dwAccess );
    if( ret )
    {
        ret = false;
        if( reg.Count() > 0 )
        {
            int n = reg.Count();
            for( int i = 0; i < n; i++ )
            {
                CRegEntry* entry = reg.GetAt( i );
                if( 0 == _tcscmp( _T( "InfoCenterOn" ), entry->lpszName ) )
                {
                    *entry = data;
                    ret = true;
                    break;
                }
            }
        }
    }
    reg.Close();

    return ret;
}
Пример #5
0
void CDialogAtualizar::OnButtonAvancado() 
{
    CDialogAtualizarAvancado dlg;

    {
        CRegistry reg;

	    dlg.m_repeat_clientes   = (short)reg.GetDWord(_T("IntervaloClientes"), 0);
	    dlg.m_repeat_cobranca   = (short)reg.GetDWord(_T("IntervaloCobranca"), 0);
	    dlg.m_repeat_estoque    = (short)reg.GetDWord(_T("IntervaloEstoque"), 0);
	    dlg.m_repeat_planos     = (short)reg.GetDWord(_T("IntervaloPlanos"), 0);
	    dlg.m_repeat_precos     = (short)reg.GetDWord(_T("IntervaloPrecos"), 0);
	    dlg.m_repeat_produtos   = (short)reg.GetDWord(_T("IntervaloProdutos"), 0);
	    dlg.m_repeat_tabelas    = (short)reg.GetDWord(_T("IntervaloTabelas"), 0);
	    dlg.m_repeat_vendedores = (short)reg.GetDWord(_T("IntervaloVendedores"), 0);

	    dlg.m_start_clientes    = (short)reg.GetDWord(_T("InicioClientes"), 0);
	    dlg.m_start_cobranca    = (short)reg.GetDWord(_T("InicioCobranca"), 0);
	    dlg.m_start_estoque     = (short)reg.GetDWord(_T("InicioEstoque"), 0);
	    dlg.m_start_planos      = (short)reg.GetDWord(_T("InicioPlanos"), 0);
	    dlg.m_start_precos      = (short)reg.GetDWord(_T("InicioPrecos"), 0);
	    dlg.m_start_produtos    = (short)reg.GetDWord(_T("InicioProdutos"), 0);
	    dlg.m_start_tabelas     = (short)reg.GetDWord(_T("InicioTabelas"), 0);
	    dlg.m_start_vendedores  = (short)reg.GetDWord(_T("InicioVendedores"), 0);

		dlg.m_repeat_clientes_partial = (short)reg.GetDWord(_T("IntervaloClientesParcial"), 0);
		dlg.m_repeat_produtos_partial = (short)reg.GetDWord(_T("IntervaloProdutosParcial"), 0);
		dlg.m_repeat_precos_partial   = (short)reg.GetDWord(_T("IntervaloPrecosParcial"), 0);

		dlg.m_start_clientes_partial  = (short)reg.GetDWord(_T("InicioClientesParcial"), 0);
		dlg.m_start_produtos_partial  = (short)reg.GetDWord(_T("InicioProdutosParcial"), 0);
		dlg.m_start_precos_partial    = (short)reg.GetDWord(_T("InicioPrecosParcial"), 0);
    }

    if (dlg.DoModal() == IDOK)
    {
        CRegistry reg;

	    reg.SetDWord(_T("IntervaloClientes"), dlg.m_repeat_clientes);
	    reg.SetDWord(_T("IntervaloCobranca"), dlg.m_repeat_cobranca);
	    reg.SetDWord(_T("IntervaloEstoque"), dlg.m_repeat_estoque);
	    reg.SetDWord(_T("IntervaloPlanos"), dlg.m_repeat_planos);
	    reg.SetDWord(_T("IntervaloPrecos"), dlg.m_repeat_precos);
	    reg.SetDWord(_T("IntervaloProdutos"), dlg.m_repeat_produtos);
	    reg.SetDWord(_T("IntervaloTabelas"), dlg.m_repeat_tabelas);
	    reg.SetDWord(_T("IntervaloVendedores"), dlg.m_repeat_vendedores);

	    reg.SetDWord(_T("InicioClientes"), dlg.m_start_clientes);
	    reg.SetDWord(_T("InicioCobranca"), dlg.m_start_cobranca);
	    reg.SetDWord(_T("InicioEstoque"), dlg.m_start_estoque);
	    reg.SetDWord(_T("InicioPlanos"), dlg.m_start_planos);
	    reg.SetDWord(_T("InicioPrecos"), dlg.m_start_precos);
	    reg.SetDWord(_T("InicioProdutos"), dlg.m_start_produtos);
	    reg.SetDWord(_T("InicioTabelas"), dlg.m_start_tabelas);
	    reg.SetDWord(_T("InicioVendedores"), dlg.m_start_vendedores);

		reg.SetDWord(_T("IntervaloClientesParcial"), dlg.m_repeat_clientes_partial);
		reg.SetDWord(_T("IntervaloProdutosParcial"), dlg.m_repeat_produtos_partial);
		reg.SetDWord(_T("IntervaloPrecosParcial"), dlg.m_repeat_precos_partial);

		reg.SetDWord(_T("InicioClientesParcial"), dlg.m_start_clientes_partial);
		reg.SetDWord(_T("InicioProdutosParcial"), dlg.m_start_produtos_partial);
		reg.SetDWord(_T("InicioPrecosParcial"), dlg.m_start_precos_partial);
    }
}
Пример #6
0
	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;
	}
Пример #7
0
bool CSettings::LoadSettings(std::string szDir, std::string fileName, bool LoadFromRegistry ) {
	fileName_ = !szDir.empty() ? szDir + ( (!fileName .empty())? fileName : "Settings.xml") 
		: SettingsFolder + ( !fileName.empty() ? fileName : "Settings.xml");
	//std::cout<< fileName_;
	//MessageBoxA(0,fileName_.c_str(),0,0);
	if ( !IuCoreUtils::FileExists( fileName_)  ) {
		return true;
	}
	SimpleXml xml;
	xml.LoadFromFile( fileName_ );
	mgr_.loadFromXmlNode( xml.getRoot("ImageUploader").GetChild("Settings") );

	SimpleXmlNode settingsNode = xml.getRoot( "ImageUploader" ).GetChild( "Settings" );

#if !defined(IU_CLI) && !defined( IU_SHELLEXT) && !defined(IU_SERVERLISTTOOL)
	std::string temp;
	if ( !settingsNode["Image"]["Format"].IsNull() ) {
		// for compatibility with old version configuration file
		LoadConvertProfile( "Old profile", settingsNode );
	}

	if ( CmdLine.IsOption(_T("afterinstall") )) {
		if ( CmdLine.IsOption(_T("usenewicon") )) {
			UseNewIcon = true;
		} else {
			UseNewIcon = false;
		}
		SaveSettings();
	}
	
	// Migrating from 1.3.0 to 1.3.1 (added ImageEditor has been addded)
	if (settingsNode["ImageEditor"].IsNull() ) {
		if ( Settings.TrayIconSettings.TrayScreenshotAction == TRAY_SCREENSHOT_UPLOAD ) {
			TrayIconSettings.TrayScreenshotAction = TRAY_SCREENSHOT_OPENINEDITOR;
		}
		
	}
	LoadConvertProfiles( settingsNode.GetChild("Image").GetChild("Profiles") );
	LoadServerProfiles( settingsNode.GetChild("Uploading").GetChild("ServerProfiles") );
#endif
	LoadAccounts( xml.getRoot( "ImageUploader" ).GetChild( "Settings" ).GetChild( "ServersParams" ) );
#if !defined(IU_CLI) && !defined( IU_SHELLEXT) && !defined(IU_SERVERLISTTOOL)
	// Fixing profies
	if ( !imageServer.profileName().IsEmpty() &&  ServersSettings[WCstringToUtf8(imageServer.serverName())].find(WCstringToUtf8(imageServer.profileName())) == ServersSettings[WCstringToUtf8(imageServer.serverName())].end() ) {
		imageServer.setProfileName("");
	}

	if ( !fileServer.profileName().IsEmpty() &&  ServersSettings[WCstringToUtf8(fileServer.serverName())].find(WCstringToUtf8(fileServer.profileName())) == ServersSettings[WCstringToUtf8(fileServer.serverName())].end() ) {
		fileServer.setProfileName("");
	}
	if ( !contextMenuServer.profileName().IsEmpty() &&  ServersSettings[WCstringToUtf8(contextMenuServer.serverName())].find(WCstringToUtf8(contextMenuServer.profileName())) == ServersSettings[WCstringToUtf8(contextMenuServer.serverName())].end() ) {
		contextMenuServer.setProfileName("");
	}

	if ( !quickScreenshotServer.profileName().IsEmpty() &&  ServersSettings[WCstringToUtf8(quickScreenshotServer.serverName())].find(WCstringToUtf8(quickScreenshotServer.profileName())) == ServersSettings[WCstringToUtf8(quickScreenshotServer.serverName())].end() ) {
		quickScreenshotServer.setProfileName("");
	}

	if ( !urlShorteningServer.profileName().IsEmpty() &&  ServersSettings[WCstringToUtf8(urlShorteningServer.serverName())].find(WCstringToUtf8(urlShorteningServer.profileName())) == ServersSettings[WCstringToUtf8(urlShorteningServer.serverName())].end() ) {
		urlShorteningServer.setProfileName("");
	}
	if ( UploadBufferSize == 65536) {
		UploadBufferSize = 1024 * 1024;
	}
#endif
#if !defined(IU_CLI) && !defined(IU_SERVERLISTTOOL)
	// Loading some settings from registry
	if ( LoadFromRegistry ) {
		CRegistry Reg;
		Reg.SetRootKey( HKEY_LOCAL_MACHINE );
		if ( Reg.SetKey("Software\\Zenden.ws\\Image Uploader", false ) ) {
			ExplorerContextMenu = Reg.ReadBool("ExplorerContextMenu", false);

		} else {
			ExplorerContextMenu = false;
		}
	}
	CRegistry Reg;
	Reg.SetRootKey( HKEY_CURRENT_USER );
	if ( Reg.SetKey("Software\\Zenden.ws\\Image Uploader", false ) ) {
		ExplorerCascadedMenu = Reg.ReadBool( "ExplorerCascadedMenu", true);
		ExplorerVideoContextMenu = Reg.ReadBool( "ExplorerVideoContextMenu", true);
	} 
	CRegistry Reg2;
	Reg2.SetRootKey(HKEY_CURRENT_USER);
	if ( Reg2.SetKey("Software\\Zenden.ws\\Image Uploader", false ) ) {
		AutoStartup = Reg2.ReadBool("AutoStartup", false);
	}

	if ( VideoSettings.Engine != VideoEngineDirectshow &&  VideoSettings.Engine != VideoEngineFFmpeg && VideoSettings.Engine != VideoEngineAuto   ){
		VideoSettings.Engine = VideoEngineAuto;
	}
	if ( !IsFFmpegAvailable() ){
		VideoSettings.Engine = VideoEngineDirectshow;
	}
#endif
	return true;
}
Пример #8
0
/*
	Determine where data folder is situated
	and store it's path into DataFolder member
*/
void CSettings::FindDataFolder()
{
	AppParams* params = AppParams::instance();
	if (IsDirectory(WinUtils::GetAppFolder() + _T("Data"))) {
		DataFolder     = WinUtils::GetAppFolder() + _T("Data\\");
		SettingsFolder = IuCoreUtils::WstringToUtf8(static_cast<LPCTSTR>(DataFolder));
		
		params->setDataDirectory(IuStringUtils::Replace(IuCoreUtils::WstringToUtf8((LPCTSTR)DataFolder), "\\", "/"));
		params->setSettingsDirectory(IuStringUtils::Replace(SettingsFolder, "\\", "/"));
		IsPortable = true;
		return;
	}

	SettingsFolder =  IuCoreUtils::WstringToUtf8(static_cast<LPCTSTR>(GetApplicationDataPath() + _T("Image Uploader\\")));
	
	params->setSettingsDirectory(IuStringUtils::Replace(SettingsFolder, "\\", "/"));
	#if !defined(IU_SERVERLISTTOOL) && !defined  (IU_CLI) && !defined(IU_SHELLEXT)
	{
		CRegistry Reg;
		CString lang;

		Reg.SetRootKey(HKEY_CURRENT_USER);
		if (Reg.SetKey("Software\\Zenden.ws\\Image Uploader", false))
		{
			CString dir = Reg.ReadString("DataPath");

			if (!dir.IsEmpty() && IsDirectory(dir))
			{
				DataFolder = dir;
				params->setDataDirectory(IuStringUtils::Replace(IuCoreUtils::WstringToUtf8((LPCTSTR)DataFolder), "\\", "/"));
				return;
			}
		}
	}
	{
		CRegistry Reg;
		Reg.SetRootKey(HKEY_LOCAL_MACHINE);
		if (Reg.SetKey("Software\\Zenden.ws\\Image Uploader", false))
		{
			CString dir = Reg.ReadString("DataPath");

			if (!dir.IsEmpty() && IsDirectory(dir))
			{
				DataFolder = dir;
				params->setDataDirectory(IuStringUtils::Replace(IuCoreUtils::WstringToUtf8((LPCTSTR)DataFolder), "\\", "/"));
				return;
			}
		}
	}

	if (FileExists(GetCommonApplicationDataPath() + SETTINGS_FILE_NAME)) {
		DataFolder = GetCommonApplicationDataPath() + _T("Image Uploader\\");
		params->setDataDirectory(IuStringUtils::Replace(IuCoreUtils::WstringToUtf8((LPCTSTR)DataFolder), "\\", "/"));
	}
	else 
		#endif
	
	{
		DataFolder = GetApplicationDataPath() + _T("Image Uploader\\");
		params->setDataDirectory(IuStringUtils::Replace(IuCoreUtils::WstringToUtf8((LPCTSTR)DataFolder), "\\", "/"));
	}
}
Пример #9
0
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();
}
Пример #10
0
// Creates it and calls Init
IRegistry *InstanceRegistry( char const *subDirectoryUnderValve )
{
	CRegistry *instance = new CRegistry();
	instance->DirectInit( subDirectoryUnderValve );
	return instance;
}
Пример #11
0
void CTransferPage::LoadFromRegistry()
{
   // Get a pointer to Application object
   CRegistry reg;

   if(reg.Open(m_csChannelName) == ERROR_SUCCESS)
   {
      UpdateData();

      int iService = reg.GetProfileInt(_T("Service"), 0);
      switch(iService)
      {
         case 0:
            m_csService = _T("FTP");
            break;
         case 1:
            m_csService = _T("SCP");
            break;
         case 2:
            m_csService = _T("SFTP");
            break;
      }
      m_csChannel  = reg.GetProfileString(_T("Channel"), _T("??"));
      m_csServer   = reg.GetProfileString(_T("Server"), _T("??"));
      m_csPort.Format(_T("%d"), reg.GetProfileInt(_T("Port"), 21));   
      m_csUsername = reg.GetProfileString(_T("Username"), _T(""));
      m_csPassword = reg.GetProfileString(_T("Password"), _T(""));
   
      BOOL bSavePassword = reg.GetProfileInt(_T("SavePassword"), TRUE);   
      m_csSave = (bSavePassword) ? _T("Yes") : _T("No");
   
      m_csXmlDir = reg.GetProfileString(_T("ChannelDirectory"), _T(""));
      m_csMp4Dir = reg.GetProfileString(_T("MediaDirectory"), _T(""));
      m_csWebUrl = reg.GetProfileString(_T("MediaFilePath"), _T(""));

      int iSsh = reg.GetProfileInt(_T("SSHVersion"), 1);
      m_Ssh = (iSsh == 0) ? _T("1") : _T("2");

      int iIP = reg.GetProfileInt(_T("IPVersion"), 0);
      m_csIP = (iIP == 0) ? _T("4") : _T("6");
   

      BOOL bCompression = reg.GetProfileInt(_T("Compression"), 0);
      m_csCompression = (bCompression) ? _T("Yes") : _T("No");
   
      BOOL bPrivateKey  = reg.GetProfileInt(_T("PrivateKey"), 0);
      m_csPkf = (bPrivateKey) ? _T("Yes") : _T("No");

      UpdateData(FALSE);
      reg.Close();
   }
}
Пример #12
0
BOOL CSpinDoctorApp::InitInstance()
{

   // Enable 3D Controls
#ifdef _AFXDLL
	Enable3dControls();
#else
	Enable3dControlsStatic();
#endif

	CRegistry oReg;
   int iPrecision, iAngleType, iOnTop, iSelectedTab;

	// Load registry settings
   oReg.OpenKey(CURRENT_USER, "Software\\vapourtech\\SpinDoctor", true);
   iPrecision = oReg.ReadInt("Precision", 2);
   iAngleType = oReg.ReadInt("AngleType", 0);
   iOnTop = oReg.ReadInt("OnTop", 0);
   iSelectedTab = oReg.ReadInt("SelectedTab", 0);
	oReg.CloseKey();
	
   // Create dialog
	CSpinDoctorDlg dlg;
	m_pMainWnd = &dlg;

   // Set information in main dialog
	dlg.SetOptions(iPrecision,iAngleType,iOnTop,iSelectedTab);

   // Display dialog
	dlg.DoModal();

   // Retrieve settings from dialog
   dlg.GetOptions(&iPrecision,&iAngleType,&iOnTop,&iSelectedTab);

	// Save registry settings
   if (oReg.OpenKey(CURRENT_USER, "Software\\vapourtech\\SpinDoctor", false)) {
      oReg.WriteInt("Precision", iPrecision);
      oReg.WriteInt("AngleType", iAngleType);
      oReg.WriteInt("OnTop", iOnTop);
      oReg.WriteInt("SelectedTab",iSelectedTab);
	   oReg.CloseKey();
   }
   else {
      ::AfxMessageBox("Could not save registry settings!",MB_ICONERROR|MB_OK);
   }
	
   // Finised, so return false
	return FALSE;
}