From a8834453e0add9c68df485121bc01e248cfb43b8 Mon Sep 17 00:00:00 2001 From: narzoul Date: Mon, 18 Apr 2016 22:14:53 +0200 Subject: [PATCH] Added default paint handlers for ComboListBox controls Now the background is properly erased and the scroll bar updated when scrolling. --- DDrawCompat/CompatGdiPaintHandlers.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DDrawCompat/CompatGdiPaintHandlers.cpp b/DDrawCompat/CompatGdiPaintHandlers.cpp index 696ed50..986e9c9 100644 --- a/DDrawCompat/CompatGdiPaintHandlers.cpp +++ b/DDrawCompat/CompatGdiPaintHandlers.cpp @@ -20,11 +20,17 @@ namespace LRESULT onPaint(HWND hwnd, WNDPROC origWndProc); LRESULT onPrint(HWND hwnd, UINT msg, HDC dc, LONG flags, WNDPROC origWndProc); + WNDPROC g_origComboListBoxWndProc = nullptr; WNDPROC g_origEditWndProc = nullptr; WNDPROC g_origListBoxWndProc = nullptr; WNDPROC g_origMenuWndProc = nullptr; WNDPROC g_origScrollBarWndProc = nullptr; + LRESULT WINAPI comboListBoxWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + return defPaintProc(hwnd, msg, wParam, lParam, g_origComboListBoxWndProc, "comboListBoxWndProc"); + } + LRESULT WINAPI defDlgProcA(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) { return defPaintProc(hdlg, msg, wParam, lParam, CALL_ORIG_FUNC(DefDlgProcA), "defDlgProcA"); @@ -304,6 +310,7 @@ namespace CompatGdiPaintHandlers "ImmersiveContextMenu", 0); + CompatGdi::hookWndProc("ComboLBox", g_origComboListBoxWndProc, &comboListBoxWndProc); CompatGdi::hookWndProc("Edit", g_origEditWndProc, &editWndProc); CompatGdi::hookWndProc("ListBox", g_origListBoxWndProc, &listBoxWndProc); CompatGdi::hookWndProc("#32768", g_origMenuWndProc, &menuWndProc);