aboutsummaryrefslogtreecommitdiff
path: root/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp')
-rw-r--r--src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp59
1 files changed, 51 insertions, 8 deletions
diff --git a/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp b/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp
index 8b49cab6..b35b4e02 100644
--- a/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp
+++ b/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp
@@ -6,6 +6,11 @@
6 6
7static const LPCWSTR BAFTHMUTILTESTING_WINDOW_CLASS = L"BafThmUtilTesting"; 7static const LPCWSTR BAFTHMUTILTESTING_WINDOW_CLASS = L"BafThmUtilTesting";
8 8
9enum BAF_CONTROL
10{
11 BAF_CONTROL_INSTALL_TEST_BUTTON = BAFUNCTIONS_FIRST_ASSIGN_CONTROL_ID,
12};
13
9enum BAFTHMUTILTESTING_CONTROL 14enum BAFTHMUTILTESTING_CONTROL
10{ 15{
11 BAFTHMUTILTESTING_CONTROL_LISTVIEW_TOP_LEFT = THEME_FIRST_ASSIGN_CONTROL_ID, 16 BAFTHMUTILTESTING_CONTROL_LISTVIEW_TOP_LEFT = THEME_FIRST_ASSIGN_CONTROL_ID,
@@ -59,24 +64,41 @@ public: // IBAFunctions
59 __inout LRESULT* plRes 64 __inout LRESULT* plRes
60 ) 65 )
61 { 66 {
62 HRESULT hr = S_OK;
63
64 __super::WndProc(pTheme, hWnd, uMsg, wParam, lParam, plRes);
65
66 // Show our window when any button is clicked.
67 switch (uMsg) 67 switch (uMsg)
68 { 68 {
69 case WM_COMMAND: 69 case WM_COMMAND:
70 switch (HIWORD(wParam)) 70 switch (HIWORD(wParam))
71 { 71 {
72 case BN_CLICKED: 72 case BN_CLICKED:
73 OnShowTheme(); 73 switch (LOWORD(wParam))
74 {
75 case BAF_CONTROL_INSTALL_TEST_BUTTON:
76 OnShowTheme();
77 *plRes = 0;
78 return S_OK;
79 }
80
74 break; 81 break;
75 } 82 }
76 break; 83 break;
77 } 84 }
78 85
79 return hr; 86 return __super::WndProc(pTheme, hWnd, uMsg, wParam, lParam, plRes);
87 }
88
89 virtual STDMETHODIMP OnThemeControlLoading(
90 __in LPCWSTR wzName,
91 __inout BOOL* pfProcessed,
92 __inout WORD* pwId
93 )
94 {
95 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, wzName, -1, L"InstallTestButton", -1))
96 {
97 *pfProcessed = TRUE;
98 *pwId = BAF_CONTROL_INSTALL_TEST_BUTTON;
99 }
100
101 return S_OK;
80 } 102 }
81 103
82private: 104private:
@@ -229,6 +251,9 @@ private:
229 } 251 }
230 break; 252 break;
231 253
254 case WM_THMUTIL_LOADING_CONTROL:
255 return pBaf->OnThemeLoadingControl(reinterpret_cast<THEME_LOADINGCONTROL_ARGS*>(wParam), reinterpret_cast<THEME_LOADINGCONTROL_RESULTS*>(lParam));
256
232 case WM_TIMER: 257 case WM_TIMER:
233 if (!lParam && pBaf) 258 if (!lParam && pBaf)
234 { 259 {
@@ -255,7 +280,7 @@ private:
255 HWND hwndBottomLeft = NULL; 280 HWND hwndBottomLeft = NULL;
256 HWND hwndBottomRight = NULL; 281 HWND hwndBottomRight = NULL;
257 282
258 hr = ThemeLoadControls(m_pBafTheme, vrgInitControls, countof(vrgInitControls)); 283 hr = ThemeLoadControls(m_pBafTheme);
259 BalExitOnFailure(hr, "Failed to load theme controls."); 284 BalExitOnFailure(hr, "Failed to load theme controls.");
260 285
261 hwndTopLeft = ::GetDlgItem(m_pBafTheme->hwndParent, BAFTHMUTILTESTING_CONTROL_LISTVIEW_TOP_LEFT); 286 hwndTopLeft = ::GetDlgItem(m_pBafTheme->hwndParent, BAFTHMUTILTESTING_CONTROL_LISTVIEW_TOP_LEFT);
@@ -333,6 +358,24 @@ private:
333 return SUCCEEDED(hr); 358 return SUCCEEDED(hr);
334 } 359 }
335 360
361 BOOL OnThemeLoadingControl(
362 __in const THEME_LOADINGCONTROL_ARGS* pArgs,
363 __in THEME_LOADINGCONTROL_RESULTS* pResults
364 )
365 {
366 for (DWORD iAssignControl = 0; iAssignControl < countof(vrgInitControls); ++iAssignControl)
367 {
368 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, pArgs->pThemeControl->sczName, -1, vrgInitControls[iAssignControl].wzName, -1))
369 {
370 pResults->wId = vrgInitControls[iAssignControl].wId;
371 break;
372 }
373 }
374
375 pResults->hr = S_OK;
376 return TRUE;
377 }
378
336 void UpdateProgressBarProgress() 379 void UpdateProgressBarProgress()
337 { 380 {
338 static DWORD dwProgress = 0; 381 static DWORD dwProgress = 0;