From 0fa576d8bb84db8696fb8ca237bf2ec0061ad0e7 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sat, 16 Mar 2024 01:45:23 +0600 Subject: [PATCH] Compile fixes for Qt6 on Windows --- src/qt/qt_main.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index f87f8b6a93..1523d9a62f 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -17,6 +17,10 @@ * Copyright 2021-2022 Cacodemon345 * Copyright 2021-2022 Teemu Korhonen */ + +#ifdef _WIN32 +#define UNICODE 1 +#endif #include #include #include @@ -220,13 +224,13 @@ main(int argc, char *argv[]) #ifdef Q_OS_WINDOWS # if !defined(EMU_BUILD_NUM) || (EMU_BUILD_NUM != 5624) - HWND winbox = FindWindow("TWinBoxMain", NULL); + HWND winbox = FindWindow(L"TWinBoxMain", NULL); if (winbox && - FindWindowEx(winbox, NULL, "TToolBar", NULL) && - FindWindowEx(winbox, NULL, "TListBox", NULL) && - FindWindowEx(winbox, NULL, "TStatusBar", NULL) && - (winbox = FindWindowEx(winbox, NULL, "TPageControl", NULL)) && /* holds a TTabSheet even on VM pages */ - FindWindowEx(winbox, NULL, "TTabSheet", NULL)) + FindWindowEx(winbox, NULL, L"TToolBar", NULL) && + FindWindowEx(winbox, NULL, L"TListBox", NULL) && + FindWindowEx(winbox, NULL, L"TStatusBar", NULL) && + (winbox = FindWindowEx(winbox, NULL, L"TPageControl", NULL)) && /* holds a TTabSheet even on VM pages */ + FindWindowEx(winbox, NULL, L"TTabSheet", NULL)) # endif { QMessageBox warningbox(QMessageBox::Icon::Warning, QObject::tr("WinBox is no longer supported"),