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. --- src/api/burn/balutil/inc/BAFunctions.h | 34 +++++++++++++++++++++++ src/api/burn/balutil/inc/BalBaseBAFunctions.h | 24 ++++++++++++++++ src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h | 24 ++++++++++++++++ src/api/burn/balutil/inc/IBAFunctions.h | 22 +++++++++++++++ 4 files changed, 104 insertions(+) (limited to 'src/api') diff --git a/src/api/burn/balutil/inc/BAFunctions.h b/src/api/burn/balutil/inc/BAFunctions.h index 2a34aaad..ab6ea4d7 100644 --- a/src/api/burn/balutil/inc/BAFunctions.h +++ b/src/api/burn/balutil/inc/BAFunctions.h @@ -86,6 +86,8 @@ enum BA_FUNCTIONS_MESSAGE BA_FUNCTIONS_MESSAGE_ONTHEMELOADED = 1024, BA_FUNCTIONS_MESSAGE_WNDPROC, BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLLOADING, + BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLWMCOMMAND, + BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLWMNOTIFY, }; typedef HRESULT(WINAPI *PFN_BA_FUNCTIONS_PROC)( @@ -126,6 +128,38 @@ struct BA_FUNCTIONS_ONTHEMECONTROLLOADING_RESULTS WORD wId; }; +struct BA_FUNCTIONS_ONTHEMECONTROLWMCOMMAND_ARGS +{ + DWORD cbSize; + WPARAM wParam; + LPCWSTR wzName; + WORD wId; + HWND hWnd; +}; + +struct BA_FUNCTIONS_ONTHEMECONTROLWMCOMMAND_RESULTS +{ + DWORD cbSize; + BOOL fProcessed; + LRESULT lResult; +}; + +struct BA_FUNCTIONS_ONTHEMECONTROLWMNOTIFY_ARGS +{ + DWORD cbSize; + LPNMHDR lParam; + LPCWSTR wzName; + WORD wId; + HWND hWnd; +}; + +struct BA_FUNCTIONS_ONTHEMECONTROLWMNOTIFY_RESULTS +{ + DWORD cbSize; + BOOL fProcessed; + LRESULT lResult; +}; + struct BA_FUNCTIONS_ONTHEMELOADED_ARGS { DWORD cbSize; diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctions.h b/src/api/burn/balutil/inc/BalBaseBAFunctions.h index c2c8a6dc..f6c33f58 100644 --- a/src/api/burn/balutil/inc/BalBaseBAFunctions.h +++ b/src/api/burn/balutil/inc/BalBaseBAFunctions.h @@ -850,6 +850,30 @@ public: // IBAFunctions return S_OK; } + virtual STDMETHODIMP OnThemeControlWmCommand( + __in WPARAM /*wParam*/, + __in LPCWSTR /*wzName*/, + __in WORD /*wId*/, + __in HWND /*hWnd*/, + __inout BOOL* /*pfProcessed*/, + __inout LRESULT* /*plResult*/ + ) + { + return S_OK; + } + + virtual STDMETHODIMP OnThemeControlWmNotify( + __in LPNMHDR /*lParam*/, + __in LPCWSTR /*wzName*/, + __in WORD /*wId*/, + __in HWND /*hWnd*/, + __inout BOOL* /*pfProcessed*/, + __inout LRESULT* /*plResult*/ + ) + { + return S_OK; + } + protected: CBalBaseBAFunctions( __in HMODULE hModule, diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h b/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h index efe22ddd..1d51c5b6 100644 --- a/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h +++ b/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h @@ -33,6 +33,24 @@ static HRESULT BalBaseBAFunctionsProcOnThemeControlLoading( return pBAFunctions->OnThemeControlLoading(pArgs->wzName, &pResults->fProcessed, &pResults->wId); } +static HRESULT BalBaseBAFunctionsProcOnThemeControlWmCommand( + __in IBAFunctions* pBAFunctions, + __in BA_FUNCTIONS_ONTHEMECONTROLWMCOMMAND_ARGS* pArgs, + __inout BA_FUNCTIONS_ONTHEMECONTROLWMCOMMAND_RESULTS* pResults + ) +{ + return pBAFunctions->OnThemeControlWmCommand(pArgs->wParam, pArgs->wzName, pArgs->wId, pArgs->hWnd, &pResults->fProcessed, &pResults->lResult); +} + +static HRESULT BalBaseBAFunctionsProcOnThemeControlWmNotify( + __in IBAFunctions* pBAFunctions, + __in BA_FUNCTIONS_ONTHEMECONTROLWMNOTIFY_ARGS* pArgs, + __inout BA_FUNCTIONS_ONTHEMECONTROLWMNOTIFY_RESULTS* pResults + ) +{ + return pBAFunctions->OnThemeControlWmNotify(pArgs->lParam, pArgs->wzName, pArgs->wId, pArgs->hWnd, &pResults->fProcessed, &pResults->lResult); +} + /******************************************************************* BalBaseBAFunctionsProc - requires pvContext to be of type IBAFunctions. Provides a default mapping between the message based BAFunctions interface and @@ -137,6 +155,12 @@ static HRESULT WINAPI BalBaseBAFunctionsProc( case BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLLOADING: hr = BalBaseBAFunctionsProcOnThemeControlLoading(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults)); break; + case BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLWMCOMMAND: + hr = BalBaseBAFunctionsProcOnThemeControlWmCommand(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults)); + break; + case BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLWMNOTIFY: + hr = BalBaseBAFunctionsProcOnThemeControlWmNotify(pBAFunctions, reinterpret_cast(pvArgs), reinterpret_cast(pvResults)); + break; } } diff --git a/src/api/burn/balutil/inc/IBAFunctions.h b/src/api/burn/balutil/inc/IBAFunctions.h index d41b7c9b..63395e1e 100644 --- a/src/api/burn/balutil/inc/IBAFunctions.h +++ b/src/api/burn/balutil/inc/IBAFunctions.h @@ -39,4 +39,26 @@ DECLARE_INTERFACE_IID_(IBAFunctions, IBootstrapperApplication, "0FB445ED-17BD-49 __inout BOOL* pfProcessed, __inout WORD* pwId ) = 0; + + // OnThemeControlWmCommand - Called when WM_COMMAND is received for a control. + // + STDMETHOD(OnThemeControlWmCommand)( + __in WPARAM wParam, + __in LPCWSTR wzName, + __in WORD wId, + __in HWND hWnd, + __inout BOOL* pfProcessed, + __inout LRESULT* plResult + ) = 0; + + // OnThemeControlWmNotify - Called when WM_NOTIFY is received for a control. + // + STDMETHOD(OnThemeControlWmNotify)( + __in LPNMHDR lParam, + __in LPCWSTR wzName, + __in WORD wId, + __in HWND hWnd, + __inout BOOL* pfProcessed, + __inout LRESULT* plResult + ) = 0; }; -- cgit v1.2.3-55-g6feb