Skip to content

Commit df6656b

Browse files
committedMay 14, 2024·
ImGui: COLOR_BACKGROUND is deprecated on Win10+
1 parent 34da0af commit df6656b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/imgui/imgui_impl_win32.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -2054,9 +2054,9 @@ static void ImGui_ImplWin32_InitPlatformInterface(bool platform_has_own_dc)
20542054
wcex.hInstance = ::GetModuleHandle(nullptr);
20552055
wcex.hIcon = nullptr;
20562056
wcex.hCursor = nullptr;
2057-
wcex.hbrBackground = (HBRUSH)(COLOR_BACKGROUND + 1);
2058-
wcex.lpszMenuName = nullptr;
20592057
#ifdef SKIF_Win32
2058+
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); // COLOR_BACKGROUND is unsupported on Win10+
2059+
wcex.lpszMenuName = nullptr;
20602060
wcex.lpszClassName = SKIF_ImGui_WindowClass;
20612061
HMODULE hModHost =
20622062
::GetModuleHandle (nullptr);
@@ -2065,6 +2065,8 @@ static void ImGui_ImplWin32_InitPlatformInterface(bool platform_has_own_dc)
20652065
wcex.hIconSm =
20662066
LoadIcon (hModHost, MAKEINTRESOURCE (IDI_SKIF));
20672067
#else
2068+
wcex.hbrBackground = (HBRUSH)(COLOR_BACKGROUND + 1);
2069+
wcex.lpszMenuName = nullptr;
20682070
wcex.lpszClassName = _T("ImGui Platform");;
20692071
wcex.hIconSm = nullptr;
20702072
#endif // SKIF_Win32

0 commit comments

Comments
 (0)
Please sign in to comment.