diff options
author | Underground78 <underground78@users.sourceforge.net> | 2014-10-29 13:00:45 +0300 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2014-11-11 23:55:03 +0300 |
commit | 9a619329ca10c275155e841b34537103ab03033f (patch) | |
tree | a7cc19e54edf928e2c92800d9838ef3c28c87895 | |
parent | 20f8c73bf12927986ceaf6908bf2b41014de6fa1 (diff) |
Cosmetics: Use PathUtils::GetProgramPath when possible.
-rw-r--r-- | src/mpc-hc/PPageFormats.cpp | 6 | ||||
-rw-r--r-- | src/mpc-hc/mplayerc.cpp | 5 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/mpc-hc/PPageFormats.cpp b/src/mpc-hc/PPageFormats.cpp index f52d7e6ee..19183a2bd 100644 --- a/src/mpc-hc/PPageFormats.cpp +++ b/src/mpc-hc/PPageFormats.cpp @@ -23,6 +23,7 @@ #include "mplayerc.h"
#include "PPageFormats.h"
#include "FileAssoc.h"
+#include "PathUtils.h"
#include "SysVersion.h"
#include <psapi.h>
#include <string>
@@ -536,13 +537,10 @@ void CPPageFormats::OnClearAllAssociations() void CPPageFormats::OnBnRunAsAdmin()
{
- TCHAR strApp[MAX_PATH];
CString strCmd;
-
- GetModuleFileNameEx(GetCurrentProcess(), AfxGetMyApp()->m_hInstance, strApp, MAX_PATH);
strCmd.Format(_T("/adminoption %d"), IDD);
- AfxGetMyApp()->RunAsAdministrator(strApp, strCmd, true);
+ AfxGetMyApp()->RunAsAdministrator(PathUtils::GetProgramPath(true), strCmd, true);
auto& s = AfxGetAppSettings();
s.m_Formats.UpdateData(false);
diff --git a/src/mpc-hc/mplayerc.cpp b/src/mpc-hc/mplayerc.cpp index 49c972934..d16d314ec 100644 --- a/src/mpc-hc/mplayerc.cpp +++ b/src/mpc-hc/mplayerc.cpp @@ -613,10 +613,7 @@ CMPlayerCApp::CMPlayerCApp() , m_dwProfileLastAccessTick(0)
, m_fClosingState(false)
{
- TCHAR strApp[MAX_PATH];
-
- GetModuleFileNameEx(GetCurrentProcess(), m_hInstance, strApp, MAX_PATH);
- m_strVersion = FileVersionInfo::GetFileVersionStr(strApp);
+ m_strVersion = FileVersionInfo::GetFileVersionStr(PathUtils::GetProgramPath(true));
ZeroMemory(&m_ColorControl, sizeof(m_ColorControl));
ResetColorControlRange();
|