4 * Copyright 2014 David Quintana
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 WINE_DEFAULT_DEBUG_CHANNEL(CMenuBandWrap
);
26 public CComCoClass
<CMenuBandWrap
>,
27 public CComObjectRootEx
<CComMultiThreadModelNoCS
>,
29 public IObjectWithSite
,
31 public IPersistStream
,
32 public IOleCommandTarget
,
33 public IServiceProvider
,
37 public IWinEventHandler
,
45 IUnknown
* m_IUnknown
;
46 IDeskBand
* m_IDeskBand
;
47 IDockingWindow
* m_IDockingWindow
;
48 IOleWindow
* m_IOleWindow
;
49 IObjectWithSite
* m_IObjectWithSite
;
50 IInputObject
* m_IInputObject
;
51 IPersistStream
* m_IPersistStream
;
52 IPersist
* m_IPersist
;
53 IOleCommandTarget
* m_IOleCommandTarget
;
54 IServiceProvider
* m_IServiceProvider
;
55 IMenuPopup
* m_IMenuPopup
;
56 IDeskBar
* m_IDeskBar
;
57 IMenuBand
* m_IMenuBand
;
58 IShellMenu2
* m_IShellMenu2
;
59 IShellMenu
* m_IShellMenu
;
60 IWinEventHandler
* m_IWinEventHandler
;
61 IShellMenuAcc
* m_IShellMenuAcc
;
67 // *** IDeskBand methods ***
68 virtual HRESULT STDMETHODCALLTYPE
GetBandInfo(DWORD dwBandID
, DWORD dwViewMode
, DESKBANDINFO
*pdbi
);
70 // *** IDockingWindow methods ***
71 virtual HRESULT STDMETHODCALLTYPE
ShowDW(BOOL fShow
);
72 virtual HRESULT STDMETHODCALLTYPE
CloseDW(DWORD dwReserved
);
73 virtual HRESULT STDMETHODCALLTYPE
ResizeBorderDW(LPCRECT prcBorder
, IUnknown
*punkToolbarSite
, BOOL fReserved
);
75 // *** IOleWindow methods ***
76 virtual HRESULT STDMETHODCALLTYPE
GetWindow(HWND
*phwnd
);
77 virtual HRESULT STDMETHODCALLTYPE
ContextSensitiveHelp(BOOL fEnterMode
);
79 // *** IObjectWithSite methods ***
80 virtual HRESULT STDMETHODCALLTYPE
SetSite(IUnknown
*pUnkSite
);
81 virtual HRESULT STDMETHODCALLTYPE
GetSite(REFIID riid
, PVOID
*ppvSite
);
83 // *** IInputObject methods ***
84 virtual HRESULT STDMETHODCALLTYPE
UIActivateIO(BOOL fActivate
, LPMSG lpMsg
);
85 virtual HRESULT STDMETHODCALLTYPE
HasFocusIO();
86 virtual HRESULT STDMETHODCALLTYPE
TranslateAcceleratorIO(LPMSG lpMsg
);
88 // *** IPersistStream methods ***
89 virtual HRESULT STDMETHODCALLTYPE
IsDirty();
90 virtual HRESULT STDMETHODCALLTYPE
Load(IStream
*pStm
);
91 virtual HRESULT STDMETHODCALLTYPE
Save(IStream
*pStm
, BOOL fClearDirty
);
92 virtual HRESULT STDMETHODCALLTYPE
GetSizeMax(ULARGE_INTEGER
*pcbSize
);
94 // *** IPersist methods ***
95 virtual HRESULT STDMETHODCALLTYPE
GetClassID(CLSID
*pClassID
);
97 // *** IOleCommandTarget methods ***
98 virtual HRESULT STDMETHODCALLTYPE
QueryStatus(const GUID
*pguidCmdGroup
, ULONG cCmds
, OLECMD prgCmds
[], OLECMDTEXT
*pCmdText
);
99 virtual HRESULT STDMETHODCALLTYPE
Exec(const GUID
*pguidCmdGroup
, DWORD nCmdID
, DWORD nCmdexecopt
, VARIANT
*pvaIn
, VARIANT
*pvaOut
);
101 // *** IServiceProvider methods ***
102 virtual HRESULT STDMETHODCALLTYPE
QueryService(REFGUID guidService
, REFIID riid
, void **ppvObject
);
104 // *** IMenuPopup methods ***
105 virtual HRESULT STDMETHODCALLTYPE
Popup(POINTL
*ppt
, RECTL
*prcExclude
, MP_POPUPFLAGS dwFlags
);
106 virtual HRESULT STDMETHODCALLTYPE
OnSelect(DWORD dwSelectType
);
107 virtual HRESULT STDMETHODCALLTYPE
SetSubMenu(IMenuPopup
*pmp
, BOOL fSet
);
109 // *** IDeskBar methods ***
110 virtual HRESULT STDMETHODCALLTYPE
SetClient(IUnknown
*punkClient
);
111 virtual HRESULT STDMETHODCALLTYPE
GetClient(IUnknown
**ppunkClient
);
112 virtual HRESULT STDMETHODCALLTYPE
OnPosRectChangeDB(RECT
*prc
);
114 // *** IMenuBand methods ***
115 virtual HRESULT STDMETHODCALLTYPE
IsMenuMessage(MSG
*pmsg
);
116 virtual HRESULT STDMETHODCALLTYPE
TranslateMenuMessage(MSG
*pmsg
, LRESULT
*plRet
);
118 // *** IShellMenu methods ***
119 virtual HRESULT STDMETHODCALLTYPE
Initialize(IShellMenuCallback
*psmc
, UINT uId
, UINT uIdAncestor
, DWORD dwFlags
);
120 virtual HRESULT STDMETHODCALLTYPE
GetMenuInfo(IShellMenuCallback
**ppsmc
, UINT
*puId
, UINT
*puIdAncestor
, DWORD
*pdwFlags
);
121 virtual HRESULT STDMETHODCALLTYPE
SetShellFolder(IShellFolder
*psf
, LPCITEMIDLIST pidlFolder
, HKEY hKey
, DWORD dwFlags
);
122 virtual HRESULT STDMETHODCALLTYPE
GetShellFolder(DWORD
*pdwFlags
, LPITEMIDLIST
*ppidl
, REFIID riid
, void **ppv
);
123 virtual HRESULT STDMETHODCALLTYPE
SetMenu(HMENU hmenu
, HWND hwnd
, DWORD dwFlags
);
124 virtual HRESULT STDMETHODCALLTYPE
GetMenu(HMENU
*phmenu
, HWND
*phwnd
, DWORD
*pdwFlags
);
125 virtual HRESULT STDMETHODCALLTYPE
InvalidateItem(LPSMDATA psmd
, DWORD dwFlags
);
126 virtual HRESULT STDMETHODCALLTYPE
GetState(LPSMDATA psmd
);
127 virtual HRESULT STDMETHODCALLTYPE
SetMenuToolbar(IUnknown
*punk
, DWORD dwFlags
);
129 // *** IWinEventHandler methods ***
130 virtual HRESULT STDMETHODCALLTYPE
OnWinEvent(HWND hWnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
, LRESULT
*theResult
);
131 virtual HRESULT STDMETHODCALLTYPE
IsWindowOwner(HWND hWnd
);
133 // *** IShellMenu2 methods ***
134 virtual HRESULT STDMETHODCALLTYPE
GetSubMenu(THIS
);
135 virtual HRESULT STDMETHODCALLTYPE
SetToolbar(THIS
);
136 virtual HRESULT STDMETHODCALLTYPE
SetMinWidth(THIS
);
137 virtual HRESULT STDMETHODCALLTYPE
SetNoBorder(THIS
);
138 virtual HRESULT STDMETHODCALLTYPE
SetTheme(THIS
);
140 // *** IShellMenuAcc methods ***
141 virtual HRESULT STDMETHODCALLTYPE
GetTop(THIS
);
142 virtual HRESULT STDMETHODCALLTYPE
GetBottom(THIS
);
143 virtual HRESULT STDMETHODCALLTYPE
GetTracked(THIS
);
144 virtual HRESULT STDMETHODCALLTYPE
GetParentSite(THIS
);
145 virtual HRESULT STDMETHODCALLTYPE
GetState(THIS
);
146 virtual HRESULT STDMETHODCALLTYPE
DoDefaultAction(THIS
);
147 virtual HRESULT STDMETHODCALLTYPE
IsEmpty(THIS
);
149 DECLARE_NOT_AGGREGATABLE(CMenuBandWrap
)
150 DECLARE_PROTECT_FINAL_CONSTRUCT()
152 BEGIN_COM_MAP(CMenuBandWrap
)
153 COM_INTERFACE_ENTRY_IID(IID_IDeskBar
, IMenuPopup
)
154 COM_INTERFACE_ENTRY_IID(IID_IShellMenu
, IShellMenu
)
155 COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget
, IOleCommandTarget
)
156 COM_INTERFACE_ENTRY_IID(IID_IOleWindow
, IDeskBand
)
157 COM_INTERFACE_ENTRY_IID(IID_IDockingWindow
, IDockingWindow
)
158 COM_INTERFACE_ENTRY_IID(IID_IDeskBand
, IDeskBand
)
159 COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite
, IObjectWithSite
)
160 COM_INTERFACE_ENTRY_IID(IID_IInputObject
, IInputObject
)
161 COM_INTERFACE_ENTRY_IID(IID_IPersistStream
, IPersistStream
)
162 COM_INTERFACE_ENTRY_IID(IID_IPersist
, IPersistStream
)
163 COM_INTERFACE_ENTRY_IID(IID_IServiceProvider
, IServiceProvider
)
164 COM_INTERFACE_ENTRY_IID(IID_IMenuPopup
, IMenuPopup
)
165 COM_INTERFACE_ENTRY_IID(IID_IMenuBand
, IMenuBand
)
166 COM_INTERFACE_ENTRY_IID(IID_IShellMenu2
, IShellMenu2
)
167 COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler
, IWinEventHandler
)
168 COM_INTERFACE_ENTRY_IID(IID_IShellMenuAcc
, IShellMenuAcc
)
173 HRESULT
CMenuBand_Wrapper(REFIID riid
, LPVOID
*ppv
)
177 CMenuBandWrap
* site
= new CComObject
<CMenuBandWrap
>();
180 return E_OUTOFMEMORY
;
182 HRESULT hr
= site
->QueryInterface(riid
, ppv
);
190 CMenuBandWrap::CMenuBandWrap()
194 CoCreateInstance(CLSID_MenuBand
, NULL
, CLSCTX_INPROC_SERVER
, IID_PPV_ARG(IShellMenu
, &m_IShellMenu
));
195 m_IShellMenu
->QueryInterface(IID_PPV_ARG(IUnknown
, &m_IUnknown
));
196 m_IUnknown
->QueryInterface(IID_PPV_ARG(IDeskBand
, &m_IDeskBand
));
197 m_IUnknown
->QueryInterface(IID_PPV_ARG(IDockingWindow
, &m_IDockingWindow
));
198 m_IUnknown
->QueryInterface(IID_PPV_ARG(IOleWindow
, &m_IOleWindow
));
199 m_IUnknown
->QueryInterface(IID_PPV_ARG(IObjectWithSite
, &m_IObjectWithSite
));
200 m_IUnknown
->QueryInterface(IID_PPV_ARG(IInputObject
, &m_IInputObject
));
201 m_IUnknown
->QueryInterface(IID_PPV_ARG(IPersistStream
, &m_IPersistStream
));
202 m_IUnknown
->QueryInterface(IID_PPV_ARG(IPersist
, &m_IPersist
));
203 m_IUnknown
->QueryInterface(IID_PPV_ARG(IOleCommandTarget
, &m_IOleCommandTarget
));
204 m_IUnknown
->QueryInterface(IID_PPV_ARG(IServiceProvider
, &m_IServiceProvider
));
205 m_IUnknown
->QueryInterface(IID_PPV_ARG(IMenuPopup
, &m_IMenuPopup
));
206 m_IUnknown
->QueryInterface(IID_PPV_ARG(IDeskBar
, &m_IDeskBar
));
207 m_IUnknown
->QueryInterface(IID_PPV_ARG(IMenuBand
, &m_IMenuBand
));
208 m_IUnknown
->QueryInterface(IID_PPV_ARG(IShellMenu2
, &m_IShellMenu2
));
209 m_IUnknown
->QueryInterface(IID_PPV_ARG(IWinEventHandler
, &m_IWinEventHandler
));
210 m_IUnknown
->QueryInterface(IID_PPV_ARG(IShellMenuAcc
, &m_IShellMenuAcc
));
213 CMenuBandWrap::~CMenuBandWrap()
215 m_IUnknown
->Release();
216 m_IDeskBand
->Release();
217 m_IDockingWindow
->Release();
218 m_IOleWindow
->Release();
219 m_IObjectWithSite
->Release();
220 m_IInputObject
->Release();
221 m_IPersistStream
->Release();
222 m_IPersist
->Release();
223 m_IOleCommandTarget
->Release();
224 m_IServiceProvider
->Release();
225 m_IMenuPopup
->Release();
226 m_IDeskBar
->Release();
227 m_IMenuBand
->Release();
228 m_IShellMenu2
->Release();
229 m_IShellMenu
->Release();
230 m_IWinEventHandler
->Release();
231 m_IShellMenuAcc
->Release();
236 // *** IShellMenu2 methods ***
237 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetSubMenu(THIS
)
239 WrapLogEnter("CMenuBandWrap<%p>::GetSubMenu()\n", this);
240 HRESULT hr
= m_IShellMenu2
->GetSubMenu();
241 WrapLogExit("CMenuBandWrap::GetSubMenu() = %08x\n", hr
);
245 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::SetToolbar(THIS
)
247 WrapLogEnter("CMenuBandWrap<%p>::SetToolbar()\n", this);
248 HRESULT hr
= m_IShellMenu2
->SetToolbar();
249 WrapLogExit("CMenuBandWrap::SetToolbar() = %08x\n", hr
);
253 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::SetMinWidth(THIS
)
255 WrapLogEnter("CMenuBandWrap<%p>::SetMinWidth()\n", this);
256 HRESULT hr
= m_IShellMenu2
->SetMinWidth();
257 WrapLogExit("CMenuBandWrap::SetMinWidth() = %08x\n", hr
);
261 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::SetNoBorder(THIS
)
263 WrapLogEnter("CMenuBandWrap<%p>::SetNoBorder()\n", this);
264 HRESULT hr
= m_IShellMenu2
->SetNoBorder();
265 WrapLogExit("CMenuBandWrap::SetNoBorder() = %08x\n", hr
);
269 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::SetTheme(THIS
)
271 WrapLogEnter("CMenuBandWrap<%p>::SetTheme()\n", this);
272 HRESULT hr
= m_IShellMenu2
->SetTheme();
273 WrapLogExit("CMenuBandWrap::SetTheme() = %08x\n", hr
);
278 // *** IShellMenuAcc methods ***
279 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetTop(THIS
)
281 WrapLogEnter("CMenuBandWrap<%p>::GetTop()\n", this);
282 HRESULT hr
= m_IShellMenuAcc
->GetTop();
283 WrapLogExit("CMenuBandWrap::GetTop() = %08x\n", hr
);
287 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetBottom(THIS
)
289 WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
290 HRESULT hr
= m_IShellMenuAcc
->GetBottom();
291 WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr
);
295 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetTracked(THIS
)
297 WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
298 HRESULT hr
= m_IShellMenuAcc
->GetBottom();
299 WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr
);
303 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetParentSite(THIS
)
305 WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
306 HRESULT hr
= m_IShellMenuAcc
->GetBottom();
307 WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr
);
311 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetState(THIS
)
313 WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
314 HRESULT hr
= m_IShellMenuAcc
->GetBottom();
315 WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr
);
319 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::DoDefaultAction(THIS
)
321 WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
322 HRESULT hr
= m_IShellMenuAcc
->GetBottom();
323 WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr
);
327 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::IsEmpty(THIS
)
329 WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
330 HRESULT hr
= m_IShellMenuAcc
->GetBottom();
331 WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr
);
335 // *** IDeskBand methods ***
336 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetBandInfo(DWORD dwBandID
, DWORD dwViewMode
, DESKBANDINFO
*pdbi
)
338 WrapLogEnter("CMenuBandWrap<%p>::GetBandInfo(DWORD dwBandID=%d, DWORD dwViewMode=%d, DESKBANDINFO *pdbi=%p)\n", this, dwBandID
, dwViewMode
, pdbi
);
339 HRESULT hr
= m_IDeskBand
->GetBandInfo(dwBandID
, dwViewMode
, pdbi
);
340 WrapLogExit("CMenuBandWrap::GetBandInfo() = %08x\n", hr
);
344 // *** IDockingWindow methods ***
345 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::ShowDW(BOOL fShow
)
347 WrapLogEnter("CMenuBandWrap<%p>::ShowDW(BOOL fShow=%d)\n", this, fShow
);
348 HRESULT hr
= m_IDockingWindow
->ShowDW(fShow
);
349 WrapLogExit("CMenuBandWrap::ShowDW() = %08x\n", hr
);
353 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::CloseDW(DWORD dwReserved
)
355 WrapLogEnter("CMenuBandWrap<%p>::CloseDW(DWORD dwReserved=%d)\n", this, dwReserved
);
356 HRESULT hr
= m_IDockingWindow
->CloseDW(dwReserved
);
357 WrapLogExit("CMenuBandWrap::CloseDW() = %08x\n", hr
);
361 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::ResizeBorderDW(LPCRECT prcBorder
, IUnknown
*punkToolbarSite
, BOOL fReserved
)
363 WrapLogEnter("CMenuBandWrap<%p>::ResizeBorderDW(LPCRECT prcBorder=%p, IUnknown *punkToolbarSite=%p, BOOL fReserved=%d)\n", this, prcBorder
, punkToolbarSite
, fReserved
);
364 if (prcBorder
) WrapLogMsg("*prcBorder=%s\n", Wrap(*prcBorder
));
365 HRESULT hr
= m_IDockingWindow
->ResizeBorderDW(prcBorder
, punkToolbarSite
, fReserved
);
366 if (prcBorder
) WrapLogMsg("*prcBorder=%s\n", Wrap(*prcBorder
));
367 WrapLogExit("CMenuBandWrap::ResizeBorderDW() = %08x\n", hr
);
371 // *** IOleWindow methods ***
372 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetWindow(HWND
*phwnd
)
374 WrapLogEnter("CMenuBandWrap<%p>::GetWindow(HWND *phwnd=%p)\n", this, phwnd
);
375 HRESULT hr
= m_IOleWindow
->GetWindow(phwnd
);
376 if (phwnd
) WrapLogMsg("*phwnd=%p\n", *phwnd
);
377 WrapLogExit("CMenuBandWrap::GetWindow() = %08x\n", hr
);
380 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::ContextSensitiveHelp(BOOL fEnterMode
)
382 WrapLogEnter("CMenuBandWrap<%p>::ContextSensitiveHelp(BOOL fEnterMode=%d)\n", this, fEnterMode
);
383 HRESULT hr
= m_IOleWindow
->ContextSensitiveHelp(fEnterMode
);
384 WrapLogExit("CMenuBandWrap::ContextSensitiveHelp() = %08x\n", hr
);
388 // *** IWinEventHandler methods ***
389 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::OnWinEvent(HWND hWnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
, LRESULT
*theResult
)
391 //WrapLogEnter("CMenuBandWrap<%p>::OnWinEvent(HWND hWnd=%p, UINT uMsg=%u, WPARAM wParam=%08x, LPARAM lParam=%08x, LRESULT *theResult=%p)\n", this, hWnd, uMsg, wParam, lParam, theResult);
392 HRESULT hr
= m_IWinEventHandler
->OnWinEvent(hWnd
, uMsg
, wParam
, lParam
, theResult
);
393 //WrapLogExit("CMenuBandWrap::OnWinEvent() = %08x\n", hr);
397 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::IsWindowOwner(HWND hWnd
)
399 //WrapLogEnter("CMenuBandWrap<%p>::IsWindowOwner(HWND hWnd=%08x)\n", this, hWnd);
400 HRESULT hr
= m_IWinEventHandler
->IsWindowOwner(hWnd
);
401 //WrapLogExit("CMenuBandWrap::IsWindowOwner() = %08x\n", hr);
405 // *** IObjectWithSite methods ***
406 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::SetSite(IUnknown
*pUnkSite
)
408 WrapLogEnter("CMenuBandWrap<%p>::SetSite(IUnknown *pUnkSite=%p)\n", this, pUnkSite
);
409 HRESULT hr
= m_IObjectWithSite
->SetSite(pUnkSite
);
410 WrapLogExit("CMenuBandWrap::SetSite() = %08x\n", hr
);
414 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetSite(REFIID riid
, PVOID
*ppvSite
)
416 WrapLogEnter("CMenuBandWrap<%p>::GetSite(REFIID riid=%s, PVOID *ppvSite=%p)\n", this, Wrap(riid
), ppvSite
);
417 HRESULT hr
= m_IObjectWithSite
->GetSite(riid
, ppvSite
);
418 if (ppvSite
) WrapLogMsg("*ppvSite=%p\n", *ppvSite
);
419 WrapLogExit("CMenuBandWrap::GetSite() = %08x\n", hr
);
423 // *** IInputObject methods ***
424 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::UIActivateIO(BOOL fActivate
, LPMSG lpMsg
)
426 WrapLogEnter("CMenuBandWrap<%p>::UIActivateIO(BOOL fActivate=%d, LPMSG lpMsg=%p)\n", this, fActivate
, lpMsg
);
427 HRESULT hr
= m_IInputObject
->UIActivateIO(fActivate
, lpMsg
);
428 WrapLogExit("CMenuBandWrap::UIActivateIO() = %08x\n", hr
);
432 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::HasFocusIO()
434 WrapLogEnter("CMenuBandWrap<%p>::HasFocusIO()\n", this);
435 HRESULT hr
= m_IInputObject
->HasFocusIO();
436 WrapLogExit("CMenuBandWrap::HasFocusIO() = %08x\n", hr
);
440 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::TranslateAcceleratorIO(LPMSG lpMsg
)
442 WrapLogEnter("CMenuBandWrap<%p>::TranslateAcceleratorIO(LPMSG lpMsg=%p)\n", this, lpMsg
);
443 if (lpMsg
) WrapLogMsg("*lpMsg=%s\n", Wrap(*lpMsg
));
444 HRESULT hr
= m_IInputObject
->TranslateAcceleratorIO(lpMsg
);
445 WrapLogExit("CMenuBandWrap::TranslateAcceleratorIO() = %08x\n", hr
);
449 // *** IPersistStream methods ***
450 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::IsDirty()
452 WrapLogEnter("CMenuBandWrap<%p>::IsDirty()\n", this);
453 HRESULT hr
= m_IPersistStream
->IsDirty();
454 WrapLogExit("CMenuBandWrap::IsDirty() = %08x\n", hr
);
457 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::Load(IStream
*pStm
)
459 WrapLogEnter("CMenuBandWrap<%p>::Load(IStream *pStm=%p)\n", this, pStm
);
460 HRESULT hr
= m_IPersistStream
->Load(pStm
);
461 WrapLogExit("CMenuBandWrap::Load() = %08x\n", hr
);
464 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::Save(IStream
*pStm
, BOOL fClearDirty
)
466 WrapLogEnter("CMenuBandWrap<%p>::Save(IStream *pStm=%p, BOOL fClearDirty=%d)\n", this, pStm
, fClearDirty
);
467 HRESULT hr
= m_IPersistStream
->Save(pStm
, fClearDirty
);
468 WrapLogExit("CMenuBandWrap::Save() = %08x\n", hr
);
471 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetSizeMax(ULARGE_INTEGER
*pcbSize
)
473 WrapLogEnter("CMenuBandWrap<%p>::GetSizeMax(ULARGE_INTEGER *pcbSize=%p)\n", this, pcbSize
);
474 HRESULT hr
= m_IPersistStream
->GetSizeMax(pcbSize
);
475 WrapLogExit("CMenuBandWrap::GetSizeMax() = %08x\n", hr
);
479 // *** IPersist methods ***
480 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetClassID(CLSID
*pClassID
)
482 WrapLogEnter("CMenuBandWrap<%p>::GetClassID(CLSID *pClassID=%p)\n", this, pClassID
);
483 HRESULT hr
= m_IPersist
->GetClassID(pClassID
);
484 if (pClassID
) WrapLogMsg("*pClassID=%s\n", Wrap(*pClassID
));
485 WrapLogExit("CMenuBandWrap::GetClassID() = %08x\n", hr
);
489 // *** IOleCommandTarget methods ***
490 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::QueryStatus(const GUID
*pguidCmdGroup
, ULONG cCmds
, OLECMD prgCmds
[], OLECMDTEXT
*pCmdText
)
492 WrapLogEnter("CMenuBandWrap<%p>::QueryStatus(const GUID *pguidCmdGroup=%p, ULONG cCmds=%u, prgCmds=%p, pCmdText=%p)\n", this, pguidCmdGroup
, cCmds
, prgCmds
, pCmdText
);
493 HRESULT hr
= m_IOleCommandTarget
->QueryStatus(pguidCmdGroup
, cCmds
, prgCmds
, pCmdText
);
494 if (pguidCmdGroup
) WrapLogMsg("*pguidCmdGroup=%s\n", Wrap(*pguidCmdGroup
));
495 WrapLogExit("CMenuBandWrap::QueryStatus() = %08x\n", hr
);
499 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::Exec(const GUID
*pguidCmdGroup
, DWORD nCmdID
, DWORD nCmdexecopt
, VARIANT
*pvaIn
, VARIANT
*pvaOut
)
501 WrapLogEnter("CMenuBandWrap<%p>::Exec(const GUID *pguidCmdGroup=%p, DWORD nCmdID=%d, DWORD nCmdexecopt=%d, VARIANT *pvaIn=%p, VARIANT *pvaOut=%p)\n", this, pguidCmdGroup
, nCmdID
, nCmdexecopt
, pvaIn
, pvaOut
);
502 if (pguidCmdGroup
) WrapLogMsg("*pguidCmdGroup=%s\n", Wrap(*pguidCmdGroup
));
503 HRESULT hr
= m_IOleCommandTarget
->Exec(pguidCmdGroup
, nCmdID
, nCmdexecopt
, pvaIn
, pvaOut
);
504 WrapLogExit("CMenuBandWrap::Exec() = %08x\n", hr
);
508 // *** IServiceProvider methods ***
509 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::QueryService(REFGUID guidService
, REFIID riid
, void **ppvObject
)
511 WrapLogEnter("CMenuBandWrap<%p>::QueryService(REFGUID guidService=%s, REFIID riid=%s, void **ppvObject=%p)\n", this, Wrap(guidService
), Wrap(riid
), ppvObject
);
513 if (IsEqualIID(guidService
, SID_SMenuBandChild
))
515 WrapLogMsg("SID is SID_SMenuBandChild. Using QueryInterface of self instead of wrapped object.\n");
516 HRESULT hr
= this->QueryInterface(riid
, ppvObject
);
517 if (ppvObject
) WrapLogMsg("*ppvObject=%p\n", *ppvObject
);
520 WrapLogExit("CMenuBandWrap::QueryService() = %08x\n", hr
);
525 WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter object.\n");
528 else if (IsEqualIID(guidService
, SID_SMenuBandBottom
))
530 WrapLogMsg("SID is SID_SMenuBandBottom. Using QueryInterface of self instead of wrapped object.\n");
531 HRESULT hr
= this->QueryInterface(riid
, ppvObject
);
532 if (ppvObject
) WrapLogMsg("*ppvObject=%p\n", *ppvObject
);
535 WrapLogExit("CMenuBandWrap::QueryService() = %08x\n", hr
);
540 WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter object.\n");
543 else if (IsEqualIID(guidService
, SID_SMenuBandBottomSelected
))
545 WrapLogMsg("SID is SID_SMenuBandBottomSelected. Using QueryInterface of self instead of wrapped object.\n");
546 HRESULT hr
= this->QueryInterface(riid
, ppvObject
);
547 if (ppvObject
) WrapLogMsg("*ppvObject=%p\n", *ppvObject
);
550 WrapLogExit("CMenuBandWrap::QueryService() = %08x\n", hr
);
555 WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter object.\n");
560 WrapLogMsg("SID not identified.\n");
562 HRESULT hr
= m_IServiceProvider
->QueryService(guidService
, riid
, ppvObject
);
563 if (ppvObject
) WrapLogMsg("*ppvObject=%p\n", *ppvObject
);
564 WrapLogExit("CMenuBandWrap::QueryService() = %08x\n", hr
);
569 // *** IMenuPopup methods ***
570 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::Popup(POINTL
*ppt
, RECTL
*prcExclude
, MP_POPUPFLAGS dwFlags
)
572 WrapLogEnter("CMenuBandWrap<%p>::Popup(POINTL *ppt=%p, RECTL *prcExclude=%p, MP_POPUPFLAGS dwFlags=%08x)\n", this, ppt
, prcExclude
, dwFlags
);
573 HRESULT hr
= m_IMenuPopup
->Popup(ppt
, prcExclude
, dwFlags
);
574 WrapLogExit("CMenuBandWrap::Popup() = %08x\n", hr
);
578 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::OnSelect(DWORD dwSelectType
)
580 WrapLogEnter("CMenuBandWrap<%p>::OnSelect(DWORD dwSelectType=%08x)\n", this, dwSelectType
);
581 HRESULT hr
= m_IMenuPopup
->OnSelect(dwSelectType
);
582 WrapLogExit("CMenuBandWrap::OnSelect() = %08x\n", hr
);
586 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::SetSubMenu(IMenuPopup
*pmp
, BOOL fSet
)
588 WrapLogEnter("CMenuBandWrap<%p>::SetSubMenu(IMenuPopup *pmp=%p, BOOL fSet=%d)\n", this, pmp
, fSet
);
589 HRESULT hr
= m_IMenuPopup
->SetSubMenu(pmp
, fSet
);
590 WrapLogExit("CMenuBandWrap::SetSubMenu() = %08x\n", hr
);
595 // *** IDeskBar methods ***
596 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::SetClient(IUnknown
*punkClient
)
598 WrapLogEnter("CMenuBandWrap<%p>::SetClient(IUnknown *punkClient=%p)\n", this, punkClient
);
599 HRESULT hr
= m_IDeskBar
->SetClient(punkClient
);
600 WrapLogExit("CMenuBandWrap::SetClient() = %08x\n", hr
);
604 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetClient(IUnknown
**ppunkClient
)
606 WrapLogEnter("CMenuBandWrap<%p>::GetClient(IUnknown **ppunkClient=%p)\n", this, ppunkClient
);
607 HRESULT hr
= m_IDeskBar
->GetClient(ppunkClient
);
608 if (ppunkClient
) WrapLogMsg("*ppunkClient=%p\n", *ppunkClient
);
609 WrapLogExit("CMenuBandWrap::GetClient() = %08x\n", hr
);
613 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::OnPosRectChangeDB(RECT
*prc
)
615 WrapLogEnter("CMenuBandWrap<%p>::OnPosRectChangeDB(RECT *prc=%p)\n", this, prc
);
616 HRESULT hr
= m_IDeskBar
->OnPosRectChangeDB(prc
);
617 if (prc
) WrapLogMsg("*prc=%s\n", Wrap(*prc
));
618 WrapLogExit("CMenuBandWrap::OnPosRectChangeDB() = %08x\n", hr
);
623 // *** IMenuBand methods ***
624 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::IsMenuMessage(MSG
*pmsg
)
626 //WrapLogEnter("CMenuBandWrap<%p>::IsMenuMessage(MSG *pmsg=%p)\n", this, pmsg);
627 HRESULT hr
= m_IMenuBand
->IsMenuMessage(pmsg
);
628 //WrapLogExit("CMenuBandWrap::IsMenuMessage() = %08x\n", hr);
632 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::TranslateMenuMessage(MSG
*pmsg
, LRESULT
*plRet
)
634 //WrapLogEnter("CMenuBandWrap<%p>::TranslateMenuMessage(MSG *pmsg=%p, LRESULT *plRet=%p)\n", this, pmsg, plRet);
635 HRESULT hr
= m_IMenuBand
->TranslateMenuMessage(pmsg
, plRet
);
636 //WrapLogExit("CMenuBandWrap::TranslateMenuMessage(*plRet=%d) = %08x\n", *plRet, hr);
640 // *** IShellMenu methods ***
641 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::Initialize(IShellMenuCallback
*psmc
, UINT uId
, UINT uIdAncestor
, DWORD dwFlags
)
643 WrapLogEnter("CMenuBandWrap<%p>::Initialize(IShellMenuCallback *psmc=%p, UINT uId=%u, UINT uIdAncestor=%u, DWORD dwFlags=%08x)\n", this, psmc
, uId
, uIdAncestor
, dwFlags
);
644 HRESULT hr
= m_IShellMenu
->Initialize(psmc
, uId
, uIdAncestor
, dwFlags
);
645 WrapLogExit("CMenuBandWrap::Initialize() = %08x\n", hr
);
649 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetMenuInfo(IShellMenuCallback
**ppsmc
, UINT
*puId
, UINT
*puIdAncestor
, DWORD
*pdwFlags
)
651 WrapLogEnter("CMenuBandWrap<%p>::GetMenuInfo(IShellMenuCallback **ppsmc=%p, UINT *puId=%p, UINT *puIdAncestor=%p, DWORD *pdwFlags=%p)\n", this, ppsmc
, puId
, puIdAncestor
, pdwFlags
);
652 HRESULT hr
= m_IShellMenu
->GetMenuInfo(ppsmc
, puId
, puIdAncestor
, pdwFlags
);
653 if (ppsmc
) WrapLogMsg("*ppsmc=%p\n", *ppsmc
);
654 if (puId
) WrapLogMsg("*puId=%u\n", *puId
);
655 if (puIdAncestor
) WrapLogMsg("*puIdAncestor=%u\n", *puIdAncestor
);
656 if (pdwFlags
) WrapLogMsg("*pdwFlags=%08x\n", *pdwFlags
);
657 WrapLogExit("CMenuBandWrap::GetMenuInfo() = %08x\n", hr
);
661 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::SetShellFolder(IShellFolder
*psf
, LPCITEMIDLIST pidlFolder
, HKEY hKey
, DWORD dwFlags
)
663 WrapLogEnter("CMenuBandWrap<%p>::SetShellFolder(IShellFolder *psf=%p, LPCITEMIDLIST pidlFolder=%p, HKEY hKey=%p, DWORD dwFlags=%08x)\n", this, psf
, pidlFolder
, hKey
, dwFlags
);
664 HRESULT hr
= m_IShellMenu
->SetShellFolder(psf
, pidlFolder
, hKey
, dwFlags
);
665 WrapLogExit("CMenuBandWrap::SetShellFolder() = %08x\n", hr
);
669 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetShellFolder(DWORD
*pdwFlags
, LPITEMIDLIST
*ppidl
, REFIID riid
, void **ppv
)
671 WrapLogEnter("CMenuBandWrap<%p>::GetShellFolder(DWORD *pdwFlags=%p, LPITEMIDLIST *ppidl=%p, REFIID riid=%s, void **ppv=%p)\n", this, pdwFlags
, ppidl
, Wrap(riid
), ppv
);
672 HRESULT hr
= m_IShellMenu
->GetShellFolder(pdwFlags
, ppidl
, riid
, ppv
);
673 if (pdwFlags
) WrapLogMsg("*pdwFlags=%08x\n", *pdwFlags
);
674 if (ppidl
) WrapLogMsg("*ppidl=%p\n", *ppidl
);
675 if (ppv
) WrapLogMsg("*ppv=%p\n", *ppv
);
676 WrapLogExit("CMenuBandWrap::GetShellFolder() = %08x\n", hr
);
680 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::SetMenu(HMENU hmenu
, HWND hwnd
, DWORD dwFlags
)
682 WrapLogEnter("CMenuBandWrap<%p>::SetMenu(HMENU hmenu=%p, HWND hwnd=%p, DWORD dwFlags=%08x)\n", this, hmenu
, hwnd
, dwFlags
);
683 HRESULT hr
= m_IShellMenu
->SetMenu(hmenu
, hwnd
, dwFlags
);
684 WrapLogExit("CMenuBandWrap::SetMenu() = %08x\n", hr
);
688 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetMenu(HMENU
*phmenu
, HWND
*phwnd
, DWORD
*pdwFlags
)
690 WrapLogEnter("CMenuBandWrap<%p>::GetMenu(HMENU *phmenu=%p, HWND *phwnd=%p, DWORD *pdwFlags=%p)\n", this, phmenu
, phwnd
, pdwFlags
);
691 HRESULT hr
= m_IShellMenu
->GetMenu(phmenu
, phwnd
, pdwFlags
);
692 if (phmenu
) WrapLogMsg("*phmenu=%p\n", *phmenu
);
693 if (phwnd
) WrapLogMsg("*phwnd=%p\n", *phwnd
);
694 if (pdwFlags
) WrapLogMsg("*pdwFlags=%08x\n", *pdwFlags
);
695 WrapLogExit("CMenuBandWrap::GetMenu() = %08x\n", hr
);
699 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::InvalidateItem(LPSMDATA psmd
, DWORD dwFlags
)
701 WrapLogEnter("CMenuBandWrap<%p>::InvalidateItem(LPSMDATA psmd=%p, DWORD dwFlags=%08x)\n", this, psmd
, dwFlags
);
702 HRESULT hr
= m_IShellMenu
->InvalidateItem(psmd
, dwFlags
);
703 WrapLogExit("CMenuBandWrap::InvalidateItem() = %08x\n", hr
);
707 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::GetState(LPSMDATA psmd
)
709 WrapLogEnter("CMenuBandWrap<%p>::GetState(LPSMDATA psmd=%p)\n", this, psmd
);
710 HRESULT hr
= m_IShellMenu
->GetState(psmd
);
711 WrapLogExit("CMenuBandWrap::GetState() = %08x\n", hr
);
715 HRESULT STDMETHODCALLTYPE
CMenuBandWrap::SetMenuToolbar(IUnknown
*punk
, DWORD dwFlags
)
717 WrapLogEnter("CMenuBandWrap<%p>::SetMenuToolbar(IUnknown *punk=%p, DWORD dwFlags=%08x)\n", this, punk
, dwFlags
);
718 HRESULT hr
= m_IShellMenu
->SetMenuToolbar(punk
, dwFlags
);
719 WrapLogExit("CMenuBandWrap::SetMenuToolbar() = %08x\n", hr
);