diff options
Diffstat (limited to 'src/samples/thmviewer/thmviewer.cpp')
| -rw-r--r-- | src/samples/thmviewer/thmviewer.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/samples/thmviewer/thmviewer.cpp b/src/samples/thmviewer/thmviewer.cpp index f83182d3..cffa3851 100644 --- a/src/samples/thmviewer/thmviewer.cpp +++ b/src/samples/thmviewer/thmviewer.cpp | |||
| @@ -14,10 +14,6 @@ enum THMVWR_CONTROL | |||
| 14 | THMVWR_CONTROL_TREE = THEME_FIRST_ASSIGN_CONTROL_ID, | 14 | THMVWR_CONTROL_TREE = THEME_FIRST_ASSIGN_CONTROL_ID, |
| 15 | }; | 15 | }; |
| 16 | 16 | ||
| 17 | static THEME_ASSIGN_CONTROL_ID vrgInitControls[] = { | ||
| 18 | { THMVWR_CONTROL_TREE, L"Tree" }, | ||
| 19 | }; | ||
| 20 | |||
| 21 | // Internal functions | 17 | // Internal functions |
| 22 | 18 | ||
| 23 | static HRESULT ProcessCommandLine( | 19 | static HRESULT ProcessCommandLine( |
| @@ -52,6 +48,10 @@ static void OnNewTheme( | |||
| 52 | __in HWND hWnd, | 48 | __in HWND hWnd, |
| 53 | __in HANDLE_THEME* pHandle | 49 | __in HANDLE_THEME* pHandle |
| 54 | ); | 50 | ); |
| 51 | static BOOL OnThemeLoadingControl( | ||
| 52 | __in const THEME_LOADINGCONTROL_ARGS* pArgs, | ||
| 53 | __in THEME_LOADINGCONTROL_RESULTS* pResults | ||
| 54 | ); | ||
| 55 | static void CALLBACK ThmviewerTraceError( | 55 | static void CALLBACK ThmviewerTraceError( |
| 56 | __in_z LPCSTR szFile, | 56 | __in_z LPCSTR szFile, |
| 57 | __in int iLine, | 57 | __in int iLine, |
| @@ -353,7 +353,7 @@ static LRESULT CALLBACK MainWndProc( | |||
| 353 | 353 | ||
| 354 | case WM_CREATE: | 354 | case WM_CREATE: |
| 355 | { | 355 | { |
| 356 | HRESULT hr = ThemeLoadControls(vpTheme, vrgInitControls, countof(vrgInitControls)); | 356 | HRESULT hr = ThemeLoadControls(vpTheme); |
| 357 | if (FAILED(hr)) | 357 | if (FAILED(hr)) |
| 358 | { | 358 | { |
| 359 | return -1; | 359 | return -1; |
| @@ -400,6 +400,9 @@ static LRESULT CALLBACK MainWndProc( | |||
| 400 | } | 400 | } |
| 401 | } | 401 | } |
| 402 | break; | 402 | break; |
| 403 | |||
| 404 | case WM_THMUTIL_LOADING_CONTROL: | ||
| 405 | return OnThemeLoadingControl(reinterpret_cast<THEME_LOADINGCONTROL_ARGS*>(wParam), reinterpret_cast<THEME_LOADINGCONTROL_RESULTS*>(lParam)); | ||
| 403 | } | 406 | } |
| 404 | 407 | ||
| 405 | return ThemeDefWindowProc(vpTheme, hWnd, uMsg, wParam, lParam); | 408 | return ThemeDefWindowProc(vpTheme, hWnd, uMsg, wParam, lParam); |
| @@ -541,3 +544,17 @@ static void OnNewTheme( | |||
| 541 | ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_SELECTITEM, TVGN_CARET, reinterpret_cast<LPARAM>(htiSelected)); | 544 | ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_SELECTITEM, TVGN_CARET, reinterpret_cast<LPARAM>(htiSelected)); |
| 542 | } | 545 | } |
| 543 | } | 546 | } |
| 547 | |||
| 548 | static BOOL OnThemeLoadingControl( | ||
| 549 | __in const THEME_LOADINGCONTROL_ARGS* pArgs, | ||
| 550 | __in THEME_LOADINGCONTROL_RESULTS* pResults | ||
| 551 | ) | ||
| 552 | { | ||
| 553 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, pArgs->pThemeControl->sczName, -1, L"Tree", -1)) | ||
| 554 | { | ||
| 555 | pResults->wId = THMVWR_CONTROL_TREE; | ||
| 556 | } | ||
| 557 | |||
| 558 | pResults->hr = S_OK; | ||
| 559 | return TRUE; | ||
| 560 | } | ||
