void CComboBoxPrxyR::ResetTimer() { // プロキシファイルパス CString strFile = _GetFilePath( _T("Proxy.ini") ); //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv // ランダム CIniFileI pr( strFile, _T("RAND") ); DWORD dwRandChk = 0; pr.QueryValue( dwRandChk, STR_ENABLE ); DWORD dwRandTimeMin = 5; pr.QueryValue( dwRandTimeMin, _T("Min") ); DWORD dwRandTimeSec = 0; pr.QueryValue( dwRandTimeSec, _T("Sec") ); pr.Close(); //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // ランダム指定なし if (dwRandChk == 0) { if (m_nIDEvent != 0) { MTLVERIFY( ::KillTimer(m_hWnd, m_nIDEvent) ); m_nIDEvent = 0; } return; } // タイマー設定 int nAutoChgTime = (dwRandTimeMin * 60 + dwRandTimeSec) * 1000; m_nIDEvent = ::SetTimer(m_hWnd, 1, nAutoChgTime, NULL); }
bool xOperationSys::init(const wchar_t* appName) { //Init the AppPath; m_AppPath = _GetFilePath(appName); if(m_ResPath == L"./" || m_ResPath == L".\\") m_ResPath = m_AppPath ; return true; }
std::ds_wstring GetUpLevelAbsPath(const wchar_t* _relPath , const wchar_t* pRootPath) { _relPath += 3; std::ds_wstring rootPath = _GetFilePath(pRootPath , true).c_str(); size_t nLen = wcslen(_relPath); if(nLen >= 2 && bIsUpLevelDir(_relPath) ) { return GetUpLevelAbsPath(_relPath , rootPath.c_str() ); } std::ds_wstring ret = rootPath + _relPath; return ret; }
std::string CDirectoryManagerBase::GetFilePath(const std::string& fileName, const std::string& fileExt)const { std::string filePath; StringVector directories = GetDirectoriesFromString(GetDirectories()); for (size_t i = 0; i < directories.size() && filePath.empty(); i++) { std::string tmp = _GetFilePath(directories[i], fileName, m_nameType == FILE_TITLE ? fileExt : ""); if (FileExists(tmp)) filePath = tmp; } return filePath; }
/// IEのを使う bool CComboBoxPrxyR::UseIE() { // プロキシファイルパス CString strFile = _GetFilePath( _T("Proxy.ini") ); //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv // ローカル CIniFileI pr( strFile, _T("USE_IE") ); DWORD dwUseIE = 1; pr.QueryValue( dwUseIE, STR_ENABLE ); pr.Close(); //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return dwUseIE != 0; }
void CComboBoxPrxyR::SetProxy() { // プロキシファイルパス CString strFile = _GetFilePath( _T("Proxy.ini") ); // プロキシ番号 DWORD dwIndex = 0; CIniFileI pr( strFile, _T("PROXY") ); pr.QueryValue( dwIndex, _T("TARGET") ); pr.Close(); // 指定番号にする int nIndex = SetCurSel( (int) dwIndex ); ChangeProxy(nIndex); }
void CComboBoxPrxyR::ChangeProxy(int nIndex) { if (m_bUseIE) return; CString str; int port = 0; MtlGetLBTextFixed(m_hWnd, nIndex, str); int colonpos = str.ReverseFind(_T(':')); if(colonpos!=-1){ CString strPort; strPort = str.Right(str.GetLength() - colonpos - 1); port = _ttoi(strPort); str = str.Left(colonpos); } nsEmbedCString vec; nsEmbedCString bypass; PRInt32 useProxy = 0; if ( !str.IsEmpty() ) { vec = NS_LossyConvertUTF16toASCII(str); bypass = NS_LossyConvertUTF16toASCII(GetBypass()); useProxy = 1; } else { vec.AssignLiteral(""); bypass.AssignLiteral(""); useProxy = 0; } //TODO: Gecko化 nsCOMPtr<nsIPrefBranch> pref = do_GetService("@mozilla.org/preferences-service;1"); pref->SetCharPref("network.proxy.http", vec.get()); pref->SetIntPref ("network.proxy.http_port", port); pref->SetIntPref ("network.proxy.type", useProxy); pref->SetCharPref("network.proxy.no_proxies_on", bypass.get()); // プロキシファイルパス CString strFile = _GetFilePath( _T("Proxy.ini") ); CIniFileO pr( strFile, _T("PROXY") ); pr.SetValue( (DWORD) nIndex, _T("TARGET") ); pr.Close(); // タイマー指定 ResetTimer(); }
/// バイパスを得る CString CComboBoxPrxyR::GetBypass() { // プロキシファイルパス CString strFile = _GetFilePath( _T("Proxy.ini") ); CString strBypass; //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv // 非プロキシ { CIniFileI pr( strFile, _T("NOPROXY") ); DWORD dwLineCnt = 0; pr.QueryValue( dwLineCnt, _T("MAX") ); for (int ii = 0; ii < (int) dwLineCnt; ii++) { CString strKey; strKey.Format(_T("%d"), ii); CString strProxy = pr.GetString( strKey ); //*+++ ここをGetStringUWにするかは後で. if ( strProxy.IsEmpty() ) continue; if (strBypass.IsEmpty() == FALSE) strBypass = strBypass + _T(", "); strBypass = strBypass + strProxy; } //x pr.Close(); //+++ } //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv // ローカル { CIniFileI pr( strFile, _T("LOCAL") ); DWORD dwLocalChk = 0; pr.QueryValue( dwLocalChk, STR_ENABLE ); if (dwLocalChk == TRUE) strBypass = strBypass + _T(", localhost, 127.0.0.1"); //x pr.Close(); //+++ } //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return strBypass; }
xOperationSys::xOperationSys() { m_AppPath = PATH_DOTSLASH; m_ResPath = PATH_DOTSLASH; #ifdef _WIN32 wchar_t appName[512] = {0}; getModuleFileName((HMODULE)Global_hModuleHandle , appName , 512); m_AppPath = _GetFilePath(appName); m_ResPath = m_AppPath; #endif XEVOL_LOG(eXL_DEBUG_HIGH,L"============XEvol Operation System=================\n"); XEVOL_LOG(eXL_DEBUG_HIGH,L"XEvol3D is running in %s\n\n" , name() ); XEVOL_LOG(eXL_DEBUG_HIGH,L"<Importance:> Don't forget to call the xOperationSys::init()\n"); XEVOL_LOG(eXL_DEBUG_HIGH,L" If you doesn't do this , you can heard a program is crashing.....\n"); XEVOL_LOG(eXL_DEBUG_HIGH,L" Also this call should better be the first line\n"); XEVOL_LOG(eXL_DEBUG_HIGH,L" in the mian/WinMain function\n"); XEVOL_LOG(eXL_DEBUG_HIGH,L"\n\n=====================================================\n\n"); m_pImeInput = NULL; }
void CComboBoxPrxyR::ResetProxyList() { if (m_bUseIE) { EnableWindow(FALSE); return; } ResetContent(); AddString(_T("")); // プロキシファイルパス CString strFile = _GetFilePath( _T("Proxy.ini") ); CIniFileI pr( strFile, _T("PROXY") ); //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv // プロキシ DWORD dwLineCnt = 0; pr.QueryValue( dwLineCnt, _T("MAX") ); for (int ii = 0; ii < (int) dwLineCnt; ii++) { CString strKey; strKey.Format(_T("%d"), ii); CString strProxy = pr.GetString( strKey ); //*+++ ここをGetStringUWにするかは後で. if ( strProxy.IsEmpty() ) continue; AddString(strProxy); } pr.Close(); //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // プロキシ設定 SetProxy(); }
CString _GetRecentCloseFile() { return _GetFilePath("RecentClose.ini"); }
void CRecentDocumentListFixed::Impl::DeleteIniKeys() { //+++ 念のため、バックアップ化 //x DeleteFile( _GetFilePath( _T("RecentClose.ini") ) ); Misc::MoveToBackupFile( _GetFilePath( _T("RecentClose.ini") ) ); }
wxString CVolume::GetLabSettingsFileName() const { return _GetFilePath(LAB_SETTINGS_FILE); }
wxString CVolume::GetStdSettingsFileName() const { return _GetFilePath(STD_SETTINGS_FILE); }
wxString CVolume::GetAccessFileName() const { return _GetFilePath(ACCESS_FILE); }