MCPcopy Create free account
hub / github.com/ThirteenAG/WidescreenFixesPack / GetThisModuleName

Function GetThisModuleName

includes/stdafx.h:299–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297
298template<class T = std::filesystem::path>
299T GetThisModuleName()
300{
301 HMODULE hm = NULL;
302 GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCWSTR)&GetDesktopRefreshRate, &hm);
303 const T moduleFileName = GetModulePath<T>(hm);
304
305 if constexpr (std::is_same_v<T, std::filesystem::path>)
306 return moduleFileName.filename();
307 else if constexpr (std::is_same_v<T, std::string>)
308 return moduleFileName.substr(moduleFileName.find_last_of("/\\") + 1);
309 else
310 return moduleFileName.substr(moduleFileName.find_last_of(L"/\\") + 1);
311}
312
313template<class T = std::filesystem::path>
314T GetExeModulePath()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected