ReactOS 0.4.15-dev-8348-gc1b9bb5
CMenuSite Class Reference

#include <CMenuSite.h>

Inheritance diagram for CMenuSite:
Collaboration diagram for CMenuSite:

Public Member Functions

 CMenuSite ()
 
virtual ~CMenuSite ()
 
STDMETHOD() AddBand (IUnknown *punk) override
 
STDMETHOD() EnumBands (UINT uBand, DWORD *pdwBandID) override
 
STDMETHOD() QueryBand (DWORD dwBandID, IDeskBand **ppstb, DWORD *pdwState, LPWSTR pszName, int cchName) override
 
STDMETHOD() GetBandObject (DWORD dwBandID, REFIID riid, VOID **ppv) override
 
STDMETHOD() SetDeskBarSite (IUnknown *punkSite) override
 
STDMETHOD() GetSize (DWORD dwWhich, LPRECT prc) override
 
STDMETHOD() UIActivateDBC (DWORD dwState) override
 
STDMETHOD() GetWindow (HWND *phwnd) override
 
STDMETHOD() QueryStatus (const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) override
 
STDMETHOD() Exec (const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override
 
STDMETHOD() UIActivateIO (BOOL fActivate, LPMSG lpMsg) override
 
STDMETHOD() HasFocusIO () override
 
STDMETHOD() TranslateAcceleratorIO (LPMSG lpMsg) override
 
STDMETHOD() OnFocusChangeIS (IUnknown *punkObj, BOOL fSetFocus) override
 
STDMETHOD() IsWindowOwner (HWND hWnd) override
 
STDMETHOD() OnWinEvent (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) override
 
STDMETHOD() QueryService (REFGUID guidService, REFIID riid, void **ppvObject) override
 
virtual BOOL ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD mapId=0)
 
STDMETHOD() ContextSensitiveHelp (BOOL fEnterMode) override
 
STDMETHOD() GetBandSiteInfo (BANDSITEINFO *pbsinfo) override
 
STDMETHOD() RemoveBand (DWORD dwBandID) override
 
STDMETHOD() SetBandSiteInfo (const BANDSITEINFO *pbsinfo) override
 
STDMETHOD() SetBandState (DWORD dwBandID, DWORD dwMask, DWORD dwState) override
 
STDMETHOD() SetModeDBC (DWORD dwMode) override
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
HRESULT AddBand ([in] IUnknown *punk)
 
HRESULT EnumBands ([in] UINT uBand, [out] DWORD *pdwBandID)
 
HRESULT QueryBand ([in] DWORD dwBandID, [out] IDeskBand **ppstb, [out] DWORD *pdwState, [out, string, size_is(cchName)] LPWSTR pszName, [in] int cchName)
 
HRESULT SetBandState ([in] DWORD dwBandID, [in] DWORD dwMask, [in] DWORD dwState)
 
HRESULT RemoveBand ([in] DWORD dwBandID)
 
HRESULT GetBandObject ([in] DWORD dwBandID, [in] REFIID riid, [out, iid_is(riid)] void **ppv)
 
HRESULT SetBandSiteInfo ([in] const BANDSITEINFO *pbsinfo)
 
HRESULT GetBandSiteInfo ([in, out] BANDSITEINFO *pbsinfo)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
HRESULT QueryStatus ([in, unique] const GUID *pguidCmdGroup, [in] ULONG cCmds, [in, out, size_is(cCmds)] OLECMD prgCmds[], [in, out, unique] OLECMDTEXT *pCmdText)
 
HRESULT Exec ([in, unique] const GUID *pguidCmdGroup, [in] DWORD nCmdID, [in] DWORD nCmdexecopt, [in, unique] VARIANT *pvaIn, [in, out, unique] VARIANT *pvaOut)
 
- Public Member Functions inherited from IServiceProvider
HRESULT QueryService ([in] REFGUID guidService, [in] REFIID riid, [out] void **ppvObject)
 
HRESULT RemoteQueryService ([in] REFGUID guidService, [in] REFIID riid, [out, iid_is(riid)] IUnknown **ppvObject)
 

Private Member Functions

IUnknownToIUnknown ()
 

Private Attributes

CComPtr< IUnknownm_DeskBarSite
 
CComPtr< IUnknownm_BandObject
 
CComPtr< IDeskBandm_DeskBand
 
CComPtr< IWinEventHandler > m_WinEventHandler
 
HWND m_hWndBand
 

Additional Inherited Members

- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IOleCommandTarget
enum  OLECMDF {
  OLECMDF_SUPPORTED = 0x1 , OLECMDF_ENABLED = 0x2 , OLECMDF_LATCHED = 0x4 , OLECMDF_NINCHED = 0x8 ,
  OLECMDF_INVISIBLE = 0x10 , OLECMDF_DEFHIDEONCTXTMENU = 0x20
}
 
enum  OLECMDTEXTF { OLECMDTEXTF_NONE = 0 , OLECMDTEXTF_NAME = 1 , OLECMDTEXTF_STATUS = 2 }
 
enum  OLECMDEXECOPT { OLECMDEXECOPT_DODEFAULT = 0 , OLECMDEXECOPT_PROMPTUSER = 1 , OLECMDEXECOPT_DONTPROMPTUSER = 2 , OLECMDEXECOPT_SHOWHELP = 3 }
 
enum  OLECMDID {
  OLECMDID_OPEN = 1 , OLECMDID_NEW = 2 , OLECMDID_SAVE = 3 , OLECMDID_SAVEAS = 4 ,
  OLECMDID_SAVECOPYAS = 5 , OLECMDID_PRINT = 6 , OLECMDID_PRINTPREVIEW = 7 , OLECMDID_PAGESETUP = 8 ,
  OLECMDID_SPELL = 9 , OLECMDID_PROPERTIES = 10 , OLECMDID_CUT = 11 , OLECMDID_COPY = 12 ,
  OLECMDID_PASTE = 13 , OLECMDID_PASTESPECIAL = 14 , OLECMDID_UNDO = 15 , OLECMDID_REDO = 16 ,
  OLECMDID_SELECTALL = 17 , OLECMDID_CLEARSELECTION = 18 , OLECMDID_ZOOM = 19 , OLECMDID_GETZOOMRANGE = 20 ,
  OLECMDID_UPDATECOMMANDS = 21 , OLECMDID_REFRESH = 22 , OLECMDID_STOP = 23 , OLECMDID_HIDETOOLBARS = 24 ,
  OLECMDID_SETPROGRESSMAX = 25 , OLECMDID_SETPROGRESSPOS = 26 , OLECMDID_SETPROGRESSTEXT = 27 , OLECMDID_SETTITLE = 28 ,
  OLECMDID_SETDOWNLOADSTATE = 29 , OLECMDID_STOPDOWNLOAD = 30 , OLECMDID_ONTOOLBARACTIVATED = 31 , OLECMDID_FIND = 32 ,
  OLECMDID_DELETE = 33 , OLECMDID_HTTPEQUIV = 34 , OLECMDID_HTTPEQUIV_DONE = 35 , OLECMDID_ENABLE_INTERACTION = 36 ,
  OLECMDID_ONUNLOAD = 37 , OLECMDID_PROPERTYBAG2 = 38 , OLECMDID_PREREFRESH = 39 , OLECMDID_SHOWSCRIPTERROR = 40 ,
  OLECMDID_SHOWMESSAGE = 41 , OLECMDID_SHOWFIND = 42 , OLECMDID_SHOWPAGESETUP = 43 , OLECMDID_SHOWPRINT = 44 ,
  OLECMDID_CLOSE = 45 , OLECMDID_ALLOWUILESSSAVEAS = 46 , OLECMDID_DONTDOWNLOADCSS = 47 , OLECMDID_UPDATEPAGESTATUS = 48 ,
  OLECMDID_PRINT2 = 49 , OLECMDID_PRINTPREVIEW2 = 50 , OLECMDID_SETPRINTTEMPLATE = 51 , OLECMDID_GETPRINTTEMPLATE = 52 ,
  OLECMDID_PAGEACTIONBLOCKED = 55 , OLECMDID_PAGEACTIONUIQUERY = 56 , OLECMDID_FOCUSVIEWCONTROLS = 57 , OLECMDID_FOCUSVIEWCONTROLSQUERY = 58 ,
  OLECMDID_SHOWPAGEACTIONMENU = 59 , OLECMDID_ADDTRAVELENTRY = 60 , OLECMDID_UPDATETRAVELENTRY = 61 , OLECMDID_UPDATEBACKFORWARDSTATE = 62 ,
  OLECMDID_OPTICAL_ZOOM = 63 , OLECMDID_OPTICAL_GETZOOMRANGE = 64 , OLECMDID_WINDOWSTATECHANGED = 65 , OLECMDID_ACTIVEXINSTALLSCOPE = 66 ,
  OLECMDID_UPDATETRAVELENTRY_DATARECOVERY = 67 , OLECMDID_SHOWTASKDLG = 68 , OLECMDID_POPSTATEEVENT = 69 , OLECMDID_VIEWPORT_MODE = 70 ,
  OLECMDID_LAYOUT_VIEWPORT_WIDTH = 71 , OLECMDID_VISUAL_VIEWPORT_EXCLUDE_BOTTOM = 72 , OLECMDID_USER_OPTICAL_ZOOM = 73 , OLECMDID_PAGEAVAILABLE = 74 ,
  OLECMDID_GETUSERSCALABLE = 75 , OLECMDID_UPDATE_CARET = 76 , OLECMDID_ENABLE_VISIBILITY = 77 , OLECMDID_MEDIA_PLAYBACK = 78
}
 
