sys: Add imhex/lib path to plugin libraries search paths

This commit is contained in:
WerWolv
2023-01-07 10:32:01 +01:00
parent 27cf5953ae
commit c26bed894b
6 changed files with 25 additions and 0 deletions

View File

@@ -18,6 +18,7 @@
#include <GLFW/glfw3native.h>
#undef GLFW_EXPOSE_NATIVE_WIN32
#include <winbase.h>
#include <winuser.h>
#include <dwmapi.h>
#include <windowsx.h>
@@ -187,6 +188,13 @@ namespace hex {
void Window::initNative() {
// Add plugin library folders to dll search path
for (const auto &path : hex::fs::getDefaultPaths(fs::ImHexPath::Libraries)) {
if (std::fs::exists(path))
AddDllDirectory(path.c_str());
}
// Attach to parent console if one exists
if (AttachConsole(ATTACH_PARENT_PROCESS)) {