void CPPageMisc::OnResetSettings() { if (MessageBox(ResStr(IDS_RESET_SETTINGS_WARNING), ResStr(IDS_RESET_SETTINGS), MB_ICONEXCLAMATION | MB_YESNO | MB_DEFBUTTON2) == IDYES) { ((CMainFrame*)AfxGetMyApp()->GetMainWnd())->SendMessage(WM_CLOSE); ShellExecute(NULL, _T("open"), GetProgramPath(true), _T("/reset"), NULL, SW_SHOWNORMAL); } }
void ISubPicAllocatorPresenterImpl::AlphaBltSubPic(CSize size, SubPicDesc* pTarget) { size.cy -= AfxGetMyApp()->GetBottomSubOffset(); CComPtr<ISubPic> pSubPic; CComPtr<ISubPic> pSubPic2; BOOL bltSub1 = false, bltSub2 = false; CRect rcSource1, rcSource2, rcDest1, rcDest2; #ifdef LOGSUBRECT CString szD1, szD2; #endif if(m_pSubPicQueue->LookupSubPic(m_rtNow, pSubPic)) { if (SUCCEEDED (pSubPic->GetSourceAndDest(&size, rcSource1, rcDest1))){ //pSubPic->AlphaBlt(rcSource, rcDest, pTarget); bltSub1 = true; } #ifdef LOGSUBRECT UINT iTotalLenSec = (UINT)( (INT64) m_rtNow / 10000000 ); szD1.Format(_T(" sub1 size %d %d , source %d %d %d %d , dest %d %d %d %d , time %d:%02d") , size.cx, size.cy, rcSource1.top, rcSource1.right, rcSource1.bottom, rcSource1.left, rcDest1.top, rcDest1.right, rcDest1.bottom, rcDest1.left,(int)iTotalLenSec/60, iTotalLenSec % 60 ); #endif } if(m_pSubPicQueue2->LookupSubPic(m_rtNow2, pSubPic2)) { if (SUCCEEDED (pSubPic2->GetSourceAndDest(&size, rcSource2, rcDest2))){ bltSub2 = true; } #ifdef LOGSUBRECT UINT iTotalLenSec = (UINT)( (INT64) m_rtNow2 / 10000000 ); szD2.Format(_T(" sub2 size %d %d , source %d %d %d %d , dest %d %d %d %d , time %d:%02d") , size.cx, size.cy, rcSource2.top, rcSource2.right, rcSource2.bottom, rcSource2.left, rcDest2.top, rcDest2.right, rcDest2.bottom, rcDest2.left,(int)iTotalLenSec/60, iTotalLenSec % 60 ); #endif } m_sublib2.CalcDualSubPosisiton(bltSub1 , bltSub2 , rcDest1 , rcDest2 , size , !!pSubPic, !!pSubPic2) ; if(bltSub1) pSubPic->AlphaBlt(rcSource1, rcDest1, pTarget); if(bltSub2){ pSubPic2->AlphaBlt(rcSource2, rcDest2, pTarget); } #ifdef LOGSUBRECT if(bltSub1 || bltSub2){ SVP_LogMsg(szD1 + szD2); } #endif }
UINT CFileAssoc::RunCheckIconsAssocThread(LPVOID pParam) { const CMediaFormats& mf = *(const CMediaFormats*)pParam; UINT nLastVersion = AfxGetApp()->GetProfileInt(IDS_R_SETTINGS, IDS_RS_ICON_LIB_VERSION, 0); if (LoadIconLib()) { UINT nCurrentVersion = GetIconLibVersion(); SaveIconLibVersion(); // Ensure we don't try to fix the icons more than once CAtlList<CString> registeredExts; if (nCurrentVersion != nLastVersion && GetAssociatedExtensions(mf, registeredExts)) { if (SysVersion::IsVistaOrLater() && !IsUserAnAdmin()) { TASKDIALOGCONFIG config = {0}; config.cbSize = sizeof(config); config.hInstance = AfxGetInstanceHandle(); config.hwndParent = AfxGetApp()->GetMainWnd()->GetSafeHwnd(); config.dwCommonButtons = TDCBF_YES_BUTTON | TDCBF_NO_BUTTON; config.pszMainIcon = TD_SHIELD_ICON; config.pszWindowTitle = MAKEINTRESOURCE(IDS_ICONS_REASSOC_DLG_TITLE); config.pszMainInstruction = MAKEINTRESOURCE(IDS_ICONS_REASSOC_DLG_INSTR); config.pszContent = MAKEINTRESOURCE(IDS_ICONS_REASSOC_DLG_CONTENT); config.pfCallback = TaskDialogCallbackProc; typedef HRESULT(_stdcall * pfTaskDialogIndirect)(const TASKDIALOGCONFIG*, int*, int*, BOOL*); HMODULE hModule = ::LoadLibrary(_T("comctl32.dll")); if (hModule) { pfTaskDialogIndirect TaskDialogIndirect = (pfTaskDialogIndirect)(::GetProcAddress(hModule, "TaskDialogIndirect")); if (TaskDialogIndirect) { int nButtonPressed = 0; TaskDialogIndirect(&config, &nButtonPressed, NULL, NULL); if (IDYES == nButtonPressed) { AfxGetMyApp()->RunAsAdministrator(GetProgramPath(true), _T("/iconsassoc"), true); } } ::FreeLibrary(hModule); } } else { ReAssocIcons(registeredExts); SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); } } FreeIconLib(); } return 0; }
void CFGFilterLAVAudio::Settings::SaveSettings() { CMPlayerCApp* pApp = AfxGetMyApp(); ASSERT(pApp); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("TrayIcon"), bTrayIcon); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("DRCEnabled"), bDRCEnabled); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("DRCLevel"), iDRCLevel); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("DTSHDFraming"), bDTSHDFraming); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("AutoAVSync"), bAutoAVSync); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("ExpandMono"), bExpandMono); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("Expand61"), bExpand61); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("OutputStandardLayout"), bOutputStandardLayout); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("Output51Legacy"), bOutput51Legacy); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("Mixing"), bMixingEnabled); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("MixingLayout"), dwMixingLayout); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("MixingFlags"), dwMixingFlags); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("MixingMode"), dwMixingMode); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("MixingCenterLevel"), dwMixingCenterLevel); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("MixingSurroundLevel"), dwMixingSurroundLevel); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("MixingLFELevel"), dwMixingLFELevel); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("AudioDelayEnabled"), bAudioDelayEnabled); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("AudioDelay"), iAudioDelay); for (int i = 0; i < Bitstream_NB; ++i) { CString key = CString(_T("Bitstreaming_")) + bitstreamingCodecs[i]; pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, key, bBitstream[i]); } for (int i = 0; i < SampleFormat_Bitstream; ++i) { CString key = CString(_T("SampleFormat_")) + sampleFormats[i]; pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, key, bSampleFormats[i]); } pApp->WriteProfileInt(IDS_R_INTERNAL_LAVAUDIO, _T("SampleConvertDither"), bSampleConvertDither); }
CGoToDlg::CGoToDlg(int time, float fps, CWnd* pParent /*=NULL*/) : CDialog(CGoToDlg::IDD, pParent) , m_timestr(_T("")) , m_framestr(_T("")) , m_time(time) , m_fps(fps) { if(m_fps == 0) { CString str = AfxGetMyApp()->GetProfileString(ResStr(IDS_R_SETTINGS), _T("fps"), _T("0")); if(_stscanf(str, _T("%f"), &m_fps) != 1) m_fps = 0; } }
void CPPageFormats::OnBnRunAsAdmin() { CString strCmd; strCmd.Format(_T("/adminoption %d"), IDD); AfxGetMyApp()->RunAsAdministrator(PathUtils::GetProgramPath(true), strCmd, true); auto& s = AfxGetAppSettings(); s.m_Formats.UpdateData(false); s.fAssociatedWithIcons = !!AfxGetApp()->GetProfileInt(IDS_R_SETTINGS, IDS_RS_ASSOCIATED_WITH_ICON, TRUE); LoadSettings(); }
BOOL CPPageMisc::OnInitDialog() { __super::OnInitDialog(); const CAppSettings& s = AfxGetAppSettings(); CreateToolTip(); m_iBrightness = s.iBrightness; m_iContrast = s.iContrast; m_iHue = s.iHue; m_iSaturation = s.iSaturation; m_SliBrightness.EnableWindow(TRUE); m_SliBrightness.SetRange(-100, 100, true); m_SliBrightness.SetTic(0); m_SliBrightness.SetPos(m_iBrightness); m_SliContrast.EnableWindow(TRUE); m_SliContrast.SetRange(-100, 100, true); m_SliContrast.SetTic(0); m_SliContrast.SetPos(m_iContrast); m_SliHue.EnableWindow(TRUE); m_SliHue.SetRange(-180, 180, true); m_SliHue.SetTic(0); m_SliHue.SetPos(m_iHue); m_SliSaturation.EnableWindow(TRUE); m_SliSaturation.SetRange(-100, 100, true); m_SliSaturation.SetTic(0); m_SliSaturation.SetPos(m_iSaturation); if (AfxGetMyApp()->IsIniValid()) { m_ExportKeys.EnableWindow(FALSE); } m_iBrightness ? m_sBrightness.Format(_T("%+d"), m_iBrightness) : m_sBrightness = _T("0"); m_iContrast ? m_sContrast.Format(_T("%+d"), m_iContrast) : m_sContrast = _T("0"); m_iHue ? m_sHue.Format(_T("%+d"), m_iHue) : m_sHue = _T("0"); m_iSaturation ? m_sSaturation.Format(_T("%+d"), m_iSaturation) : m_sSaturation = _T("0"); m_nUpdaterAutoCheck = s.nUpdaterAutoCheck; m_nUpdaterDelay = s.nUpdaterDelay; m_updaterDelaySpin.SetRange32(1, 365); UpdateData(FALSE); return TRUE; }
void CPPageMisc::OnExportSettings() { if (GetParent()->GetDlgItem(ID_APPLY_NOW)->IsWindowEnabled()) { int ret = MessageBox(ResStr(IDS_EXPORT_SETTINGS_WARNING), ResStr(IDS_EXPORT_SETTINGS), MB_ICONEXCLAMATION | MB_YESNOCANCEL); if (ret == IDCANCEL) { return; } else if (ret == IDYES) { GetParent()->PostMessage(PSM_APPLY); } } CString ext = AfxGetMyApp()->IsIniValid() ? _T("ini") : _T("reg"); CFileDialog fileSaveDialog(FALSE, ext, _T("mpc-hc-settings.") + ext); if (fileSaveDialog.DoModal() == IDOK) { if (AfxGetMyApp()->ExportSettings(fileSaveDialog.GetPathName())) { MessageBox(ResStr(IDS_EXPORT_SETTINGS_SUCCESS), ResStr(IDS_EXPORT_SETTINGS), MB_ICONINFORMATION | MB_OK); } else { MessageBox(ResStr(IDS_EXPORT_SETTINGS_FAILED), ResStr(IDS_EXPORT_SETTINGS), MB_ICONERROR | MB_OK); } } }
void CPPageMisc::OnBnClickedReset() { m_iBrightness = AfxGetMyApp()->GetColorControl(ProcAmp_Brightness)->DefaultValue; m_iContrast = AfxGetMyApp()->GetColorControl(ProcAmp_Contrast)->DefaultValue; m_iHue = AfxGetMyApp()->GetColorControl(ProcAmp_Hue)->DefaultValue; m_iSaturation = AfxGetMyApp()->GetColorControl(ProcAmp_Saturation)->DefaultValue; m_SliBrightness.SetPos(m_iBrightness); m_SliContrast.SetPos(m_iContrast); m_SliHue.SetPos(m_iHue); m_SliSaturation.SetPos(m_iSaturation); m_iBrightness ? m_sBrightness.Format(_T("%+d"), m_iBrightness) : m_sBrightness = _T("0"); m_iContrast ? m_sContrast.Format(_T("%+d"), m_iContrast) : m_sContrast = _T("0"); m_iHue ? m_sHue.Format(_T("%+d"), m_iHue) : m_sHue = _T("0"); m_iSaturation ? m_sSaturation.Format(_T("%+d"), m_iSaturation) : m_sSaturation = _T("0"); ((CMainFrame*)AfxGetMyApp()->GetMainWnd())->SetColorControl(ProcAmp_All, m_iBrightness, m_iContrast, m_iHue, m_iSaturation); UpdateData(FALSE); SetModified(); }
void CFGFilterLAVVideo::Settings::SaveSettings() { CMPlayerCApp* pApp = AfxGetMyApp(); ASSERT(pApp); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("TrayIcon"), bTrayIcon); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("StreamAR"), dwStreamAR); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("NumThreads"), dwNumThreads); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("DeintFieldOrder"), dwDeintFieldOrder); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("DeintMode"), deintMode); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("RGBRange"), dwRGBRange); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("SWDeintMode"), dwSWDeintMode); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("SWDeintOutput"), dwSWDeintOutput); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("DitherMode"), dwDitherMode); for (int i = 0; i < LAVOutPixFmt_NB; ++i) { pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO_OUTPUTFORMAT, pixFmtSettingsMap[i], bPixFmts[i]); } pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("HWAccel"), dwHWAccel); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("h264"), bHWFormats[HWCodec_H264]); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("vc1"), bHWFormats[HWCodec_VC1]); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("mpeg2"), bHWFormats[HWCodec_MPEG2]); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("mpeg4"), bHWFormats[HWCodec_MPEG4]); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("dvd"), bHWFormats[HWCodec_MPEG2DVD]); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("hevc"), bHWFormats[HWCodec_HEVC]); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("HWResFlags"), dwHWAccelResFlags); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("HWDeintMode"), dwHWDeintMode); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("HWDeintOutput"), dwHWDeintOutput); pApp->WriteProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("HWDeintHQ"), bHWDeintHQ); }
HRESULT CFGFilterLAV::PropertyPageCallback(IBaseFilter* pBF) { CheckPointer(pBF, E_POINTER); CComPropertySheet ps(ResStr(IDS_PROPSHEET_PROPERTIES), AfxGetMyApp()->GetMainWnd()); // Find out which internal filter we are opening the property page for CFGFilterLAV::LAVFILTER_TYPE LAVFilterType = CFGFilterLAV::INVALID; if (!CFGFilterLAV::IsInternalInstance(pBF, &LAVFilterType)) { return E_UNEXPECTED; } HRESULT hr = E_FAIL; if (CComQIPtr<ISpecifyPropertyPages> pSPP = pBF) { ps.AddPages(pSPP, (LAVFilterType != CFGFilterLAV::AUDIO_DECODER) ? 1 : 2); } CComPtr<IPropertyPage> pPP = DEBUG_NEW CInternalPropertyPageTempl<CPinInfoWnd>(nullptr, &hr); ps.AddPage(pPP, pBF); if (ps.GetPageCount() > 1) { ps.DoModal(); if (CComQIPtr<ILAVFSettings> pLAVFSettings = pBF) { CFGFilterLAVSplitterBase::Settings settings; if (settings.GetSettings(pLAVFSettings)) { // Get current settings from LAVSplitter settings.SaveSettings(); // Save them to the registry/ini } } else if (CComQIPtr<ILAVVideoSettings> pLAVVideoSettings = pBF) { CFGFilterLAVVideo::Settings settings; if (settings.GetSettings(pLAVVideoSettings)) { // Get current settings from LAVVideo settings.SaveSettings(); // Save them to the registry/ini } } else if (CComQIPtr<ILAVAudioSettings> pLAVAudioSettings = pBF) { CFGFilterLAVAudio::Settings settings; if (settings.GetSettings(pLAVAudioSettings)) { // Get current settings from LAVAudio settings.SaveSettings(); // Save them to the registry/ini } } hr = S_OK; } return hr; }
void CPlayerPlaylistBar::LoadPlaylist(LPCTSTR filename) { CString base; if (AfxGetMyApp()->GetAppSavePath(base)) { CPath p; p.Combine(base, _T("default.mpcpl")); if (p.FileExists()) { if (AfxGetAppSettings().bRememberPlaylistItems) { ParseMPCPlayList(p); Refresh(); SelectFileInPlaylist(filename); } else { ::DeleteFile(p); } } } }
void CGoToDlg::OnBnClickedOk1() { UpdateData(); int hh, mm, ss, ms; hh = mm = ss = ms = 0; CAtlRegExp<> re; REParseError status = re.Parse(_T("{\\z}"), FALSE); if(REPARSE_ERROR_OK == status) { CAtlREMatchContext<> mc; const CAtlREMatchContext<>::RECHAR* s = m_timestr.GetBuffer(); const CAtlREMatchContext<>::RECHAR* e = NULL; while(s && re.Match(s, &mc, &e)) { const CAtlREMatchContext<>::RECHAR* szStart = 0; const CAtlREMatchContext<>::RECHAR* szEnd = 0; mc.GetMatch(0, &szStart, &szEnd); if(hh != 0 || hh > 59 || mm > 59 || ss > 59) { AfxMessageBox(_T("Error parsing entered time!")); return; } hh = mm; mm = ss; ss = ms; ms = _tcstol(szStart, (TCHAR**)&szStart, 10); s = e; } m_time = ((hh*60+mm)*60+ss)*1000+ms; AfxGetMyApp()->WriteProfileInt(ResStr(IDS_R_SETTINGS), _T("gotoluf"), 0); OnOK(); } }
BOOL CPPageDVD::OnApply() { UpdateData(); AppSettings& s = AfxGetAppSettings(); s.strDVDPath = m_dvdpath; s.fUseDVDPath = (m_iDVDLocation == 1); s.idMenuLang = m_idMenuLang; s.idAudioLang = m_idAudioLang; s.idSubtitlesLang = m_idSubtitlesLang; s.fAutoSpeakerConf = !!m_fAutoSpeakerConf; s.fClosedCaptions = !!m_fClosedCaptions; s.fStartMainTitle = !!m_fStartMainTitle; s.fmadVRchange = !!m_fmadVRchange; ((CMainFrame*)AfxGetMyApp()->GetMainWnd())->SetClosedCaptions(s.fClosedCaptions); return __super::OnApply(); }
void CPlayerPlaylistBar::SavePlaylist() { CString base; if (AfxGetMyApp()->GetAppSavePath(base)) { CPath p; p.Combine(base, _T("default.mpcpl")); if (AfxGetAppSettings().bRememberPlaylistItems) { // Only create this folder when needed if (!::PathFileExists(base)) { ::CreateDirectory(base, NULL); } SaveMPCPlayList(p, CTextFile::UTF8, false); } else if (p.FileExists()) { ::DeleteFile(p); } } }
CPPageFormats::CPPageFormats() : m_exts(_T("")) , m_iRtspHandler(0) , m_fRtspFileExtFirst(FALSE) , m_bInsufficientPrivileges(FALSE) { if (AfxGetMyApp()->IsVista() && !IsUserAnAdmin()) { m_bInsufficientPrivileges = true; } //TODO: detetc language setting and change g_strRegisteredAppName g_strRegisteredKey AppSettings& s = AfxGetAppSettings(); if(!s.bIsChineseUIUser()){ g_strRegisteredAppName = _T("SPlayer") ; g_strRegisteredKey = _T("Software\\Clients\\Media\\SPlayer\\Capabilities"); } }
bool CPlayerToolBar::LoadExternalToolBar(CImage* image) { // Paths and extensions to try (by order of preference) std::vector<CString> paths({ PathUtils::GetProgramPath() }); CString appDataPath; if (AfxGetMyApp()->GetAppDataPath(appDataPath)) { paths.emplace_back(appDataPath); } const std::vector<CString> extensions({ _T("png"), _T("bmp") }); // Try loading the external toolbar for (const auto& path : paths) { for (const auto& ext : extensions) { if (SUCCEEDED(image->Load(PathUtils::CombinePaths(path, _T("toolbar.") + ext)))) { return true; } } } return false; }
BOOL CPPagePlayer::OnInitDialog() { __super::OnInitDialog(); SetHandCursor(m_hWnd, IDC_COMBO1); AppSettings& s = AfxGetAppSettings(); m_iMultipleInst = s.iMultipleInst; m_iTitleBarTextStyle = s.iTitleBarTextStyle; m_bTitleBarTextTitle = s.fTitleBarTextTitle; m_fTrayIcon = s.fTrayIcon; m_fRememberWindowPos = s.fRememberWindowPos; m_fRememberWindowSize = s.fRememberWindowSize; m_fSavePnSZoom = s.fSavePnSZoom; m_fSnapToDesktopEdges = s.fSnapToDesktopEdges; m_fUseIni = AfxGetMyApp()->IsIniValid(); m_fKeepHistory = s.fKeepHistory; m_fHideCDROMsSubMenu = s.fHideCDROMsSubMenu; m_bPriority = s.dwPriority != NORMAL_PRIORITY_CLASS; m_fShowOSD = s.fShowOSD; m_fRememberDVDPos = s.fRememberDVDPos; m_fRememberFilePos = s.fRememberFilePos; m_fLimitWindowProportions = s.fLimitWindowProportions; m_bRememberPlaylistItems = s.bRememberPlaylistItems; m_nRecentFiles = s.iRecentFilesNumber; m_RecentFilesCtrl.SetRange(MIN_RECENT_FILES, MAX_RECENT_FILES); m_RecentFilesCtrl.SetPos(m_nRecentFiles); UDACCEL acc = {0, 5}; m_RecentFilesCtrl.SetAccel(1, &acc); UpdateData(FALSE); GetDlgItem(IDC_FILE_POS)->EnableWindow(s.fKeepHistory); GetDlgItem(IDC_DVD_POS)->EnableWindow(s.fKeepHistory); m_RecentFilesCtrl.EnableWindow(s.fKeepHistory); return TRUE; }
void CShaderEditorDlg::OnBnClickedButton2() { if (!m_pShader) { return; } if (IDYES != AfxMessageBox(ResStr(IDS_SHADEREDITORDLG_0), MB_YESNO)) { return; } AppSettings& s = AfxGetAppSettings(); for (POSITION pos = s.m_shaders.GetHeadPosition(); pos; s.m_shaders.GetNext(pos)) { if (m_pShader == &s.m_shaders.GetAt(pos)) { CString strShaderPath; if (AfxGetMyApp()->GetAppSavePath(strShaderPath)) { strShaderPath += _T("\\Shaders\\") + m_pShader->label + _T(".psh"); DeleteFile(strShaderPath); } m_pShader = NULL; s.m_shaders.RemoveAt(pos); int i = m_labels.GetCurSel(); if (i >= 0) { m_labels.DeleteString(i); } m_labels.SetWindowText(_T("")); m_targets.SetWindowText(_T("")); m_srcdata.SetWindowText(_T("")); m_output.SetWindowText(_T("")); ((CMainFrame*)AfxGetMainWnd())->UpdateShaders(_T("")); break; } } }
bool CPlayerToolBar::LoadExternalToolBar(CImage* image) { bool success = true; CString path = GetProgramPath(); // Try to load an external PNG toolbar first if (FAILED(image->Load(path + _T("toolbar.png")))) { // If it fails, try to load an external BMP toolbar if (FAILED(image->Load(path + _T("toolbar.bmp")))) { if (AfxGetMyApp()->GetAppDataPath(path)) { // Try to load logo from AppData path if (FAILED(image->Load(path + _T("\\toolbar.png")))) { if (FAILED(image->Load(path + _T("\\toolbar.bmp")))) { success = false; } } } else { success = false; } } } return success; }
bool CPPageFormats::RegisterExt(CString ext, bool fRegister, CString PerceivedType) { CRegKey key; bool bSetValue; CString strProgID = _T("SPlayer") + ext; CString strLabel = _T(""); if(ext == _T(".rar")){ return true; } if(fRegister){ //为保证成功注册清理垃圾 //AfxGetMyApp()->DelRegTree(HKEY_CLASSES_ROOT, ext); AfxGetMyApp()->DelRegTree(HKEY_CLASSES_ROOT, _T("KMPlayer") + ext); AfxGetMyApp()->DelRegTree(HKEY_CLASSES_ROOT, _T("QQPlayer") + ext); AfxGetMyApp()->DelRegTree(HKEY_CLASSES_ROOT, _T("stormplayer") + ext); AfxGetMyApp()->DelRegTree(HKEY_CLASSES_ROOT, _T("RealPlayer") + ext+L".6"); AfxGetMyApp()->DelRegTree(HKEY_CLASSES_ROOT, _T("RealPlayer") + ext+L".10"); AfxGetMyApp()->DelRegTree(HKEY_CLASSES_ROOT, _T("Xmp") + ext); } CString path, fn, cmd; if(!MakeRegParams(ext, path, fn, strLabel, cmd)) return(false); strLabel = GetFileTypeName(ext); if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, ext)) return(false); if (!PerceivedType.IsEmpty()) { key.SetStringValue (L"PerceivedType", PerceivedType); } BOOL bIsRAR = (ext.Right(3).MakeLower() == _T("rar")); if (bIsRAR) return true; if(!fRegister && !bIsRAR) { if(fRegister != IsRegistered(ext)) SetFileAssociation (ext, strProgID, fRegister); key.Attach(HKEY_CLASSES_ROOT); key.RecurseDeleteKey(strProgID); return(true); } bSetValue = fRegister || (ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open\\command"), KEY_READ)); // Create ProgID for this file type if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID)) return(false); if(ERROR_SUCCESS != key.SetStringValue(NULL, strLabel)) return(false); // Add to playlist option if(f_setContextFiles || bIsRAR) { if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\enqueue"))) return(false); if(ERROR_SUCCESS != key.SetStringValue(NULL, ResStr(IDS_ADD_TO_PLAYLIST))) return(false); if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\enqueue\\command"))) return(false); if(bSetValue && (ERROR_SUCCESS != key.SetStringValue(NULL, GetEnqueueCommand()))) return(false); } else { key.Attach(HKEY_CLASSES_ROOT); key.RecurseDeleteKey(strProgID + _T("\\shell\\enqueue")); } // Play option if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open"))) return(false); if(f_setContextFiles || bIsRAR) { if(ERROR_SUCCESS != key.SetStringValue(NULL, ResStr(IDS_OPEN_WITH_MPC))) return(false); } else { if(ERROR_SUCCESS != key.SetStringValue(NULL, _T(""))) return(false); } if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\open\\command"))) return(false); if(bSetValue && (ERROR_SUCCESS != key.SetStringValue(NULL, GetOpenCommand()))) return(false); // Play option if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\openewnd"))) return(false); if(f_setContextFiles || bIsRAR) { if(ERROR_SUCCESS != key.SetStringValue(NULL, ResStr(IDS_OPEN_WITH_MPC_IN_NEW_WND))) return(false); } else { if(ERROR_SUCCESS != key.SetStringValue(NULL, _T(""))) return(false); } if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\shell\\openewnd\\command"))) return(false); if(bSetValue && (ERROR_SUCCESS != key.SetStringValue(NULL, GetOpenCommand(true)))) return(false); if(ERROR_SUCCESS != key.Create(HKEY_LOCAL_MACHINE, g_strRegisteredKey + _T("\\FileAssociations"))) return(false); if(ERROR_SUCCESS != key.SetStringValue(ext, strProgID)) return(false); if(f_setAssociatedWithIcon && !bIsRAR) { CString AppIcon = GetFileIcon(ext); TCHAR buff[MAX_PATH]; if((AppIcon.IsEmpty()) && (::GetModuleFileName(AfxGetInstanceHandle(), buff, MAX_PATH))) { AppIcon = buff; AppIcon = "\""+AppIcon+"\""; AppIcon += _T(",0"); } if(ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\DefaultIcon"))) return(false); if(bSetValue && (ERROR_SUCCESS != key.SetStringValue(NULL, AppIcon))) return(false); } else { key.Attach(HKEY_CLASSES_ROOT); key.RecurseDeleteKey(strProgID + _T("\\DefaultIcon")); } if (fRegister && !bIsRAR) SetFileAssociation(ext, strProgID, fRegister); return(true); }
LONG WINAPI CMiniDump::UnhandledExceptionFilter(_EXCEPTION_POINTERS* lpTopLevelExceptionFilter) { LONG retval = EXCEPTION_CONTINUE_SEARCH; HMODULE hDll = NULL; TCHAR szResult[800]; szResult[0] = _T('\0'); CString strDumpPath; if (!m_bMiniDumpEnabled) { return retval; } #ifndef DISABLE_MINIDUMP hDll = ::LoadLibrary(_T("dbghelp.dll")); if (hDll != NULL) { MINIDUMPWRITEDUMP pMiniDumpWriteDump = (MINIDUMPWRITEDUMP)::GetProcAddress(hDll, "MiniDumpWriteDump"); if (pMiniDumpWriteDump != NULL) { if (!AfxGetMyApp()->IsIniValid()) { HRESULT hr = SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, strDumpPath.GetBuffer(MAX_PATH)); if (FAILED(hr)) { FreeLibrary(hDll); return retval; } strDumpPath.ReleaseBuffer(); strDumpPath.Append(_T("\\Media Player Classic\\")); strDumpPath.Append(AfxGetApp()->m_pszExeName); strDumpPath.Append(_T(".exe")); } else { strDumpPath = GetProgramPath(true); } strDumpPath.AppendFormat(_T(".%d.%d.%d.%d.dmp"), MPC_VERSION_NUM); // create the file HANDLE hFile = ::CreateFile(strDumpPath, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile != INVALID_HANDLE_VALUE) { _MINIDUMP_EXCEPTION_INFORMATION ExInfo; ExInfo.ThreadId = ::GetCurrentThreadId(); ExInfo.ExceptionPointers = lpTopLevelExceptionFilter; ExInfo.ClientPointers = NULL; // write the dump BOOL bOK = pMiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, MiniDumpNormal, &ExInfo, NULL, NULL); if (bOK) { _stprintf_s(szResult, _countof(szResult), ResStr(IDS_MPC_CRASH), strDumpPath); retval = EXCEPTION_EXECUTE_HANDLER; } else { _stprintf_s(szResult, _countof(szResult), ResStr(IDS_MPC_MINIDUMP_FAIL), strDumpPath, GetLastError()); } ::CloseHandle(hFile); } else { _stprintf_s(szResult, _countof(szResult), ResStr(IDS_MPC_MINIDUMP_FAIL), strDumpPath, GetLastError()); } } FreeLibrary(hDll); } if (szResult[0]) { switch (MessageBox(NULL, szResult, _T("MPC-HC - Mini Dump"), retval ? MB_YESNO : MB_OK)) { case IDYES: ShellExecute(NULL, _T("open"), BUGS_URL, NULL, NULL, SW_SHOWDEFAULT); ExploreToFile(strDumpPath); break; case IDNO: retval = EXCEPTION_CONTINUE_SEARCH; // rethrow the exception to make easier attaching a debugger break; } } #else if (MessageBox(NULL, ResStr(IDS_MPC_BUG_REPORT), ResStr(IDS_MPC_BUG_REPORT_TITLE), MB_YESNO) == IDYES) { ShellExecute(NULL, _T("open"), DOWNLOAD_URL, NULL, NULL, SW_SHOWDEFAULT); } #endif // DISABLE_MINIDUMP return retval; }
void CMediaFormats::UpdateData(bool fSave) { if(fSave) { AfxGetMyApp()->WriteProfileString(_T("FileFormats"), NULL, NULL); AfxGetMyApp()->WriteProfileInt(_T("FileFormats"), _T("RtspHandler"), m_iRtspHandler); AfxGetMyApp()->WriteProfileInt(_T("FileFormats"), _T("RtspFileExtFirst"), m_fRtspFileExtFirst); } else { RemoveAll(); #define ADDFMT(f) Add(CMediaFormatCategory##f) ADDFMT((_T("Windows Media file"), _T("wmv wmp wm asf"), _T("video"), IDI_VIDEO)); ADDFMT((_T("Windows Media Audio file"), _T("wma"), _T("audio"), IDI_AUDIO_FILE, true)); ADDFMT((_T("Video file"), _T("avi"), _T("video"), IDI_VIDEO)); ADDFMT((_T("Audio file"), _T("wav"), _T("audio"), IDI_AUDIO_FILE, true)); ADDFMT((_T("MPEG Media file"), _T("mpg mpeg mpe m1v m2v mpv2 mp2v mod"), _T("video"), IDI_VIDEO)); ADDFMT((_T("VCD MPEG Data file"), _T("dat"), _T("video"), IDI_VIDEO,-1)); ADDFMT((_T("Collegesoft Media file"), _T("csf"), _T("video"), IDI_VIDEO)); ADDFMT((_T("MPEG Transport-Stream file"), _T("ts tp tpr pva pss m2ts m2t mts evo m2p"), _T("video"), IDI_HD)); ADDFMT((_T("MPEG Audio file"), _T("mpa mp2 m1a m2a"), _T("audio"), IDI_AUDIO_FILE, true)); ADDFMT((_T("VP8 Webm file"), _T("webm"), _T("video"), IDI_HD)); ADDFMT((_T("DVD file"), _T("vob ifo"), _T("video"), IDI_VIDEO)); ADDFMT((_T("DVD Audio file"), _T("ac3 dts"), _T("audio"), IDI_AUDIO_FILE, true)); ADDFMT((_T("MP3 Format Sound"), _T("mp3"), _T("audio"), IDI_AUDIO_FILE, true)); ADDFMT((_T("MIDI file"), _T("mid midi rmi"), _T("audio"), IDI_AUDIO_FILE, true)); ADDFMT((_T("Indeo Video file"), _T("ivf"), _T("video"), IDI_VIDEO)); ADDFMT((_T("AIFF Format Sound"), _T("aif aifc aiff"), _T("audio"), IDI_AUDIO_FILE, true)); ADDFMT((_T("Monkey's Audio APE File"), _T("ape"), _T("audio"), IDI_AUDIO_FILE, true)); ADDFMT((_T("AU Format Sound"), _T("au snd"), _T("audio"), IDI_AUDIO_FILE, true)); ADDFMT((_T("Ogg Media file"), _T("ogm ogv"), _T("video"), IDI_VIDEO)); ADDFMT((_T("Ogg Vorbis Audio file"), _T("ogg"), _T("audio"), IDI_AUDIO_FILE, true)); ADDFMT((_T("WavPack Audio file"), _T("wv wvc"), _T("audio"), IDI_AUDIO_FILE, true)); ADDFMT((_T("CD Audio Track"), _T("cda"), _T("audio"), IDI_AUDIO_FILE, true, _T("Windows 2000/XP or better"))); ADDFMT((_T("FLIC file"), _T("fli flc flic"), _T("audio"), IDI_AUDIO_FILE)); ADDFMT((_T("DVD2AVI Project file"), _T("d2v"), _T("video"), IDI_VIDEO)); ADDFMT((_T("MPEG4 file"), _T("mp4 m4v hdmov"), _T("video"), IDI_VIDEO)); ADDFMT((_T("Mobile Phone file"), _T("3gp 3gpp"), _T("video"), IDI_VIDEO)); ADDFMT((_T("MPEG4 Audio file"), _T("m4a m4b aac"), _T("video"), IDI_VIDEO, true)); ADDFMT((_T("Matroska Media file"), _T("mkv"), _T("video"), IDI_HD)); ADDFMT((_T("Matroska Audio file"), _T("mka"), _T("audio"), IDI_AUDIO_FILE, true)); ADDFMT((_T("PSP/PMP Media file"), _T("pmp"), _T("video"), IDI_VIDEO, false)); ADDFMT((_T("Smacker/Bink Media file"), _T("smk bik"), _T("video"), IDI_VIDEO, false, _T("smackw32/binkw32.dll in dll path"))); ADDFMT((_T("ratdvd file"), _T("ratdvd"), _T("video"), IDI_VIDEO, false, _T("ratdvd media file"))); ADDFMT((_T("RoQ Media file"), _T("roq"), _T("video"), IDI_VIDEO, false)); ADDFMT((_T("Real Media file"), _T("rm rmvb ram rpm rmm"), _T("video"), IDI_VIDEO, false, _T("RealPlayer or Real Alternative") )); //RealMedia ADDFMT((_T("Real Audio file"), _T("ra"), _T("audio"), IDI_AUDIO_FILE, true, _T("RealPlayer or Real Alternative"))); // RealMedia ADDFMT((_T("Real Script file"), _T("rt rp smi smil"), _T("video"), IDI_VIDEO, false, _T("RealPlayer or Real Alternative"))); // RealMedia ADDFMT((_T("Dirac Video file"), _T("drc"), _T("video"), IDI_VIDEO, false)); ADDFMT((_T("DirectShow Media file"), _T("dsm dsv dsa dss"), _T("video"), IDI_VIDEO)); ADDFMT((_T("Musepack file"), _T("mpc"), _T("video"), IDI_VIDEO, true)); ADDFMT((_T("FLAC Audio file"), _T("flac"), _T("audio"), IDI_AUDIO_FILE, true)); ADDFMT((_T("ALAC Audio file"), _T("alac"), _T("audio"), IDI_AUDIO_FILE, true)); ADDFMT((_T("Flash Video file"), _T("flv iflv f4v hlv"), _T("video"), IDI_VIDEO)); ADDFMT((_T("Shockwave Flash file"), _T("swf"), _T("video"), IDI_VIDEO, -1, _T("ShockWave ActiveX control"), ShockWave)); ADDFMT((_T("Shockwave Audio file"), _T("swa"), _T("audio"), IDI_AUDIO_FILE, true, _T("ShockWave ActiveX control"), ShockWave)); ADDFMT((_T("Quicktime file"), _T("mov qt amr 3g2 3gp2"), _T("video"), IDI_VIDEO, false, _T("QuickTime or codec pack")));//QuickTime ADDFMT((_T("IVM file"), _T("ivm"), _T("video"), IDI_VIDEO, false)); ADDFMT((_T("Image file"), _T("jpeg jpg bmp gif pic dib tiff tif"), _T("image") ,0, -2)); //png not supported ADDFMT((_T("Playlist file"), _T("asx m3u pls wvx wax wmx mpcpl cue mpls bdmv"), _T("Application"), IDI_PLAYLIST)); ADDFMT((_T("Rar Playlist file"), _T("rar"), _T("Application"), 0, -1)); ADDFMT((_T("Subtitle file"), _T("srt idx sub ssa ass xss usf"), _T("text"), IDI_SUBTITLE_FILE )); ADDFMT((_T("Other"), _T("divx vp6 amv"), _T("video"), IDI_VIDEO)); #undef ADDFMT m_iRtspHandler = (engine_t)AfxGetMyApp()->GetProfileInt(_T("FileFormats"), _T("RtspHandler"), (int)DirectShow); //RealMedia m_fRtspFileExtFirst = !!AfxGetMyApp()->GetProfileInt(_T("FileFormats"), _T("RtspFileExtFirst"), 1); } //for(int i = 0; i < GetCount(); i++) // GetAt(i).UpdateData(fSave); }
HRESULT WINAPI Mine_CoCreateInstance(IN REFCLSID rclsid, IN LPUNKNOWN pUnkOuter, IN DWORD dwClsContext, IN REFIID riid, OUT LPVOID FAR* ppv) { if(CFilterMapper2::m_pFilterMapper2) { CheckPointer(ppv, E_POINTER); if(rclsid == CLSID_FilterMapper) { TRACE_SVP5(_T("Mine_CoCreateInstance Unknown REGDB_E_CLASSNOTREG ") ); ASSERT(0); return REGDB_E_CLASSNOTREG; // sorry... } if(rclsid == CLSID_FilterMapper2) { if(pUnkOuter) { TRACE_SVP5(_T("Mine_CoCreateInstance Unknown CLASS_E_NOAGGREGATION ") ); return CLASS_E_NOAGGREGATION; } if(riid == __uuidof(IUnknown)) { CFilterMapper2::m_pFilterMapper2->AddRef(); *ppv = (IUnknown*)CFilterMapper2::m_pFilterMapper2; return S_OK; } else if(riid == __uuidof(IFilterMapper2)) { CFilterMapper2::m_pFilterMapper2->AddRef(); *ppv = (IFilterMapper2*)CFilterMapper2::m_pFilterMapper2; return S_OK; } else { TRACE_SVP5(_T("Mine_CoCreateInstance Unknown riid %s"), CStringFromGUID(riid) ); return E_NOINTERFACE; } } TRACE_SVP5(_T("Mine_CoCreateInstance Unknown %s"), CStringFromGUID(rclsid)); } if(!pUnkOuter) if(rclsid == CLSID_VideoMixingRenderer || rclsid == CLSID_VideoMixingRenderer9 || rclsid == CLSID_VideoRenderer || rclsid == CLSID_VideoRendererDefault || rclsid == CLSID_OverlayMixer)// || rclsid == CLSID_OverlayMixer2 - where is this declared?) { CMacrovisionKicker* pMK = new CMacrovisionKicker(NAME("CMacrovisionKicker"), NULL); CComPtr<IUnknown> pUnk = (IUnknown*)(INonDelegatingUnknown*)pMK; CComPtr<IUnknown> pInner; HRESULT hr; if(SUCCEEDED(hr = Real_CoCreateInstance(rclsid, pUnk, dwClsContext, __uuidof(IUnknown), (void**)&pInner))) { pMK->SetInner(pInner); return pUnk->QueryInterface(riid, ppv); } } TRACE_SVP5(_T("Mine_CoCreateInstance %s"), CStringFromGUID(rclsid) ); long ret = E_FAIL; CSVPToolBox svpTool; // TODO: more effective way to do this // maybe set a static array/map of GUID and dll files if (GUIDFromCString(_T("{083863F1-70DE-11D0-BD40-00A0C911CE86}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"haalis.ax"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{31345649-0000-0010-8000-00AA00389B71}")) == rclsid || GUIDFromCString(_T("{87CA6F02-49E4-11CF-A3FE-00AA003735BE}")) == rclsid || GUIDFromCString(_T("{BD323430-CE94-11CE-82DD-0800095A5B55}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"ir41_32.ax"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{1F73E9B1-8C3A-11D0-A3BE-00A0C9244436}")) == rclsid || GUIDFromCString(_T("{665A4448-D905-11D0-A30E-444553540000}")) == rclsid || GUIDFromCString(_T("{665A4443-D905-11D0-A30E-444553540000}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"ir50_32.dll"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{DB43B405-43AA-4f01-82D8-D84D47E6019C}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"ogm.dll"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{B841F346-4835-4de8-AA5E-2E7CD2D4C435}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"ts.dll"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{B3DE7EDC-0CD4-4d07-B1C5-92219CD475CC}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"mp4.dll"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{53D9DE0B-FC61-4650-9773-74D13CC7E582}")) == rclsid || GUIDFromCString(_T("{64F2005C-6CF5-4652-B94F-600360B15B27}")) == rclsid || GUIDFromCString(_T("{BD4FB4BE-809D-487b-ADD6-F7D164247E52}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"mkx.dll"), rclsid, riid, ppv); else if (GUIDFromCString(L"{09571A4B-F1FE-4C60-9760-DE6D310C7C31}") == rclsid || GUIDFromCString(L"{F23B1F18-CB1A-47ED-A1FE-B60494A626D0}") == rclsid || GUIDFromCString(L"{BBA35D2A-A374-4CDF-9C5D-BF31DE970B54}") == rclsid || GUIDFromCString(L"{3FD76A83-DAA1-403B-B388-26EFFF652725}") == rclsid || GUIDFromCString(L"{C9783F9D-7E56-4205-9CA1-225CD9349BD7}") == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"codec\cavc2.ax"), rclsid, riid, ppv); else if (GUIDFromCString(L"{ED3110F3-5211-11DF-94AF-0026B977EEAA}") == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"vp8decoder.dll"), rclsid, riid, ppv); // csf else if (GUIDFromCString(_T("{ACD23F8C-B37E-4B2D-BA08-86CB6E621D6A}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"csfcodec\\mpc_mtcontain.dll"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{164A68B6-3F90-47C2-85A7-1E4D8952EF0A}")) == rclsid || GUIDFromCString(_T("{3BB3828F-9787-48A7-A894-6ADE46C64737}")) == rclsid || GUIDFromCString(_T("{BD4FB4BE-809D-487b-ADD6-F7D164247E52}")) == rclsid || GUIDFromCString(_T("{B4DAEDB7-7F0E-434F-9AA3-B82B549A3680}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"csfcodec\\mpc_mtcontrol.dll"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{5BC26A00-5101-47d7-A5DB-AB6AAC44F51B}")) == rclsid || GUIDFromCString(_T("{E5960BC4-A76B-4211-BEEC-9AEE2AF8AAE6}")) == rclsid || GUIDFromCString(_T("{C6291160-8402-45EF-9923-38BBDED6F05E}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"csfcodec\\mpc_mxvideo.dll"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{7E493C9A-2E54-4F25-9B9A-D3C4DEBFCB62}")) == rclsid || GUIDFromCString(_T("{D48D1EB2-BF95-4EE1-BD69-9AD0515F050D}")) == rclsid || GUIDFromCString(_T("{AD92C6E6-997A-4E9E-9D7D-EDED6DE933FB}")) == rclsid) ret = LoadExternalObject(svpTool.GetPlayerPath(L"csfcodec\\mpc_mdssockc.dll"), rclsid, riid, ppv, pUnkOuter); else if (GUIDFromCString(_T("{86708513-5A2E-424F-AB46-F4BE3F82954F}")) == rclsid || GUIDFromCString(_T("{341873D2-646D-4EE7-ACBE-ECF2E927BEBD}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"csfcodec\\mpc_mxaudio.dll"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{87BBB4ED-1767-4B7E-821C-7C4657E439D4}")) == rclsid || GUIDFromCString(_T("{32E2BDD6-8812-42C3-A907-B9587C148EE3}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"csfcodec\\mpc_mxscreen.dll"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{2627A1B6-F8FF-4E9C-9422-4908E8D1DFE9}")) == rclsid || GUIDFromCString(_T("{3FD0479E-D6B9-4629-9496-509D3D070918}")) == rclsid || GUIDFromCString(_T("{99AA8908-FC7F-4815-B023-3BC2F5F8D372}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"csfcodec\\mpc_mxshbasu.dll"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{03D82D06-49E2-4E37-9670-BCAB4DBC642D}")) == rclsid || GUIDFromCString(_T("{7B6F8B69-0925-48F1-AE78-7506D6C3972C}")) == rclsid || GUIDFromCString(_T("{B7BCE5B0-2112-420A-BDFF-178995FBFCA2}")) == rclsid || GUIDFromCString(_T("{BB9CDE7F-AF28-4205-9B3C-789FA7D0F29F}")) == rclsid || GUIDFromCString(_T("{C1630673-8C58-481C-9F15-83F11D8B89F0}")) == rclsid || GUIDFromCString(_T("{C7E094E1-A326-4E33-824D-6598D399DA13}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"csfcodec\\mpc_mxshmaiu.dll"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{96CE7B0D-06B3-42E2-8DB7-CFC6CF0121F6}")) == rclsid || GUIDFromCString(_T("{E4C3B74F-0C02-4D4E-B932-F7A1889B3ABB}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"csfcodec\\mpc_mxshsour.dll"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{B5A7D70F-AE96-4F83-B811-572CA3529323}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"csfcodec\\mpc_mcucltu.dll"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{0C56B154-43F7-48A0-87B2-E9ACC8E1E471}")) == rclsid || GUIDFromCString(_T("{46E00789-37CA-4278-8907-02088898B6B0}")) == rclsid || GUIDFromCString(_T("{BAC04407-3588-42AA-93BE-6D3720E9FB28}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"csfcodec\\mpc_mcufilecu.dll"), rclsid, riid, ppv); else if (GUIDFromCString(_T("{212CA6D1-E9BB-41cf-BF77-06E000F403A8}")) == rclsid || GUIDFromCString(_T("{57A5353F-2725-440c-BBBC-DB20A1C8A57D}")) == rclsid || GUIDFromCString(_T("{A94662D1-35FD-43d1-BDA3-172CE4D5C236}")) == rclsid || GUIDFromCString(_T("{D0430FE6-1621-41e4-A109-CA5B0C57FE1D}")) == rclsid || GUIDFromCString(_T("{D2598A88-4035-4556-84A2-B0F76A544E92}")) == rclsid || GUIDFromCString(_T("{D6D61C19-8563-4e8e-B755-0589DA6A3077}")) == rclsid || GUIDFromCString(_T("{E9203D3F-6404-40aa-99CC-5267215B81A7}")) == rclsid || GUIDFromCString(_T("{ECCBA771-92F2-497b-98AA-5FAA0BAA2DF6}")) == rclsid) ret = LoadExternalObject( svpTool.GetPlayerPath(L"csfcodec\\mpc_wtlvcl.dll"), rclsid, riid, ppv); // csf end */ else if (GUIDFromCString(_T("{2EEB4ADF-4578-4D10-BCA7-BB955F56320A}")) == rclsid && !AfxGetMyApp()->IsVista() && !svpTool.FindSystemFile(L"wmadmod.dll")) ret = LoadExternalObject( svpTool.GetPlayerPath(L"wmadmod.dll"), rclsid, riid, ppv); if (pUnkOuter) Logging(L"Fake_CoCreateInstance %x %x %x %s %s", ret, pUnkOuter, ppv, CStringFromGUID(rclsid), CStringFromGUID(riid)); try { if (FAILED(ret)) ret = Real_CoCreateInstance(rclsid, pUnkOuter, dwClsContext, riid, ppv); } catch (...) {return E_FAIL;}; return ret; }
BOOL CPlayerToolBar::OnTtnNeedText(UINT id, NMHDR *pNMHDR, LRESULT *pResult) { UNREFERENCED_PARAMETER(id); TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR; UINT_PTR nID = pNMHDR->idFrom; BOOL bRet = FALSE; // idFrom is actually the HWND of the tool static CString toolTip; switch(nID){ case ID_SUBDELAYDEC: toolTip = ResStr(IDS_TOOLTIP_SUBTITLE_DELAY_REDUCE); break; case ID_SUBDELAYINC: toolTip = ResStr(IDS_TOOLTIP_SUBTITLE_DELAY_INCREASE); break; case ID_SUBTOOLBARBUTTON: toolTip = ResStr(IDS_TOOLTIP_TOOLBAR_SUBTITLE_BUTTON); break; case ID_VIEW_PLAYLIST: toolTip = ResStr(IDS_TOOLTIP_TOOLBAR_BUTTON_PLAYLIST); break; case ID_VIEW_OPTIONS: toolTip = ResStr(IDS_TOOLTIP_TOOLBAR_BUTTON_SETTING_PANEL); break; case ID_FILE_SAVE_IMAGE: toolTip = ResStr(IDS_TOOLTIP_TOOLBAR_BUTTON_IMAGE_CAPTURE); break; case ID_FILE_OPENQUICK: toolTip = ResStr(IDS_TOOLTIP_TOOLBAR_BUTTON_FILE_OPEN); break; case ID_SUBSETFONTBOTH: toolTip = ResStr(IDS_TOOLTIP_TOOLBAR_BUTTON_SET_SUB_FONT); break; case ID_SUBFONTUPBOTH: toolTip = ResStr(IDS_TOOLTIP_TOOLBAR_BUTTON_SUB_FONT_INCREASE); break; case ID_SUBFONTDOWNBOTH: toolTip = ResStr(IDS_TOOLTIP_TOOLBAR_BUTTON_SUB_FONT_DECREASE); break; case ID_MOVIESHARE: toolTip = ResStr(IDS_TOOLTIP_TOOLBAR_BUTTON_MOVIESHARE); break; default: toolTip = ResStr(nID); break; } if(AfxGetMyApp()->IsVista() ){ if(!toolTip.IsEmpty()){ pTTT->lpszText = toolTip.GetBuffer(); pTTT->hinst = AfxGetResourceHandle(); bRet = TRUE; } }else{ if(!toolTip.IsEmpty()){ int iN = toolTip.Find(_T("\n")); if(iN > 0){ toolTip = toolTip.Left(iN).Trim(); } CMainFrame* pFrame = ((CMainFrame*)AfxGetMainWnd()); pFrame->m_tip.SetTips(toolTip, TRUE); } } *pResult = 0; return bRet; }
void CFGFilterLAVVideo::Settings::LoadSettings() { CMPlayerCApp* pApp = AfxGetMyApp(); ASSERT(pApp); bTrayIcon = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("TrayIcon"), bTrayIcon); dwStreamAR = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("StreamAR"), dwStreamAR); dwNumThreads = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("NumThreads"), dwNumThreads); dwDeintFieldOrder = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("DeintFieldOrder"), dwDeintFieldOrder); deintMode = (LAVDeintMode)pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("DeintMode"), deintMode); dwRGBRange = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("RGBRange"), dwRGBRange); dwSWDeintMode = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("SWDeintMode"), dwSWDeintMode); dwSWDeintOutput = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("SWDeintOutput"), dwSWDeintOutput); dwDitherMode = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO, _T("DitherMode"), dwDitherMode); for (int i = 0; i < LAVOutPixFmt_NB; ++i) { bPixFmts[i] = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO_OUTPUTFORMAT, pixFmtSettingsMap[i], bPixFmts[i]); } // Force disable, for future use bPixFmts[LAVOutPixFmt_YV16] = FALSE; dwHWAccel = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("HWAccel"), -1); if (dwHWAccel == DWORD(-1)) { dwHWAccel = HWAccel_None; // Ensure that a valid state is selected if no HW acceleration is available // We enable by default DXVA2 native on Vista+ and CUVID on XP if an NVIDIA adapter is found if (SysVersion::IsVistaOrLater()) { dwHWAccel = HWAccel_DXVA2Native; } else { CComPtr<IDirect3D9> pD3D9 = Direct3DCreate9(D3D_SDK_VERSION); if (pD3D9) { D3DADAPTER_IDENTIFIER9 adapterIdentifier; for (UINT adp = 0, num_adp = pD3D9->GetAdapterCount(); adp < num_adp; ++adp) { if (pD3D9->GetAdapterIdentifier(adp, 0, &adapterIdentifier) == S_OK && adapterIdentifier.VendorId == 0x10DE) { dwHWAccel = HWAccel_CUDA; break; } } } } } bHWFormats[HWCodec_H264] = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("h264"), bHWFormats[HWCodec_H264]); bHWFormats[HWCodec_VC1] = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("vc1"), bHWFormats[HWCodec_VC1]); bHWFormats[HWCodec_MPEG2] = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("mpeg2"), bHWFormats[HWCodec_MPEG2]); bHWFormats[HWCodec_MPEG4] = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("mpeg4"), bHWFormats[HWCodec_MPEG4]); bHWFormats[HWCodec_MPEG2DVD] = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("dvd"), bHWFormats[HWCodec_MPEG2DVD]); bHWFormats[HWCodec_HEVC] = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("hevc"), bHWFormats[HWCodec_HEVC]); dwHWAccelResFlags = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("HWResFlags"), dwHWAccelResFlags); dwHWDeintMode = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("HWDeintMode"), dwHWDeintMode); dwHWDeintOutput = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("HWDeintOutput"), dwHWDeintOutput); bHWDeintHQ = pApp->GetProfileInt(IDS_R_INTERNAL_LAVVIDEO_HWACCEL, _T("HWDeintHQ"), bHWDeintHQ); }
LONG WINAPI CMiniDump::UnhandledExceptionFilter(_EXCEPTION_POINTERS* lpTopLevelExceptionFilter) { LONG retval = EXCEPTION_CONTINUE_SEARCH; BOOL bDumpCreated = FALSE; HMODULE hDll = nullptr; TCHAR szResult[800]; szResult[0] = _T('\0'); CPath dumpPath; #if ENABLE_MINIDUMP hDll = ::LoadLibrary(_T("dbghelp.dll")); if (hDll != nullptr) { MINIDUMPWRITEDUMP pMiniDumpWriteDump = (MINIDUMPWRITEDUMP)::GetProcAddress(hDll, "MiniDumpWriteDump"); if (pMiniDumpWriteDump != nullptr && AfxGetMyApp()->GetAppSavePath(dumpPath)) { // Check that the folder actually exists if (!FileExists(dumpPath)) { VERIFY(CreateDirectory(dumpPath, nullptr)); } CString strDumpName = AfxGetApp()->m_pszExeName; strDumpName.Append(_T(".exe.") + VersionInfo::GetVersionString() + _T(".dmp")); dumpPath.Append(strDumpName); // create the file HANDLE hFile = ::CreateFile(dumpPath, GENERIC_WRITE, FILE_SHARE_WRITE, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); if (hFile != INVALID_HANDLE_VALUE) { _MINIDUMP_EXCEPTION_INFORMATION ExInfo; ExInfo.ThreadId = ::GetCurrentThreadId(); ExInfo.ExceptionPointers = lpTopLevelExceptionFilter; ExInfo.ClientPointers = FALSE; // write the dump bDumpCreated = pMiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, MiniDumpNormal, &ExInfo, nullptr, nullptr); if (bDumpCreated) { _stprintf_s(szResult, _countof(szResult), ResStr(IDS_MPC_CRASH), dumpPath); retval = EXCEPTION_EXECUTE_HANDLER; } else { _stprintf_s(szResult, _countof(szResult), ResStr(IDS_MPC_MINIDUMP_FAIL), dumpPath, GetLastError()); } ::CloseHandle(hFile); } else { _stprintf_s(szResult, _countof(szResult), ResStr(IDS_MPC_MINIDUMP_FAIL), dumpPath, GetLastError()); } } FreeLibrary(hDll); } if (szResult[0]) { switch (MessageBox(nullptr, szResult, _T("MPC-HC - Mini Dump"), bDumpCreated ? MB_YESNO : MB_OK)) { case IDYES: ShellExecute(nullptr, _T("open"), BUGS_URL, nullptr, nullptr, SW_SHOWDEFAULT); ExploreToFile(dumpPath); break; case IDNO: retval = EXCEPTION_CONTINUE_SEARCH; // rethrow the exception to make easier attaching a debugger break; } } #else if (MessageBox(nullptr, ResStr(IDS_MPC_BUG_REPORT), ResStr(IDS_MPC_BUG_REPORT_TITLE), MB_YESNO) == IDYES) { ShellExecute(nullptr, _T("open"), DOWNLOAD_URL, nullptr, nullptr, SW_SHOWDEFAULT); } #endif // DISABLE_MINIDUMP return retval; }
BOOL CPPagePlayer::OnApply() { UpdateData(); AppSettings& s = AfxGetAppSettings(); s.iMultipleInst = m_iMultipleInst; s.iTitleBarTextStyle = m_iTitleBarTextStyle; s.fTitleBarTextTitle = !!m_bTitleBarTextTitle; s.fTrayIcon = !!m_fTrayIcon; s.fRememberWindowPos = !!m_fRememberWindowPos; s.fRememberWindowSize = !!m_fRememberWindowSize; s.fSavePnSZoom = !!m_fSavePnSZoom; s.fSnapToDesktopEdges = !!m_fSnapToDesktopEdges; s.fKeepHistory = !!m_fKeepHistory; s.fHideCDROMsSubMenu = !!m_fHideCDROMsSubMenu; s.dwPriority = !m_bPriority ? NORMAL_PRIORITY_CLASS : ABOVE_NORMAL_PRIORITY_CLASS; BOOL bShowOSDChanged = (s.fShowOSD != !!m_fShowOSD); s.fShowOSD = !!m_fShowOSD; if (bShowOSDChanged) { CMainFrame* pFrame = ((CMainFrame*)GetParentFrame()); if (m_fShowOSD) { pFrame->m_OSD.Start(pFrame->m_pOSDWnd); pFrame->OSDBarSetPos(); pFrame->m_OSD.ClearMessage(false); } else { pFrame->m_OSD.Stop(); } } s.fLimitWindowProportions = !!m_fLimitWindowProportions; s.fRememberDVDPos = !!m_fRememberDVDPos; s.fRememberFilePos = !!m_fRememberFilePos; s.bRememberPlaylistItems = !!m_bRememberPlaylistItems; if (!m_fKeepHistory) { for (int i = s.MRU.GetSize() - 1; i >= 0; i--) { s.MRU.Remove(i); } for (int i = s.MRUDub.GetSize() - 1; i >= 0; i--) { s.MRUDub.Remove(i); } s.MRU.WriteList(); s.MRUDub.WriteList(); // Empty the "Recent" jump list CComPtr<IApplicationDestinations> pDests; HRESULT hr = pDests.CoCreateInstance(CLSID_ApplicationDestinations, NULL, CLSCTX_INPROC_SERVER); if (SUCCEEDED(hr)) { hr = pDests->RemoveAllDestinations(); } } if (!m_fKeepHistory || !m_fRememberDVDPos) { s.ClearDVDPositions(); } if (!m_fKeepHistory || !m_fRememberFilePos) { s.ClearFilePositions(); } m_nRecentFiles = min(max(MIN_RECENT_FILES, m_nRecentFiles), MAX_RECENT_FILES); s.iRecentFilesNumber = m_nRecentFiles; s.MRU.SetSize(s.iRecentFilesNumber); s.MRUDub.SetSize(s.iRecentFilesNumber); // Check if the settings location needs to be changed if (AfxGetMyApp()->IsIniValid() != !!m_fUseIni) { AfxGetMyApp()->ChangeSettingsLocation(!!m_fUseIni); } ((CMainFrame*)AfxGetMainWnd())->ShowTrayIcon(s.fTrayIcon); ::SetPriorityClass(::GetCurrentProcess(), s.dwPriority); GetDlgItem(IDC_FILE_POS)->EnableWindow(s.fKeepHistory); GetDlgItem(IDC_DVD_POS)->EnableWindow(s.fKeepHistory); m_RecentFilesCtrl.EnableWindow(s.fKeepHistory); return __super::OnApply(); }
void CPlayerToolBar::OnRButtonUp(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default CMainFrame* pFrame = ((CMainFrame*)AfxGetMainWnd()); KillTimer(TIMER_FASTFORWORD); KillTimer(TIMER_CLOSETOOLBAR); ReleaseCapture(); CRect rc; GetWindowRect(&rc); CPoint xpoint = point + rc.TopLeft() ; UINT ret = m_btnList.OnHitTest(xpoint,rc,false); if( m_btnList.HTRedrawRequired ){ Invalidate(); } m_nItemToTrackR = ret; __super::OnRButtonUp(nFlags, point); if(!pFrame) return; AppSettings& s = AfxGetAppSettings(); if(ID_VOLUME_MUTE == m_nItemToTrackR || m_btnVolBG->m_rcHitest.PtInRect(xpoint)){ pFrame->SetupSVPAudioMenu(); pFrame->OnMenu( &pFrame->m_navaudio ); }else if(!m_nItemToTrackR && s.bUserAeroUI()){ if( s.m_lTransparentToolbarPosOffset == 0 || s.m_lTransparentToolbarPosSavedOffset == s.m_lTransparentToolbarPosOffset ){ pFrame->OnMenu(pFrame->m_popup.GetSubMenu(0)); return; } enum { M_RESET_POS=1 , M_SAVE_POS=2 }; CMenu m; m.CreatePopupMenu(); m.AppendMenu(MF_STRING|MF_ENABLED, M_SAVE_POS, ResStr(IDS_MENU_TIEM_TOOLBAR_SAVE_POS)); m.AppendMenu(MF_STRING|MF_ENABLED, M_RESET_POS, ResStr(IDS_COLOR_CONTROL_BUTTON_RESET)); ClientToScreen(&point); int nID = (int)m.TrackPopupMenu(TPM_LEFTBUTTON|TPM_RETURNCMD, point.x, point.y, this); switch(nID) { case M_RESET_POS: s.m_lTransparentToolbarPosOffset = 0; break; case M_SAVE_POS: break; default: return; break; } AfxGetMyApp()->WriteProfileInt(ResStr(IDS_R_SETTINGS), ResStr(IDS_RS_TRANSPARENTTOOLBARPOSOFFSET)+_T("2"), s.m_lTransparentToolbarPosOffset); s.m_lTransparentToolbarPosSavedOffset = s.m_lTransparentToolbarPosOffset; //::SetForegroundWindow(pFrame->m_hWnd); pFrame->rePosOSD(); //pFrame->RedrawNonClientArea(); } }
BOOL CAboutDlg::OnInitDialog() { USES_CONVERSION; UpdateData(); #ifdef _WIN64 m_appname += _T(" x64"); #endif m_strBuildNumber = AfxGetMyApp()->m_strVersion; #if defined(__INTEL_COMPILER) #if (__INTEL_COMPILER >= 1200) m_MPCCompiler = _T("ICL 12.x"); #else #error Compiler is not supported! #endif #elif defined(_MSC_VER) #if (_MSC_VER == 1600) #if (_MSC_FULL_VER >= 160040219) m_MPCCompiler = _T("MSVC 2010 SP1"); #else m_MPCCompiler = _T("MSVC 2010"); #endif #elif (_MSC_VER < 1600) #error Compiler is not supported! #endif #else #error Please add support for your compiler #endif #if !defined(_M_X64) && defined(_M_IX86_FP) #if (_M_IX86_FP == 1) // /arch:SSE was used m_MPCCompiler += _T(" (SSE)"); #elif (_M_IX86_FP == 2) // /arch:SSE2 was used m_MPCCompiler += _T(" (SSE2)"); #endif #endif // _M_IX86_FP #ifdef _DEBUG m_MPCCompiler += _T(" Debug"); #endif #if HAS_FFMPEG m_FFmpegCompiler.Format(A2W(GetFFmpegCompiler())); #endif // Build the path to Authors.txt GetModuleFileName(AfxGetInstanceHandle(), m_AuthorsPath.GetBuffer(_MAX_PATH), _MAX_PATH); m_AuthorsPath.ReleaseBuffer(); m_AuthorsPath = m_AuthorsPath.Left(m_AuthorsPath.ReverseFind('\\') + 1) + _T("Authors.txt"); // Check if the file exists CFileStatus fs; if (CFile::GetStatus(m_AuthorsPath, fs)) { // If it does, we make the filename clickable m_Credits.Replace(_T("Authors.txt"), _T("<a>Authors.txt</a>")); } UpdateData(FALSE); GetDlgItem(IDOK)->SetFocus(); return FALSE; }