Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/UI/FileManager/ProgramLocation.cpp')
-rwxr-xr-xCPP/7zip/UI/FileManager/ProgramLocation.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/CPP/7zip/UI/FileManager/ProgramLocation.cpp b/CPP/7zip/UI/FileManager/ProgramLocation.cpp
new file mode 100755
index 00000000..88c18d5e
--- /dev/null
+++ b/CPP/7zip/UI/FileManager/ProgramLocation.cpp
@@ -0,0 +1,24 @@
+// ProgramLocation.h
+
+#include "StdAfx.h"
+
+#include "ProgramLocation.h"
+
+#include "Windows/FileName.h"
+#include "Windows/DLL.h"
+
+using namespace NWindows;
+
+extern HINSTANCE g_hInstance;
+
+bool GetProgramFolderPath(UString &folder)
+{
+ if (!NDLL::MyGetModuleFileName(g_hInstance, folder))
+ return false;
+ int pos = folder.ReverseFind(L'\\');
+ if (pos < 0)
+ return false;
+ folder = folder.Left(pos + 1);
+ return true;
+}
+