diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1b9a0f852..3da022a6c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,7 +8,7 @@ mo2_configure_executable(organizer PRIVATE_DEPENDS uibase githubpp bsatk esptk archive usvfs lootcli boost::program_options Qt::WebEngineWidgets Qt::WebSockets) -target_link_libraries(organizer PUBLIC Shlwapi) +target_link_libraries(organizer PUBLIC Shlwapi Dwmapi) mo2_install_target(organizer) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/dlls.manifest.qt5" diff --git a/src/moapplication.cpp b/src/moapplication.cpp index e131d3d96..a51020e4a 100644 --- a/src/moapplication.cpp +++ b/src/moapplication.cpp @@ -41,6 +41,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include #include #include @@ -354,6 +355,16 @@ int MOApplication::run(MOMultiProcess& multiProcess) log::debug("displaying main window"); mainWindow.show(); mainWindow.activateWindow(); + + BOOL USE_DARK_MODE = true; + if (!SUCCEEDED(DwmSetWindowAttribute( + (HWND)mainWindow.winId(), DWMWINDOWATTRIBUTE::DWMWA_USE_IMMERSIVE_DARK_MODE, + &USE_DARK_MODE, sizeof(USE_DARK_MODE)))) { + // Support Windows 10 + DwmSetWindowAttribute((HWND)mainWindow.winId(), 19, &USE_DARK_MODE, + sizeof(USE_DARK_MODE)); + } + splash.close(); tt.stop();