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

Function GetThisModulePath

includes/stdafx.h:284–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282
283template<class T = std::filesystem::path>
284T GetThisModulePath()
285{
286 HMODULE hm = NULL;
287 GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCWSTR)&GetDesktopRefreshRate, &hm);
288 T r = GetModulePath<T>(hm);
289 if constexpr (std::is_same_v<T, std::filesystem::path>)
290 return r.parent_path();
291 else if constexpr (std::is_same_v<T, std::string>)
292 r = r.substr(0, r.find_last_of("/\\") + 1);
293 else
294 r = r.substr(0, r.find_last_of(L"/\\") + 1);
295 return r;
296}
297
298template<class T = std::filesystem::path>
299T GetThisModuleName()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected