| 282 | |
| 283 | template<class T = std::filesystem::path> |
| 284 | T 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 | |
| 298 | template<class T = std::filesystem::path> |
| 299 | T GetThisModuleName() |
nothing calls this directly
no outgoing calls
no test coverage detected