From c092722a147940532b08f62403e182ef279f2c74 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 27 Oct 2021 15:30:02 -0500 Subject: Add CS_HREDRAW and CS_VREDRAW to fix painting issues when resizing. --- src/samples/thmviewer/display.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/samples/thmviewer/display.cpp') diff --git a/src/samples/thmviewer/display.cpp b/src/samples/thmviewer/display.cpp index e64f79c6..9ef88018 100644 --- a/src/samples/thmviewer/display.cpp +++ b/src/samples/thmviewer/display.cpp @@ -78,11 +78,7 @@ static DWORD WINAPI DisplayThreadProc( HANDLE_THEME* pCurrentHandle = NULL; ATOM atomWc = 0; - WNDCLASSW wc = { }; // the following are constant for the display window class. - wc.lpfnWndProc = DisplayWndProc; - wc.hInstance = hInstance; - wc.lpszClassName = THMVWR_WINDOW_CLASS_DISPLAY; - + WNDCLASSW wc = { }; HWND hWnd = NULL; RECT rc = { }; int x = CW_USEDEFAULT; @@ -170,12 +166,8 @@ static DWORD WINAPI DisplayThreadProc( pCurrentHandle = reinterpret_cast(msg.lParam); if (pCurrentHandle) { - wc.hIcon = reinterpret_cast(pCurrentHandle->pTheme->hIcon); - wc.hCursor = ::LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); - if (0 < pCurrentHandle->pTheme->cFonts) - { - wc.hbrBackground = pCurrentHandle->pTheme->rgFonts[pCurrentHandle->pTheme->dwFontId].hBackground; - } + ThemeInitializeWindowClass(pCurrentHandle->pTheme, &wc, DisplayWndProc, hInstance, THMVWR_WINDOW_CLASS_DISPLAY); + atomWc = ::RegisterClassW(&wc); if (!atomWc) { -- cgit v1.2.3-55-g6feb