std::wstring GetModuleName(HMODULE module_handle) { //DCHECK(IsModuleHandleValid(module_handle)); std::wstring module_name; if (FilePathApartFileName(GetModulePathName(module_handle), module_name)) return module_name; return L""; }
std::wstring GetModuleDirectory(HMODULE module_handle) { //DCHECK(IsModuleHandleValid(module_handle)); std::wstring module_directory; if (FilePathApartDirectory(GetModulePathName(module_handle), module_directory)) return module_directory; return L""; }
LPCTSTR GetAppPath() { static CString g_strAppPath; if (g_strAppPath.IsEmpty()) { g_strAppPath = GetModulePathName(); } return (LPCTSTR)g_strAppPath; }
CSySkin::CSySkin(void) { m_hModule = NULL; m_pFunc = NULL; ZeroMemory(m_szCurrPath, MAX_PATH); ZeroMemory(m_szDLLPath, MAX_PATH); ZeroMemory(m_szSkinPath, MAX_PATH); GetModulePathName(m_szCurrPath, MAX_PATH); }
std::wstring GetCurrentModulePathName() { return GetModulePathName(GetCurrentModuleHandle()); }