From ab0f59925075560ce455078eea75c6557b981665 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Fri, 28 Jun 2024 21:31:12 +0900 Subject: [PATCH] WIP --- Src/Common/BCMenu.cpp | 4 ---- Src/Common/BCMenu.h | 2 ++ Src/Merge.cpp | 5 +++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Src/Common/BCMenu.cpp b/Src/Common/BCMenu.cpp index 1404ce5fbe6..f276582c58a 100644 --- a/Src/Common/BCMenu.cpp +++ b/Src/Common/BCMenu.cpp @@ -51,11 +51,7 @@ int BCMenu::m_checkBgWidth = 0; int BCMenu::m_gutterWidth = 0; int BCMenu::m_arrowWidth = 0; HTHEME BCMenu::m_hTheme = nullptr; -#ifdef _WIN64 -bool BCMenu::m_bEnableOwnerDraw = false; -#else bool BCMenu::m_bEnableOwnerDraw = true; -#endif static class GdiplusToken { diff --git a/Src/Common/BCMenu.h b/Src/Common/BCMenu.h index 70c33fcec97..9552bb437cc 100644 --- a/Src/Common/BCMenu.h +++ b/Src/Common/BCMenu.h @@ -58,6 +58,8 @@ class BCMenu : public CMenu BCMenu(); virtual ~BCMenu(); + static void DisableOwnerDraw() { m_bEnableOwnerDraw = false; } + // Functions for loading and applying bitmaps to menus (see example application) virtual BOOL LoadMenu(LPCTSTR lpszResourceName); virtual BOOL LoadMenu(int nResource) diff --git a/Src/Merge.cpp b/Src/Merge.cpp index c92a96680bb..93c4709cf33 100644 --- a/Src/Merge.cpp +++ b/Src/Merge.cpp @@ -62,6 +62,8 @@ #include "OptionsProject.h" #include "MergeAppCOMClass.h" #include "RegKey.h" +#include "Win_VersionHelper.h" +#include "BCMenu.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -402,6 +404,9 @@ BOOL CMergeApp::InitInstance() strdiff::Init(); // String diff init strdiff::SetBreakChars(GetOptionsMgr()->GetString(OPT_BREAK_SEPARATORS).c_str()); + if (IsWin11_OrGreater()) + BCMenu::DisableOwnerDraw(); + m_bMergingMode = GetOptionsMgr()->GetBool(OPT_MERGE_MODE); m_mainThreadScripts = new CAssureScriptsForThread(new MergeAppCOMClass());