diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d0a4fc..555b360 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,8 +97,17 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE ) if(MSVC) + set(_WIN32_WINNT_WIN10 0x0A00) + set(NTDDI_WIN10_CO 0x0A00000B) + target_compile_definitions(${PROJECT_NAME} PRIVATE + _CRT_NON_CONFORMING_SWPRINTFS _CRT_SECURE_NO_WARNINGS + _ENABLE_EXTENDED_ALIGNED_STORAGE NOMINMAX UNICODE + _UNICODE WIN32_LEAN_AND_MEAN WINRT_LEAN_AND_MEAN _DWMAPI_ + WINVER=${_WIN32_WINNT_WIN10} _WIN32_WINNT=${_WIN32_WINNT_WIN10} + _WIN32_IE=${_WIN32_WINNT_WIN10} NTDDI_VERSION=${NTDDI_WIN10_CO} + ) target_compile_options(${PROJECT_NAME} PRIVATE - /W4 /WX + /utf-8 /W4 /WX ) else() target_compile_options(${PROJECT_NAME} PRIVATE diff --git a/framelesshelper_windows.h b/framelesshelper_windows.h index 5809a5d..ed3ce21 100644 --- a/framelesshelper_windows.h +++ b/framelesshelper_windows.h @@ -58,23 +58,19 @@ # define NTDDI_WIN10_CO 0x0A00000B #endif -#ifdef WINVER -# undef WINVER +#ifndef WINVER +# define WINVER _WIN32_WINNT_WIN10 #endif -#ifdef _WIN32_WINNT -# undef _WIN32_WINNT +#ifndef _WIN32_WINNT +# define _WIN32_WINNT _WIN32_WINNT_WIN10 #endif -#ifdef NTDDI_VERSION -# undef NTDDI_VERSION +#ifndef NTDDI_VERSION +# define NTDDI_VERSION NTDDI_WIN10_CO #endif -#define WINVER _WIN32_WINNT_WIN10 -#define _WIN32_WINNT _WIN32_WINNT_WIN10 -#define NTDDI_VERSION NTDDI_WIN10_CO - -#include +#include #include #include #include diff --git a/framelessquickhelper.cpp b/framelessquickhelper.cpp index a28e2ae..001ce42 100644 --- a/framelessquickhelper.cpp +++ b/framelessquickhelper.cpp @@ -30,7 +30,7 @@ #include "framelesswindowsmanager.h" #include "utilities.h" #ifdef Q_OS_WINDOWS -# include +# include "framelesshelper_windows.h" #endif FRAMELESSHELPER_BEGIN_NAMESPACE diff --git a/qwinregistry_p.h b/qwinregistry_p.h index 2a4c3e0..a88ac07 100644 --- a/qwinregistry_p.h +++ b/qwinregistry_p.h @@ -56,7 +56,7 @@ #else // QT_VERSION < QT_VERSION_CHECK(5, 14, 0) #include #include -#include +#include "framelesshelper_windows.h" QT_BEGIN_NAMESPACE