From 199b99477838a321345d51e8ac886bf82e1d20cc Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Fri, 6 Aug 2021 15:01:43 +0200 Subject: Added GetRunningExecutablePath() --- zencore/filesystem.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'zencore/filesystem.cpp') diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp index c4c4a6ff0..7b123eb4e 100644 --- a/zencore/filesystem.cpp +++ b/zencore/filesystem.cpp @@ -610,4 +610,13 @@ PathFromHandle(void* NativeHandle) return FullPath; } +std::filesystem::path +GetRunningExecutablePath() +{ + TCHAR ExePath[MAX_PATH]; + DWORD PathLength = GetModuleFileName(NULL, ExePath, ZEN_ARRAY_COUNT(ExePath)); + + return {std::wstring_view(ExePath, PathLength)}; +} + } // namespace zen -- cgit v1.2.3