diff options
Diffstat (limited to 'Swiften/Application/WindowsApplicationPathProvider.cpp')
-rw-r--r-- | Swiften/Application/WindowsApplicationPathProvider.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Swiften/Application/WindowsApplicationPathProvider.cpp b/Swiften/Application/WindowsApplicationPathProvider.cpp index 3fdcb88..2e84e90 100644 --- a/Swiften/Application/WindowsApplicationPathProvider.cpp +++ b/Swiften/Application/WindowsApplicationPathProvider.cpp @@ -6,9 +6,20 @@ #include "Swiften/Application/WindowsApplicationPathProvider.h" +#include <windows.h> + +#include "Swiften/Base/ByteArray.h" + namespace Swift { WindowsApplicationPathProvider::WindowsApplicationPathProvider(const String& name) : ApplicationPathProvider(name) { } +boost::filesystem::path WindowsApplicationPathProvider::getExecutableDir() const { + ByteArray data; + data.resize(2048); + GetModuleFileName(NULL, data.getData(), data.getSize()); + return boost::filesystem::path(data.toString().getUTF8Data()).parent_path(); +} + } |