win: add missing definitions for mingw

Fixes: #153
Fixes: #154

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2022-09-10 16:04:17 +08:00
parent 34596db939
commit 33c3eaa05a
2 changed files with 46 additions and 1 deletions

View File

@ -153,6 +153,46 @@
# define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED (reinterpret_cast<DPI_AWARENESS_CONTEXT>(-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<NTSTATUS>(0x00000000L))
#endif

View File

@ -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;