From bad2e93524f376cfeb76d5231d4b08510bdad033 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 27 Oct 2021 14:42:32 -0500 Subject: Add more thmutil window messages to simplify handling control events. --- .../Manual/BafThmutilTesting/BafThmUtilTesting.cpp | 70 +++++++++------------- 1 file changed, 28 insertions(+), 42 deletions(-) (limited to 'src/test') diff --git a/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp b/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp index b35b4e02..a5bcba3e 100644 --- a/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp +++ b/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp @@ -43,62 +43,48 @@ static void CALLBACK BafThmUtilTestingTraceError( class CBafThmUtilTesting : public CBalBaseBAFunctions { public: // IBAFunctions - /*virtual STDMETHODIMP OnThemeLoaded( - THEME* pTheme, - WIX_LOCALIZATION* pWixLoc + virtual STDMETHODIMP OnThemeControlLoading( + __in LPCWSTR wzName, + __inout BOOL* pfProcessed, + __inout WORD* pwId ) { - HRESULT hr = S_OK; - - hr = __super::OnThemeLoaded(pTheme, pWixLoc); + if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, wzName, -1, L"InstallTestButton", -1)) + { + *pfProcessed = TRUE; + *pwId = BAF_CONTROL_INSTALL_TEST_BUTTON; + } - return hr; - }*/ + return S_OK; + } - virtual STDMETHODIMP WndProc( - __in THEME* pTheme, - __in HWND hWnd, - __in UINT uMsg, + virtual STDMETHODIMP OnThemeControlWmCommand( __in WPARAM wParam, - __in LPARAM lParam, - __inout LRESULT* plRes + __in LPCWSTR /*wzName*/, + __in WORD wId, + __in HWND /*hWnd*/, + __inout BOOL* pfProcessed, + __inout LRESULT* plResult ) { - switch (uMsg) + HRESULT hr = S_OK; + + switch (HIWORD(wParam)) { - case WM_COMMAND: - switch (HIWORD(wParam)) + case BN_CLICKED: + switch (wId) { - case BN_CLICKED: - switch (LOWORD(wParam)) - { - case BAF_CONTROL_INSTALL_TEST_BUTTON: - OnShowTheme(); - *plRes = 0; - return S_OK; - } - + case BAF_CONTROL_INSTALL_TEST_BUTTON: + OnShowTheme(); + *pfProcessed = TRUE; + *plResult = 0; break; } - break; - } - - return __super::WndProc(pTheme, hWnd, uMsg, wParam, lParam, plRes); - } - virtual STDMETHODIMP OnThemeControlLoading( - __in LPCWSTR wzName, - __inout BOOL* pfProcessed, - __inout WORD* pwId - ) - { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, wzName, -1, L"InstallTestButton", -1)) - { - *pfProcessed = TRUE; - *pwId = BAF_CONTROL_INSTALL_TEST_BUTTON; + break; } - return S_OK; + return hr; } private: -- cgit v1.2.3-55-g6feb