diff --git a/include/FramelessHelper/Core/framelesshelper_windows.h b/include/FramelessHelper/Core/framelesshelper_windows.h index bd42cd9..6099dd5 100644 --- a/include/FramelessHelper/Core/framelesshelper_windows.h +++ b/include/FramelessHelper/Core/framelesshelper_windows.h @@ -153,6 +153,46 @@ # define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED (reinterpret_cast(-5)) #endif +#ifndef HKEY_CLASSES_ROOT +# define HKEY_CLASSES_ROOT ((HKEY)(ULONG_PTR)((LONG)0x80000000)) +#endif + +#ifndef HKEY_CURRENT_USER +# define HKEY_CURRENT_USER ((HKEY)(ULONG_PTR)((LONG)0x80000001)) +#endif + +#ifndef HKEY_LOCAL_MACHINE +# define HKEY_LOCAL_MACHINE ((HKEY)(ULONG_PTR)((LONG)0x80000002)) +#endif + +#ifndef HKEY_USERS +# define HKEY_USERS ((HKEY)(ULONG_PTR)((LONG)0x80000003)) +#endif + +#ifndef HKEY_PERFORMANCE_DATA +# define HKEY_PERFORMANCE_DATA ((HKEY)(ULONG_PTR)((LONG)0x80000004)) +#endif + +#ifndef HKEY_CURRENT_CONFIG +# define HKEY_CURRENT_CONFIG ((HKEY)(ULONG_PTR)((LONG)0x80000005)) +#endif + +#ifndef HKEY_DYN_DATA +# define HKEY_DYN_DATA ((HKEY)(ULONG_PTR)((LONG)0x80000006)) +#endif + +#ifndef HKEY_CURRENT_USER_LOCAL_SETTINGS +# define HKEY_CURRENT_USER_LOCAL_SETTINGS ((HKEY)(ULONG_PTR)((LONG)0x80000007)) +#endif + +#ifndef HKEY_PERFORMANCE_TEXT +# define HKEY_PERFORMANCE_TEXT ((HKEY)(ULONG_PTR)((LONG)0x80000050)) +#endif + +#ifndef HKEY_PERFORMANCE_NLSTEXT +# define HKEY_PERFORMANCE_NLSTEXT ((HKEY)(ULONG_PTR)((LONG)0x80000060)) +#endif + #ifndef STATUS_SUCCESS # define STATUS_SUCCESS (static_cast(0x00000000L)) #endif diff --git a/src/core/framelesshelper_win.cpp b/src/core/framelesshelper_win.cpp index 7ce2574..c308db0 100644 --- a/src/core/framelesshelper_win.cpp +++ b/src/core/framelesshelper_win.cpp @@ -451,7 +451,12 @@ Q_GLOBAL_STATIC(Win32Helper, g_win32Helper) const HWND fallbackTitleBarWindowHandle = CreateWindowExW((WS_EX_LAYERED | WS_EX_NOREDIRECTIONBITMAP), kFallbackTitleBarWindowClassName, nullptr, WS_CHILD, 0, 0, 0, 0, parentWindowHandle, nullptr, instance, nullptr); - Q_ASSERT(fallbackTitleBarWindowHandle); + Q_ASSERT_X(fallbackTitleBarWindowHandle, "createFallbackTitleBarWindow()", + "FramelessHelper is unable to create the fallback title bar window, and thus the snap layout feature will be disabled. " + "You can ignore this error and continue running your application, nothing else will be affected, so no need to worry. " + "But if you need the snap layout feature, please add a manifest file to your application and explicitly declare Windows" + " 11 compatibility in it. If you want to hide this error dialog, please use the FramelessConfig class to disable the " + " snap layout feature for Windows 11."); if (!fallbackTitleBarWindowHandle) { WARNING << Utils::getSystemErrorMessage(kCreateWindowExW); return false;