diff options
Diffstat (limited to 'src/thmviewer/display.cpp')
-rw-r--r-- | src/thmviewer/display.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/thmviewer/display.cpp b/src/thmviewer/display.cpp index cfd1c6b7..52fa3cf8 100644 --- a/src/thmviewer/display.cpp +++ b/src/thmviewer/display.cpp | |||
@@ -110,8 +110,8 @@ static DWORD WINAPI DisplayThreadProc( | |||
110 | y = rc.bottom + 20; | 110 | y = rc.bottom + 20; |
111 | } | 111 | } |
112 | 112 | ||
113 | hWnd = ::CreateWindowExW(0, wc.lpszClassName, pTheme->sczCaption, pTheme->dwStyle, x, y, pTheme->nWidth, pTheme->nHeight, hwndParent, NULL, hInstance, pCurrentHandle); | 113 | hr = ThemeCreateParentWindow(pTheme, 0, wc.lpszClassName, pTheme->sczCaption, pTheme->dwStyle, x, y, hwndParent, hInstance, pCurrentHandle, THEME_WINDOW_INITIAL_POSITION_DEFAULT, &hWnd); |
114 | ExitOnNullWithLastError(hWnd, hr, "Failed to create display window."); | 114 | ExitOnFailure(hr, "Failed to create display window."); |
115 | 115 | ||
116 | fCreateIfNecessary = FALSE; | 116 | fCreateIfNecessary = FALSE; |
117 | } | 117 | } |
@@ -263,9 +263,10 @@ static LRESULT CALLBACK DisplayWndProc( | |||
263 | { | 263 | { |
264 | case WM_NCCREATE: | 264 | case WM_NCCREATE: |
265 | { | 265 | { |
266 | LPCREATESTRUCT lpcs = reinterpret_cast<LPCREATESTRUCT>(lParam); | 266 | LPCREATESTRUCT lpcs = reinterpret_cast<LPCREATESTRUCT>(lParam); |
267 | IncrementHandleTheme(reinterpret_cast<HANDLE_THEME*>(lpcs->lpCreateParams)); | 267 | pHandleTheme = reinterpret_cast<HANDLE_THEME*>(lpcs->lpCreateParams); |
268 | ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(lpcs->lpCreateParams)); | 268 | IncrementHandleTheme(pHandleTheme); |
269 | ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(pHandleTheme)); | ||
269 | } | 270 | } |
270 | break; | 271 | break; |
271 | 272 | ||
@@ -328,7 +329,7 @@ static BOOL DisplayOnCreate( | |||
328 | { | 329 | { |
329 | HRESULT hr = S_OK; | 330 | HRESULT hr = S_OK; |
330 | 331 | ||
331 | hr = ThemeLoadControls(pTheme, hWnd, NULL, 0); | 332 | hr = ThemeLoadControls(pTheme, NULL, 0); |
332 | ExitOnFailure(hr, "Failed to load theme controls"); | 333 | ExitOnFailure(hr, "Failed to load theme controls"); |
333 | 334 | ||
334 | // Pre-populate some control types with data. | 335 | // Pre-populate some control types with data. |