typedef IOleCommandTargetLPOLECOMMANDTARGET
 
typedef enum IOleCommandTarget::OLECMDF OLECMDF
 
typedef struct IOleCommandTarget::_tagOLECMD OLECMD
 
typedef struct IOleCommandTarget::_tagOLECMDTEXT OLECMDTEXT
 
typedef enum IOleCommandTarget::OLECMDTEXTF OLECMDTEXTF
 
typedef enum IOleCommandTarget::OLECMDEXECOPT OLECMDEXECOPT
 
typedef enum IOleCommandTarget::OLECMDID OLECMDID
 
- Public Types inherited from IServiceProvider
typedef IServiceProviderLPSERVICEPROVIDER
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 

Detailed Description

Definition at line 22 of file CMenuSite.h.

Constructor & Destructor Documentation

◆ CMenuSite()

CMenuSite::CMenuSite ( )

Definition at line 26 of file CMenuSite.cpp.

26 :
32{
33}
CComPtr< IDeskBand > m_DeskBand
Definition: CMenuSite.h:37
HWND m_hWndBand
Definition: CMenuSite.h:39
CComPtr< IUnknown > m_DeskBarSite
Definition: CMenuSite.h:35
CComPtr< IUnknown > m_BandObject
Definition: CMenuSite.h:36
CComPtr< IWinEventHandler > m_WinEventHandler
Definition: CMenuSite.h:38
#define NULL
Definition: types.h:112

◆ ~CMenuSite()

virtual CMenuSite::~CMenuSite ( )
inlinevirtual

Definition at line 43 of file CMenuSite.h.

43{}

Member Function Documentation

◆ AddBand()

HRESULT STDMETHODCALLTYPE CMenuSite::AddBand ( IUnknown punk)
override

Implements IBandSite.

Definition at line 36 of file CMenuSite.cpp.

37{
38 HRESULT hr;
39
40 // Little helper, for readability
41#define TO_HRESULT(x) ((HRESULT)(S_OK+(x)))
42
43 CComPtr<IUnknown> pUnknown;
44
46
48 return TO_HRESULT(0);
49
50 if (m_BandObject)
51 {
54 return hr;
55 }
56
61
62 if (!pUnknown)
63 return TO_HRESULT(0);
64
67 return hr;
68
71 return hr;
72
74 if (FAILED_UNEXPECTEDLY(hr))
75 return hr;
76
79 return hr;
80
82
83 return TO_HRESULT(0);
84}
#define TO_HRESULT(x)
IUnknown * ToIUnknown()
Definition: CMenuSite.h:106
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1332
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: ordinal.c:1407
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
HRESULT hr
Definition: shlfolder.c:183
#define IID_PPV_ARG(Itype, ppType)

◆ ContextSensitiveHelp()

HRESULT STDMETHODCALLTYPE CMenuSite::ContextSensitiveHelp ( BOOL  fEnterMode)
override

Definition at line 314 of file CMenuSite.cpp.

315{
316 return E_NOTIMPL;
317}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ EnumBands()

HRESULT STDMETHODCALLTYPE CMenuSite::EnumBands ( UINT  uBand,
DWORD pdwBandID 
)
override

Implements IBandSite.

Definition at line 86 of file CMenuSite.cpp.

87{
88 if (uBand != 0)
89 return E_FAIL;
90
91 *pdwBandID = 0;
92
93 return S_OK;
94}
#define E_FAIL
Definition: ddrawi.h:102
#define S_OK
Definition: intsafe.h:52

◆ Exec()

