diff options
Diffstat (limited to 'src/samples')
| -rw-r--r-- | src/samples/thmviewer/display.cpp | 14 | ||||
| -rw-r--r-- | src/samples/thmviewer/thmviewer.cpp | 9 |
2 files changed, 5 insertions, 18 deletions
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( | |||
| 78 | 78 | ||
| 79 | HANDLE_THEME* pCurrentHandle = NULL; | 79 | HANDLE_THEME* pCurrentHandle = NULL; |
| 80 | ATOM atomWc = 0; | 80 | ATOM atomWc = 0; |
| 81 | WNDCLASSW wc = { }; // the following are constant for the display window class. | 81 | WNDCLASSW wc = { }; |
| 82 | wc.lpfnWndProc = DisplayWndProc; | ||
| 83 | wc.hInstance = hInstance; | ||
| 84 | wc.lpszClassName = THMVWR_WINDOW_CLASS_DISPLAY; | ||
| 85 | |||
| 86 | HWND hWnd = NULL; | 82 | HWND hWnd = NULL; |
| 87 | RECT rc = { }; | 83 | RECT rc = { }; |
| 88 | int x = CW_USEDEFAULT; | 84 | int x = CW_USEDEFAULT; |
| @@ -170,12 +166,8 @@ static DWORD WINAPI DisplayThreadProc( | |||
| 170 | pCurrentHandle = reinterpret_cast<HANDLE_THEME*>(msg.lParam); | 166 | pCurrentHandle = reinterpret_cast<HANDLE_THEME*>(msg.lParam); |
| 171 | if (pCurrentHandle) | 167 | if (pCurrentHandle) |
| 172 | { | 168 | { |
| 173 | wc.hIcon = reinterpret_cast<HICON>(pCurrentHandle->pTheme->hIcon); | 169 | ThemeInitializeWindowClass(pCurrentHandle->pTheme, &wc, DisplayWndProc, hInstance, THMVWR_WINDOW_CLASS_DISPLAY); |
| 174 | wc.hCursor = ::LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); | 170 | |
| 175 | if (0 < pCurrentHandle->pTheme->cFonts) | ||
| 176 | { | ||
| 177 | wc.hbrBackground = pCurrentHandle->pTheme->rgFonts[pCurrentHandle->pTheme->dwFontId].hBackground; | ||
| 178 | } | ||
| 179 | atomWc = ::RegisterClassW(&wc); | 171 | atomWc = ::RegisterClassW(&wc); |
| 180 | if (!atomWc) | 172 | if (!atomWc) |
| 181 | { | 173 | { |
diff --git a/src/samples/thmviewer/thmviewer.cpp b/src/samples/thmviewer/thmviewer.cpp index 1d941323..94b1ef55 100644 --- a/src/samples/thmviewer/thmviewer.cpp +++ b/src/samples/thmviewer/thmviewer.cpp | |||
| @@ -312,13 +312,8 @@ static HRESULT CreateMainWindowClass( | |||
| 312 | ATOM atom = 0; | 312 | ATOM atom = 0; |
| 313 | WNDCLASSW wc = { }; | 313 | WNDCLASSW wc = { }; |
| 314 | 314 | ||
| 315 | wc.lpfnWndProc = MainWndProc; | 315 | ThemeInitializeWindowClass(pTheme, &wc, MainWndProc, hInstance, THMVWR_WINDOW_CLASS_MAIN); |
| 316 | wc.hInstance = hInstance; | 316 | |
| 317 | wc.hIcon = reinterpret_cast<HICON>(pTheme->hIcon); | ||
| 318 | wc.hCursor = ::LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); | ||
| 319 | wc.hbrBackground = pTheme->rgFonts[pTheme->dwFontId].hBackground; | ||
| 320 | wc.lpszMenuName = NULL; | ||
| 321 | wc.lpszClassName = THMVWR_WINDOW_CLASS_MAIN; | ||
| 322 | atom = ::RegisterClassW(&wc); | 317 | atom = ::RegisterClassW(&wc); |
| 323 | if (!atom) | 318 | if (!atom) |
| 324 | { | 319 | { |