HRESULT STDMETHODCALLTYPE CMenuSite::Exec ( const GUID pguidCmdGroup,
DWORD  nCmdID,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
override

Implements IOleCommandTarget.

Definition at line 198 of file CMenuSite.cpp.

199{
200 // Forward Exec calls directly to the parent deskbar
201 return IUnknown_Exec(m_DeskBarSite, *pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
202}
HRESULT WINAPI IUnknown_Exec(IUnknown *lpUnknown, REFGUID pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: ordinal.c:1083

◆ GetBandObject()

HRESULT STDMETHODCALLTYPE CMenuSite::GetBandObject ( DWORD  dwBandID,
REFIID  riid,
VOID **  ppv 
)
override

Implements IBandSite.

Definition at line 96 of file CMenuSite.cpp.

97{
98 if (dwBandID != 0 || m_BandObject == NULL)
99 {
100 *ppv = NULL;
101 return E_NOINTERFACE;
102 }
103
104 return m_BandObject->QueryInterface(riid, ppv);
105}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ GetBandSiteInfo()

HRESULT STDMETHODCALLTYPE CMenuSite::GetBandSiteInfo ( BANDSITEINFO pbsinfo)
override

Implements IBandSite.

Definition at line 319 of file CMenuSite.cpp.

320{
321 return E_NOTIMPL;
322}

◆ GetSize()

HRESULT STDMETHODCALLTYPE CMenuSite::GetSize ( DWORD  dwWhich,
LPRECT  prc 
)
override

Definition at line 128 of file CMenuSite.cpp.

129{
130 memset(prc, 0, sizeof(*prc));
131
132 if (dwWhich != 0)
133 return S_OK;
134
135 if (m_DeskBand == NULL)
136 return S_OK;
137
138 DESKBANDINFO info = { 0 };
139 info.dwMask = DBIM_MAXSIZE;
140
141 m_DeskBand->GetBandInfo(0, 0, &info);
142
143 prc->right = info.ptMaxSize.x;
144 prc->bottom = info.ptMaxSize.y;
145
146 return S_OK;
147}
_Out_ LPRECT prc
Definition: ntgdi.h:1658
#define memset(x, y, z)
Definition: compat.h:39
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309

◆ GetWindow()

HRESULT STDMETHODCALLTYPE CMenuSite::GetWindow ( HWND phwnd)
override

Definition at line 149 of file CMenuSite.cpp.

150{
151 if (!IsWindow())
152 return E_FAIL;
153
154 *phwnd = m_hWnd;
155
156 return S_OK;
157}
BOOL WINAPI IsWindow(_In_opt_ HWND)

◆ HasFocusIO()

HRESULT STDMETHODCALLTYPE CMenuSite::HasFocusIO ( )
override

Definition at line 349 of file CMenuSite.cpp.

350{
351 return S_FALSE;
352}
#define S_FALSE
Definition: winerror.h:2357

◆ IsWindowOwner()

HRESULT STDMETHODCALLTYPE CMenuSite::IsWindowOwner ( HWND  hWnd)
override

Definition at line 159 of file CMenuSite.cpp.

160{
161 if (hWnd == m_hWnd)
162 return S_OK;
163
165 return S_FALSE;
166
167 return m_WinEventHandler->IsWindowOwner(hWnd);
168}
HWND hWnd
Definition: settings.c:17

◆ OnFocusChangeIS()

HRESULT STDMETHODCALLTYPE CMenuSite::OnFocusChangeIS ( IUnknown punkObj,
BOOL  fSetFocus 
)
override

Definition at line 354 of file CMenuSite.cpp.

355{
356 return S_OK;
357}

◆ OnWinEvent()

HRESULT STDMETHODCALLTYPE CMenuSite::OnWinEvent ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
LRESULT theResult 
)
override

Definition at line 170 of file CMenuSite.cpp.

171{
173 return S_OK;
174
175 return m_WinEventHandler->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
176}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139

◆ ProcessWindowMessage()

BOOL CMenuSite::ProcessWindowMessage ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
LRESULT lResult,
DWORD  mapId = 0 
)
virtual

Definition at line 273 of file CMenuSite.cpp.

274{
275 HWND hWndTarget = NULL;
276 CComPtr<IUnknown> protectThis(this->ToIUnknown());
277
278 switch (uMsg)
279 {
280 case WM_SIZE:
281 if (m_BandObject)
282 {
283 CComPtr<IMenuPopup> pMenuPopup;
284 if (SUCCEEDED(m_BandObject->QueryInterface(IID_PPV_ARG(IMenuPopup, &pMenuPopup))))
285 {
286 RECT Rect = { 0 };
288 pMenuPopup->OnPosRectChangeDB(&Rect);
289 }
290 }
291 hWndTarget = hWnd;
292 lResult = 1;
293 break;
294 case WM_NOTIFY:
295 hWndTarget = reinterpret_cast<LPNMHDR>(lParam)->hwndFrom;
296 break;
297 case WM_COMMAND:
298 hWndTarget = (HWND) lParam;
299 break;
300 default:
301 return FALSE;
302 }
303
304 if (hWndTarget && m_WinEventHandler &&
305 m_WinEventHandler->IsWindowOwner(hWndTarget) == S_OK)
306 {
307 if (SUCCEEDED(m_WinEventHandler->OnWinEvent(hWndTarget, uMsg, wParam, lParam, &lResult)))
308 return TRUE;
309 }
310
311 return FALSE;
312}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HANDLE HWND
Definition: compat.h:19
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define WM_NOTIFY
Definition: richedit.h:61
#define WM_SIZE
Definition: winuser.h:1611
#define WM_COMMAND
Definition: winuser.h:1740
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

◆ QueryBand()

HRESULT STDMETHODCALLTYPE CMenuSite::QueryBand ( DWORD  dwBandID,
IDeskBand **  ppstb,
DWORD pdwState,
LPWSTR  pszName,
int  cchName 
)
override

Implements IBandSite.

Definition at line 107 of file CMenuSite.cpp.

108{
109 if (dwBandID != 0)
110 return E_FAIL;
111
112 if (!m_BandObject)
113 {
114 *ppstb = NULL;
115 return E_NOINTERFACE;
116 }
117
118 HRESULT hr = m_BandObject->QueryInterface(IID_PPV_ARG(IDeskBand, ppstb));
119
120 *pdwState = 1;
121
122 if (cchName > 0)
123 pszName[0] = 0;
124
125 return hr;
126}
_In_ PSID _Out_writes_to_opt_ cchName LPSTR _Inout_ LPDWORD cchName
Definition: winbase.h:2767

◆ QueryService()

HRESULT STDMETHODCALLTYPE CMenuSite::QueryService ( REFGUID  guidService,
REFIID  riid,
void **  ppvObject 
)
override

Implements IServiceProvider.

Definition at line 178 of file CMenuSite.cpp.

179{
180 *ppvObject = NULL;
181
182 if (IsEqualGUID(guidService, SID_SMenuBandBottom) ||
183 IsEqualGUID(guidService, SID_SMenuBandBottomSelected) ||
184 IsEqualGUID(guidService, SID_SMenuBandChild))
185 {
186 if (m_BandObject == NULL)
187 return E_NOINTERFACE;
188
189 return IUnknown_QueryService(m_BandObject, guidService, riid, ppvObject);
190 }
191
192 if (!m_DeskBarSite)
193 return E_NOINTERFACE;
194
195 return IUnknown_QueryService(m_DeskBarSite, guidService, riid, ppvObject);
196}
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1497
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

◆ QueryStatus()

HRESULT STDMETHODCALLTYPE CMenuSite::QueryStatus ( const GUID pguidCmdGroup,
ULONG  cCmds,
OLECMD  prgCmds[],
OLECMDTEXT pCmdText 
)
override

Implements IOleCommandTarget.

Definition at line 204 of file CMenuSite.cpp.

205{
206 // Forward QueryStatus calls directly to the parent deskbar
207 return IUnknown_QueryStatus(m_DeskBarSite, *pguidCmdGroup, cCmds, prgCmds, pCmdText);
208}
HRESULT WINAPI IUnknown_QueryStatus(IUnknown *lpUnknown, REFGUID pguidCmdGroup, ULONG cCmds, OLECMD *prgCmds, OLECMDTEXT *pCmdText)
Definition: ordinal.c:1044

◆ RemoveBand()

HRESULT STDMETHODCALLTYPE CMenuSite::RemoveBand ( DWORD  dwBandID)
override

Implements IBandSite.

Definition at line 324 of file CMenuSite.cpp.

325{
326 return E_NOTIMPL;
327}

◆ SetBandSiteInfo()

HRESULT STDMETHODCALLTYPE CMenuSite::SetBandSiteInfo ( const BANDSITEINFO pbsinfo)
override

Implements IBandSite.

Definition at line 329 of file CMenuSite.cpp.

330{
331 return E_NOTIMPL;
332}

◆ SetBandState()

HRESULT STDMETHODCALLTYPE CMenuSite::SetBandState ( DWORD  dwBandID,
DWORD  dwMask,
DWORD  dwState 
)
override

Implements IBandSite.

Definition at line 334 of file CMenuSite.cpp.

335{
336 return E_NOTIMPL;
337}

◆ SetDeskBarSite()

HRESULT STDMETHODCALLTYPE CMenuSite::SetDeskBarSite ( IUnknown punkSite)
override

Definition at line 210 of file CMenuSite.cpp.

211{
212 HRESULT hr;
213
214 CComPtr<IUnknown> protectThis(this->ToIUnknown());
215
216 // Only initialize if a parent site is being assigned
217 if (punkSite)
218 {
219 HWND hWndSite;
220
222
223 hr = IUnknown_GetWindow(punkSite, &hWndSite);
224
225 if (FAILED(hr) || !hWndSite)
226 return E_FAIL;
227
228 if (!m_hWnd)
229 {
230 Create(hWndSite, NULL, L"MenuSite");
231 }
232
233 m_DeskBarSite = punkSite;
234 }
235 else
236 {
237 // Otherwise, deinitialize.
238 if (m_DeskBand)
239 {
240 m_DeskBand->CloseDW(0);
241 }
242
244
249 if (m_hWnd)
252 }
253
254 return S_OK;
255}
@ Create
Definition: registry.c:563
#define FAILED(hr)
Definition: intsafe.h:51
#define L(x)
Definition: ntvdm.h:50
BOOL WINAPI DestroyWindow(_In_ HWND)

◆ SetModeDBC()

HRESULT STDMETHODCALLTYPE CMenuSite::SetModeDBC ( DWORD  dwMode)
override

Definition at line 339 of file CMenuSite.cpp.

340{
341 return E_NOTIMPL;
342}

◆ ToIUnknown()

IUnknown * CMenuSite::ToIUnknown ( )
inlineprivate

Definition at line 106 of file CMenuSite.h.

106{ return static_cast<IDeskBarClient*>(this); }

Referenced by AddBand(), ProcessWindowMessage(), and SetDeskBarSite().

◆ TranslateAcceleratorIO()

HRESULT STDMETHODCALLTYPE CMenuSite::TranslateAcceleratorIO ( LPMSG  lpMsg)
override

Definition at line 344 of file CMenuSite.cpp.

345{
346 return S_FALSE;
347}

◆ UIActivateDBC()

HRESULT STDMETHODCALLTYPE CMenuSite::UIActivateDBC ( DWORD  dwState)
override

Definition at line 257 of file CMenuSite.cpp.

258{
259 if (!m_DeskBand)
260 return S_OK;
261
262 return m_DeskBand->ShowDW(dwState != 0);
263}

◆ UIActivateIO()

HRESULT STDMETHODCALLTYPE CMenuSite::UIActivateIO ( BOOL  fActivate,
LPMSG  lpMsg 
)
override

Definition at line 265 of file CMenuSite.cpp.

266{
267 if (lpMsg)
268 return E_FAIL;
269
270 return IUnknown_UIActivateIO(m_BandObject, fActivate, lpMsg);
271}
HRESULT WINAPI IUnknown_UIActivateIO(IUnknown *unknown, BOOL activate, LPMSG msg)
Definition: ordinal.c:1629

Member Data Documentation

◆ m_BandObject

CComPtr<IUnknown> CMenuSite::m_BandObject
private

◆ m_DeskBand

CComPtr<IDeskBand> CMenuSite::m_DeskBand
private

Definition at line 37 of file CMenuSite.h.

Referenced by AddBand(), GetSize(), SetDeskBarSite(), and UIActivateDBC().

◆ m_DeskBarSite

CComPtr<IUnknown> CMenuSite::m_DeskBarSite
private

Definition at line 35 of file CMenuSite.h.

Referenced by Exec(), QueryService(), QueryStatus(), and SetDeskBarSite().

◆ m_hWndBand

HWND CMenuSite::m_hWndBand
private

Definition at line 39 of file CMenuSite.h.

Referenced by AddBand(), and SetDeskBarSite().

◆ m_WinEventHandler

CComPtr<IWinEventHandler> CMenuSite::m_WinEventHandler
private

Definition at line 38 of file CMenuSite.h.

Referenced by AddBand(), IsWindowOwner(), OnWinEvent(), ProcessWindowMessage(), and SetDeskBarSite().


The documentation for this class was generated from the following files: