ReactOS  0.4.12-dev-685-gf36cbf7
CMenuBand.cpp
Go to the documentation of this file.
1 /*
2  * Shell Menu Band
3  *
4  * Copyright 2014 David Quintana
5  *
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.
10  *
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.
15  *
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
19  */
20 #include "shellmenu.h"
21 #include <windowsx.h>
22 #include <commoncontrols.h>
23 #include <shlwapi_undoc.h>
24 
25 #include "CMenuBand.h"
26 #include "CMenuToolbars.h"
27 #include "CMenuFocusManager.h"
28 
30 
31 #undef UNIMPLEMENTED
32 
33 #define UNIMPLEMENTED TRACE("%s is UNIMPLEMENTED!\n", __FUNCTION__)
34 
36  m_staticToolbar(NULL),
37  m_SFToolbar(NULL),
38  m_site(NULL),
39  m_psmc(NULL),
40  m_subMenuChild(NULL),
41  m_subMenuParent(NULL),
42  m_childBand(NULL),
43  m_parentBand(NULL),
44  m_hmenu(NULL),
45  m_menuOwner(NULL),
46  m_useBigIcons(FALSE),
47  m_topLevelWindow(NULL),
48  m_hotBar(NULL),
49  m_hotItem(-1),
50  m_popupBar(NULL),
51  m_popupItem(-1),
52  m_Show(FALSE),
53  m_shellBottom(FALSE),
54  m_trackedPopup(NULL),
55  m_trackedHwnd(NULL)
56 {
58 }
59 
61 {
63 
64  delete m_staticToolbar;
65  delete m_SFToolbar;
66 
67  if (m_hmenu)
69 }
70 
72  IShellMenuCallback *psmc,
73  UINT uId,
74  UINT uIdAncestor,
75  DWORD dwFlags)
76 {
77  if (m_psmc != psmc)
78  m_psmc = psmc;
79  m_uId = uId;
80  m_uIdAncestor = uIdAncestor;
82 
83  if (m_psmc)
84  {
85  _CallCB(SMC_CREATE, 0, reinterpret_cast<LPARAM>(&m_UserData));
86  }
87 
88  return S_OK;
89 }
90 
92  IShellMenuCallback **ppsmc,
93  UINT *puId,
94  UINT *puIdAncestor,
95  DWORD *pdwFlags)
96 {
97  if (!pdwFlags) // maybe?
98  return E_INVALIDARG;
99 
100  if (ppsmc)
101  {
102  if (m_psmc)
103  m_psmc->AddRef();
104  *ppsmc = m_psmc;
105  }
106 
107  if (puId)
108  *puId = m_uId;
109 
110  if (puIdAncestor)
111  *puIdAncestor = m_uIdAncestor;
112 
113  *pdwFlags = m_dwFlags;
114 
115  return S_OK;
116 }
117 
119  HMENU hmenu,
120  HWND hwnd,
121  DWORD dwFlags)
122 {
123  HRESULT hr;
124 
125  TRACE("CMenuBand::SetMenu called, hmenu=%p; hwnd=%p, flags=%x\n", hmenu, hwnd, dwFlags);
126 
127  BOOL created = FALSE;
128 
129  if (m_hmenu && m_hmenu != hmenu)
130  {
132  m_hmenu = NULL;
133  }
134 
135  m_hmenu = hmenu;
136  m_menuOwner = hwnd;
137 
138  if (m_hmenu && m_staticToolbar == NULL)
139  {
141  created = true;
142  }
143 
144  if (m_staticToolbar)
145  {
147  if (FAILED_UNEXPECTEDLY(hr))
148  return hr;
149  }
150 
151  if (m_site)
152  {
154 
155  hr = m_site->GetWindow(&hwndParent);
156  if (FAILED_UNEXPECTEDLY(hr))
157  return hr;
158 
159  if (created)
160  {
162  if (FAILED_UNEXPECTEDLY(hr))
163  return hr;
164 
166  }
167  else
168  {
170  }
171  }
172 
173  return hr;
174 }
175 
177  HMENU *phmenu,
178  HWND *phwnd,
179  DWORD *pdwFlags)
180 {
181  if (m_staticToolbar == NULL)
182  return E_FAIL;
183 
184  return m_staticToolbar->GetMenu(phmenu, phwnd, pdwFlags);
185 }
186 
188 {
190  HRESULT hr;
191 
192  m_site = NULL;
193 
194  if (pUnkSite == NULL)
195  return S_OK;
196 
197  hwndParent = NULL;
199  if (FAILED_UNEXPECTEDLY(hr))
200  return hr;
201 
202  hr = m_site->GetWindow(&hwndParent);
203  if (FAILED_UNEXPECTEDLY(hr))
204  return hr;
205 
206  if (!::IsWindow(hwndParent))
207  return E_FAIL;
208 
209  if (m_staticToolbar != NULL)
210  {
212  if (FAILED_UNEXPECTEDLY(hr))
213  return hr;
214 
216  if (FAILED_UNEXPECTEDLY(hr))
217  return hr;
218  }
219 
220  if (m_SFToolbar != NULL)
221  {
223  if (FAILED_UNEXPECTEDLY(hr))
224  return hr;
225 
227  if (FAILED_UNEXPECTEDLY(hr))
228  return hr;
229  }
230 
233  return hr;
234 
235  CComPtr<IOleWindow> pTopLevelWindow;
236  hr = IUnknown_QueryService(m_site, SID_STopLevelBrowser, IID_PPV_ARG(IOleWindow, &pTopLevelWindow));
237  if (SUCCEEDED(hr))
238  {
239  hr = pTopLevelWindow->GetWindow(&m_topLevelWindow);
240  if (FAILED_UNEXPECTEDLY(hr))
241  return hr;
242  }
243  else
244  {
246  }
247 
248  return S_OK;
249 }
250 
252 {
253  if (m_site == NULL)
254  return E_FAIL;
255 
256  return m_site->QueryInterface(riid, ppvSite);
257 }
258 
260 {
261  if (m_SFToolbar != NULL)
262  return m_SFToolbar->GetWindow(phwnd);
263 
264  if (m_staticToolbar != NULL)
265  return m_staticToolbar->GetWindow(phwnd);
266 
267  if (phwnd) *phwnd = NULL;
268 
269  return E_FAIL;
270 }
271 
273 {
274  SIZE maxStatic = { 0 };
275  SIZE maxShlFld = { 0 };
276  HRESULT hr = S_OK;
277 
278  if (m_staticToolbar != NULL)
279  hr = m_staticToolbar->GetSizes(NULL, &maxStatic, NULL);
280  if (FAILED_UNEXPECTEDLY(hr))
281  return hr;
282 
283  if (m_SFToolbar != NULL)
284  hr = m_SFToolbar->GetSizes(NULL, &maxShlFld, NULL);
285  if (FAILED_UNEXPECTEDLY(hr))
286  return hr;
287 
288  if (m_staticToolbar == NULL && m_SFToolbar == NULL)
289  return E_FAIL;
290 
291  int sy = min(prc->bottom - prc->top, maxStatic.cy + maxShlFld.cy);
292 
293  int syStatic = maxStatic.cy;
294  int syShlFld = sy - syStatic;
295 
296  // TODO: Windows has a more complex system to decide ordering.
297  // Because we only support two toolbars at once, this is enough for us.
298  if (m_shellBottom)
299  {
300  // Static menu on top
301  if (m_SFToolbar)
302  {
304  prc->left,
305  prc->top + syStatic,
306  prc->right - prc->left,
307  syShlFld);
308  }
309  if (m_staticToolbar)
310  {
312  prc->left,
313  prc->top,
314  prc->right - prc->left,
315  syStatic);
316  }
317  }
318  else
319  {
320  // Folder menu on top
321  if (m_SFToolbar)
322  {
324  prc->left,
325  prc->top,
326  prc->right - prc->left,
327  syShlFld);
328  }
329  if (m_staticToolbar)
330  {
332  prc->left,
333  prc->top + syShlFld,
334  prc->right - prc->left,
335  syStatic);
336  }
337  }
338 
339  return S_OK;
340 }
341 
343  DWORD dwBandID,
344  DWORD dwViewMode,
345  DESKBANDINFO *pdbi)
346 {
347  SIZE minStatic = { 0 };
348  SIZE minShlFld = { 0 };
349  SIZE maxStatic = { 0 };
350  SIZE maxShlFld = { 0 };
351  SIZE intStatic = { 0 };
352  SIZE intShlFld = { 0 };
353 
354  HRESULT hr = S_OK;
355 
356  if (m_staticToolbar != NULL)
357  hr = m_staticToolbar->GetSizes(&minStatic, &maxStatic, &intStatic);
358  if (FAILED_UNEXPECTEDLY(hr))
359  return hr;
360 
361  if (m_SFToolbar != NULL)
362  hr = m_SFToolbar->GetSizes(&minShlFld, &maxShlFld, &intShlFld);
363  if (FAILED_UNEXPECTEDLY(hr))
364  return hr;
365 
366  if (m_staticToolbar == NULL && m_SFToolbar == NULL)
367  return E_FAIL;
368 
369  if (m_dwFlags & SMINIT_VERTICAL)
370  {
371  pdbi->ptMinSize.x = max(minStatic.cx, minShlFld.cx) + 20;
372  pdbi->ptMinSize.y = minStatic.cy + minShlFld.cy;
373  pdbi->ptMaxSize.x = max(maxStatic.cx, maxShlFld.cx) + 20;
374  pdbi->ptMaxSize.y = maxStatic.cy + maxShlFld.cy;
375  pdbi->dwModeFlags = DBIMF_VARIABLEHEIGHT;
376  }
377  else
378  {
379  pdbi->ptMinSize.x = minStatic.cx + minShlFld.cx;
380  pdbi->ptMinSize.y = max(minStatic.cy, minShlFld.cy);
381  pdbi->ptMaxSize.x = maxStatic.cx + maxShlFld.cx;
382  pdbi->ptMaxSize.y = max(maxStatic.cy, maxShlFld.cy);
383  }
384  pdbi->ptIntegral.x = max(intStatic.cx, intShlFld.cx);
385  pdbi->ptIntegral.y = max(intStatic.cy, intShlFld.cy);
386  pdbi->ptActual = pdbi->ptMinSize;
387 
388  return S_OK;
389 }
390 
392 {
393  HRESULT hr = S_OK;
394 
395  if (m_Show == fShow)
396  return S_OK;
397 
398  m_Show = fShow;
399 
400  if (m_staticToolbar != NULL)
401  {
403  if (FAILED_UNEXPECTEDLY(hr))
404  return hr;
405  }
406 
407  if (m_SFToolbar != NULL)
408  {
410  if (FAILED_UNEXPECTEDLY(hr))
411  return hr;
412  }
413 
414  if (fShow)
415  {
416  hr = _CallCB(SMC_INITMENU, 0, 0);
417  if (FAILED_UNEXPECTEDLY(hr))
418  return hr;
419  }
420  else if (m_parentBand)
421  {
422  m_parentBand->SetClient(NULL);
423  }
424 
425  if (_IsPopup() == S_OK)
426  {
427  if (fShow)
429  else
430  hr = m_focusManager->PopMenuPopup(this);
431  }
432  else
433  {
434  if (fShow)
435  hr = m_focusManager->PushMenuBar(this);
436  else
437  hr = m_focusManager->PopMenuBar(this);
438  }
439 
440  return S_OK;
441 }
442 
444 {
445  if (m_subMenuChild)
446  {
447  m_subMenuChild->OnSelect(MPOS_CANCELLEVEL);
448  }
449 
450  if (m_subMenuChild)
451  {
452  TRACE("Child object should have removed itself.\n");
453  }
454 
455  ShowDW(FALSE);
456 
457  if (m_staticToolbar != NULL)
458  {
460  }
461 
462  if (m_SFToolbar != NULL)
463  {
464  m_SFToolbar->Close();
465  }
466 
467  if (m_site) m_site.Release();
470  if (m_childBand) m_childBand.Release();
471  if (m_parentBand) m_parentBand.Release();
472 
473  return S_OK;
474 }
475 
477 {
478  HRESULT hr;
479 
480  if (m_subMenuParent)
481  {
482  hr = m_subMenuParent->SetSubMenu(this, fActivate);
483  if (FAILED_UNEXPECTEDLY(hr))
484  return hr;
485  }
486 
487  if (fActivate)
488  {
489  CComPtr<IOleWindow> pTopLevelWindow;
490  hr = IUnknown_QueryService(m_site, SID_SMenuPopup, IID_PPV_ARG(IOleWindow, &pTopLevelWindow));
491  if (FAILED_UNEXPECTEDLY(hr))
492  return hr;
493 
494  hr = pTopLevelWindow->GetWindow(&m_topLevelWindow);
495  if (FAILED_UNEXPECTEDLY(hr))
496  return hr;
497  }
498  else
499  {
501  }
502 
503  return S_FALSE;
504 }
505 
506 HRESULT STDMETHODCALLTYPE CMenuBand::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
507 {
508  if (!pguidCmdGroup)
509  return E_FAIL;
510 
511  if (IsEqualGUID(*pguidCmdGroup, CLSID_MenuBand))
512  {
513  if (nCmdID == 16) // set (big) icon size
514  {
515  this->m_useBigIcons = nCmdexecopt == 2;
516  return S_OK;
517  }
518  else if (nCmdID == 19) // popup-related
519  {
520  return S_FALSE;
521  }
522  else if (nCmdID == 5) // select an item
523  {
524  if (nCmdexecopt == 0) // first
525  {
527  }
528  else // last
529  {
531  }
532  return S_FALSE;
533  }
534 
535  return S_FALSE;
536  }
537 
539  return S_OK;
540 }
541 
543 {
544  if (IsEqualIID(guidService, SID_SMenuBandChild) ||
545  IsEqualIID(guidService, SID_SMenuBandBottom) ||
546  IsEqualIID(guidService, SID_SMenuBandBottomSelected))
547  return this->QueryInterface(riid, ppvObject);
548  WARN("Unknown service requested %s\n", wine_dbgstr_guid(&guidService));
549  return E_NOINTERFACE;
550 }
551 
553 {
555  return S_OK;
556 }
557 
559 {
560  // When called from outside, this is straightforward:
561  // Things that a submenu needs to know, are spread down, and
562  // things that the parent needs to know, are spread up. No drama.
563  // The fun is in _MenuItemSelect (internal method).
564  switch (dwSelectType)
565  {
566  case MPOS_CHILDTRACKING:
567  if (!m_subMenuParent)
568  break;
569  // TODO: Cancel timers?
570  return m_subMenuParent->OnSelect(dwSelectType);
571  case MPOS_SELECTLEFT:
572  if (m_subMenuChild)
573  m_subMenuChild->OnSelect(MPOS_CANCELLEVEL);
574  if (!m_subMenuParent)
575  break;
576  return m_subMenuParent->OnSelect(dwSelectType);
577  case MPOS_SELECTRIGHT:
578  if (!m_subMenuParent)
579  break;
580  return m_subMenuParent->OnSelect(dwSelectType);
581  case MPOS_EXECUTE:
582  case MPOS_FULLCANCEL:
583  if (m_subMenuChild)
584  m_subMenuChild->OnSelect(dwSelectType);
585  if (!m_subMenuParent)
586  break;
587  return m_subMenuParent->OnSelect(dwSelectType);
588  case MPOS_CANCELLEVEL:
589  if (m_subMenuChild)
590  m_subMenuChild->OnSelect(dwSelectType);
591  break;
592  }
593  return S_FALSE;
594 }
595 
597 {
599  return S_OK;
600 }
601 
602 // Used by the focus manager to update the child band pointer
604 {
605  m_childBand = child;
606  if (!child)
607  {
608  _ChangePopupItem(NULL, -1);
609  }
610  return S_OK;
611 }
612 
613 // User by the focus manager to update the parent band pointer
615 {
617  return S_OK;
618 }
619 
621 {
622  return !(m_dwFlags & SMINIT_VERTICAL);
623 }
624 
626 {
627  return m_popupBar != NULL;
628 }
629 
631 {
632  CComPtr<IMenuPopup> child = m_subMenuChild;
633 
635 
636  if (child)
637  {
639  child.Release();
640  }
641 
642  if (!punkClient)
643  {
644  return S_OK;
645  }
646 
647  return punkClient->QueryInterface(IID_PPV_ARG(IMenuPopup, &m_subMenuChild));
648 }
649 
651 {
652  if (!ppunkClient)
653  return E_POINTER;
654  *ppunkClient = NULL;
655 
656  if (m_subMenuChild)
657  {
658  m_subMenuChild->AddRef();
659  *ppunkClient = m_subMenuChild;
660  }
661 
662  return S_OK;
663 }
664 
666 {
667  return S_FALSE;
668 }
669 
671 {
672  if (pmsg->message == WM_ACTIVATE && _IsPopup() == S_FALSE)
673  {
674  if (m_staticToolbar)
675  m_staticToolbar->Invalidate();
676  if (m_SFToolbar)
677  m_SFToolbar->Invalidate();
678  }
679 
680  return S_FALSE;
681 }
682 
684 {
685  if (!psf)
686  return E_INVALIDARG;
687 
688  if (m_SFToolbar == NULL)
689  {
690  m_SFToolbar = new CMenuSFToolbar(this);
691  }
692 
693  HRESULT hr = m_SFToolbar->SetShellFolder(psf, pidlFolder, hKey, dwFlags);
694  if (FAILED_UNEXPECTEDLY(hr))
695  return hr;
696 
697  m_shellBottom = (dwFlags & SMSET_BOTTOM) != 0;
698 
699  if (m_site)
700  {
702 
703  hr = m_site->GetWindow(&hwndParent);
704  if (FAILED_UNEXPECTEDLY(hr))
705  return hr;
706 
708  if (FAILED_UNEXPECTEDLY(hr))
709  return hr;
710 
712  }
713 
714  return hr;
715 }
716 
718 {
719  if (m_SFToolbar)
720  return m_SFToolbar->GetShellFolder(pdwFlags, ppidl, riid, ppv);
721  return E_FAIL;
722 }
723 
725 {
726  if (theResult)
727  *theResult = 0;
728 
729  if (uMsg == WM_WININICHANGE && wParam == SPI_SETFLATMENU)
730  {
731  BOOL bFlatMenus;
732  SystemParametersInfo(SPI_GETFLATMENU, 0, &bFlatMenus, 0);
733  AdjustForTheme(bFlatMenus);
734 
735  if (m_staticToolbar)
736  m_staticToolbar->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
737 
738  if (m_SFToolbar)
739  m_SFToolbar->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
740 
741  return S_OK;
742  }
743 
745  {
746  return m_staticToolbar->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
747  }
748 
750  {
751  return m_SFToolbar->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
752  }
753 
754  return S_FALSE;
755 }
756 
758 {
760  return S_OK;
761 
763  return S_OK;
764 
765  return S_FALSE;
766 }
767 
769 {
770  return _CallCB(uMsg, wParam, lParam, id);
771 }
772 
774 {
775  return _CallCB(uMsg, wParam, lParam, 0, pidl);
776 }
777 
779 {
780  if (!m_psmc)
781  return S_FALSE;
782 
783  SMDATA smData = { 0 };
784  smData.punk = static_cast<IShellMenu2*>(this);
785  smData.uId = id;
786  smData.uIdParent = m_uId;
787  smData.uIdAncestor = m_uIdAncestor;
788  smData.pidlItem = pidl;
790  smData.hmenu = m_hmenu;
791  if (m_SFToolbar)
793  HRESULT hr = m_psmc->CallbackSM(&smData, uMsg, wParam, lParam);
794  ILFree(smData.pidlFolder);
795  if (smData.psf)
796  smData.psf->Release();
797  return hr;
798 }
799 
801 {
802  TPMPARAMS params = { sizeof(TPMPARAMS), rcExclude };
803  UINT flags = TPM_VERPOSANIMATION | TPM_VERTICAL | TPM_LEFTALIGN;
805 
806  m_trackedPopup = popup;
808 
810  ::TrackPopupMenuEx(popup, flags, x, y, hwnd, &params);
812 
815 
817 
818  return S_OK;
819 }
820 
822 {
823  HRESULT hr;
824  UINT uCommand;
825 
826  // Ensure that the menu doesn't disappear on us
827  CComPtr<IContextMenu> ctxMenu = contextMenu;
828 
829  HMENU popup = CreatePopupMenu();
830 
831  if (popup == NULL)
832  return E_FAIL;
833 
834  TRACE("Before Query\n");
835  hr = contextMenu->QueryContextMenu(popup, 0, 0, UINT_MAX, CMF_NORMAL);
836  if (FAILED_UNEXPECTEDLY(hr))
837  {
838  TRACE("Query failed\n");
839  DestroyMenu(popup);
840  return hr;
841  }
842 
844 
846 
847  TRACE("Before Tracking\n");
848  uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, x, y, hwnd, NULL);
849 
851 
852  if (uCommand != 0)
853  {
855 
856  TRACE("Before InvokeCommand\n");
857  CMINVOKECOMMANDINFO cmi = { 0 };
858  cmi.cbSize = sizeof(cmi);
859  cmi.lpVerb = MAKEINTRESOURCEA(uCommand);
860  cmi.hwnd = hwnd;
861  hr = contextMenu->InvokeCommand(&cmi);
862  TRACE("InvokeCommand returned hr=%08x\n", hr);
863  }
864  else
865  {
866  TRACE("TrackPopupMenu failed. Code=%d, LastError=%d\n", uCommand, GetLastError());
867  hr = S_FALSE;
868  }
869 
870  DestroyMenu(popup);
871  return hr;
872 }
873 
875 {
876  *topLevel = m_topLevelWindow;
877  return S_OK;
878 }
879 
881 {
882  if (m_hotBar == tb && m_hotItem == id)
883  return S_FALSE;
884 
885  TRACE("Hot item changed from %p %p, to %p %p\n", m_hotBar, m_hotItem, tb, id);
886 
888 
889  m_hotBar = tb;
890  m_hotItem = id;
893 
895 
896  return S_OK;
897 }
898 
900 {
901  TRACE("Popup item changed from %p %p, to %p %p\n", m_popupBar, m_popupItem, tb, id);
902 
903  m_popupBar = tb;
904  m_popupItem = id;
907 
908  return S_OK;
909 }
910 
912 {
913  HRESULT hr;
915 
916  if (!tb)
917  {
918  // If no hot item was selected choose the appropriate toolbar
919  if (change == VK_UP || change == VK_END)
920  {
921  if (m_staticToolbar)
923  else
924  tb = m_SFToolbar;
925  }
926  else if (change == VK_DOWN || change == VK_HOME)
927  {
928  if (m_SFToolbar)
929  tb = m_SFToolbar;
930  else
932  }
933  }
934 
935  // Ask the first toolbar to change
936  hr = tb->KeyboardItemChange(change);
937 
938  if (hr != S_FALSE)
939  return hr;
940 
941  // Select the second toolbar based on the first
942  if (tb == m_SFToolbar && m_staticToolbar)
944  else if (m_SFToolbar)
945  tb = m_SFToolbar;
946 
947  if (!tb)
948  return hr;
949 
950  // Ask the second toolbar to change
951  return tb->KeyboardItemChange(change == VK_DOWN ? VK_HOME : VK_END);
952 }
953 
955 {
956  // Needed to prevent the this point from vanishing mid-function
957  CComPtr<CMenuBand> safeThis = this;
958  HRESULT hr;
959 
960  if (m_dwFlags & SMINIT_VERTICAL)
961  {
962  switch (changeType)
963  {
964  case VK_UP:
965  case VK_DOWN:
966  return _KeyboardItemChange(changeType);
967 
968  // TODO: Left/Right across multi-column menus, if they ever work.
969  case VK_LEFT:
970  changeType = MPOS_SELECTLEFT;
971  break;
972  case VK_RIGHT:
973  changeType = MPOS_SELECTRIGHT;
974  break;
975  }
976  }
977  else
978  {
979  // In horizontal menubars, left/right are equivalent to vertical's up/down
980  switch (changeType)
981  {
982  case VK_LEFT:
984  if (hr != S_FALSE)
985  return hr;
986  case VK_RIGHT:
988  if (hr != S_FALSE)
989  return hr;
990  }
991  }
992 
993  // In this context, the parent is the CMenuDeskBar, so when it bubbles upward,
994  // it is notifying the deskbar, and not the the higher-level menu.
995  // Same for the child: since it points to a CMenuDeskBar, it's not just recursing.
996  switch (changeType)
997  {
998  case MPOS_EXECUTE:
999  {
1001  int item = m_hotItem;
1002  tb->PrepareExecuteItem(item);
1003  if (m_subMenuParent)
1004  {
1005  m_subMenuParent->OnSelect(changeType);
1006  }
1007  TRACE("Menu closed, executing item...\n");
1008  tb->ExecuteItem();
1009  break;
1010  }
1011  case MPOS_SELECTLEFT:
1012  if (m_parentBand && m_parentBand->_IsPopup()==S_FALSE)
1013  return m_parentBand->_MenuItemSelect(VK_LEFT);
1014  if (m_subMenuChild)
1015  return m_subMenuChild->OnSelect(MPOS_CANCELLEVEL);
1016  if (!m_subMenuParent)
1017  return S_OK;
1018  return m_subMenuParent->OnSelect(MPOS_CANCELLEVEL);
1019 
1020  case MPOS_SELECTRIGHT:
1021  if (m_hotBar && m_hotItem >= 0 && m_hotBar->PopupItem(m_hotItem, TRUE) == S_OK)
1022  return S_FALSE;
1023  if (m_parentBand)
1024  return m_parentBand->_MenuItemSelect(VK_RIGHT);
1025  if (!m_subMenuParent)
1026  return S_OK;
1027  return m_subMenuParent->OnSelect(MPOS_SELECTRIGHT);
1028 
1029  default:
1030  if (!m_subMenuParent)
1031  return S_OK;
1032  return m_subMenuParent->OnSelect(changeType);
1033  }
1034 
1035  return S_OK;
1036 }
1037 
1039 {
1040  if (m_subMenuChild)
1041  {
1043  return hr;
1044  }
1045 
1046  if (m_trackedPopup)
1047  {
1049  return S_OK;
1050  }
1051 
1052  return S_FALSE;
1053 }
1054 
1055 HRESULT CMenuBand::_OnPopupSubMenu(IShellMenu * childShellMenu, POINTL * pAt, RECTL * pExclude, BOOL keyInitiated)
1056 {
1057  HRESULT hr = 0;
1058  CComPtr<IBandSite> pBandSite;
1059  CComPtr<IDeskBar> pDeskBar;
1060 
1061  // Create the necessary objects
1063  if (FAILED_UNEXPECTEDLY(hr))
1064  return hr;
1065 
1067  if (FAILED_UNEXPECTEDLY(hr))
1068  return hr;
1069 
1070  hr = pDeskBar->SetClient(pBandSite);
1071  if (FAILED_UNEXPECTEDLY(hr))
1072  return hr;
1073 
1074  hr = pBandSite->AddBand(childShellMenu);
1075  if (FAILED_UNEXPECTEDLY(hr))
1076  return hr;
1077 
1078  //
1079  CComPtr<IMenuPopup> popup;
1080  hr = pDeskBar->QueryInterface(IID_PPV_ARG(IMenuPopup, &popup));
1081  if (FAILED_UNEXPECTEDLY(hr))
1082  return hr;
1083 
1084  m_subMenuChild = popup;
1085 
1086  if (m_subMenuParent)
1088  else
1089  IUnknown_SetSite(popup, m_site);
1090 
1092 
1093  if (keyInitiated && m_dwFlags & SMINIT_VERTICAL)
1095 
1096  popup->Popup(pAt, pExclude, flags);
1097 
1098  return S_OK;
1099 }
1100 
1102 {
1103  if (m_staticToolbar)
1105  if (m_SFToolbar)
1107  return S_OK;
1108 }
1109 
1111 {
1112  if (m_staticToolbar)
1114  if (m_SFToolbar)
1115  m_SFToolbar->DisableMouseTrack(bDisable);
1116  return S_OK;
1117 }
1118 
1120 {
1121  HRESULT hr = S_OK;
1122  if (m_staticToolbar)
1124  if (FAILED(hr))
1125  return hr;
1126 
1127  if (m_SFToolbar)
1129 
1130  return hr;
1131 }
1132 
1134 {
1136  m_staticToolbar->MenuBarMouseDown(item, isLButton);
1138  m_SFToolbar->MenuBarMouseDown(item, isLButton);
1139  return S_OK;
1140 }
1141 
1143 {
1145  m_staticToolbar->MenuBarMouseUp(item, isLButton);
1147  m_SFToolbar->MenuBarMouseUp(item, isLButton);
1148  return S_OK;
1149 }
1150 
1152 {
1153  return m_popupBar ? S_OK : S_FALSE;
1154 }
1155 
1157 {
1158  return IUnknown_QueryServiceExec(m_site, SID_SMenuPopup, &CGID_MenuDeskBar, 4, bFlatStyle, NULL, NULL);
1159 }
1160 
1162 {
1163  UNIMPLEMENTED;
1164  return S_OK;
1165 }
1166 
1168 {
1169  UNIMPLEMENTED;
1170  return S_OK;
1171 }
1172 
1174 {
1175  UNIMPLEMENTED;
1176  return S_OK;
1177 }
1178 
1180 {
1181  UNIMPLEMENTED;
1182  return S_OK;
1183 }
1184 
1186 {
1187  UNIMPLEMENTED;
1188  return S_OK;
1189 }
1190 
1192 {
1193  UNIMPLEMENTED;
1194  return S_OK;
1195 }
1196 
1198 {
1199  UNIMPLEMENTED;
1200  return S_OK;
1201 }
1202 
1204 {
1205  UNIMPLEMENTED;
1206  return S_OK;
1207 }
1208 
1210 {
1211  UNIMPLEMENTED;
1212  return S_OK;
1213 }
1214 
1216 {
1217  UNIMPLEMENTED;
1218  return S_OK;
1219 }
1220 
1222 {
1223  UNIMPLEMENTED;
1224  return S_OK;
1225 }
1226 
1228 {
1229  UNIMPLEMENTED;
1230  return S_OK;
1231 }
1232 
1234 {
1235  UNIMPLEMENTED;
1236  return S_OK;
1237 }
1238 
1240 {
1241  UNIMPLEMENTED;
1242  return S_OK;
1243 }
1244 
1246 {
1247  UNIMPLEMENTED;
1248  return S_OK;
1249 }
1250 
1252 {
1253  UNIMPLEMENTED;
1254  return S_OK;
1255 }
1256 
1258 {
1259  UNIMPLEMENTED;
1260  return S_OK;
1261 }
1262 
1264 {
1265  if (m_popupBar)
1266  return S_OK;
1267  return S_FALSE;
1268 }
1269 
1271 {
1272  // TODO: Alt down -> toggle menu focus
1273  return S_FALSE;
1274 }
1275 
1277 {
1278  UNIMPLEMENTED;
1279  return S_OK;
1280 }
1281 
1283 {
1284  UNIMPLEMENTED;
1285  return S_OK;
1286 }
1287 
1289 {
1290  UNIMPLEMENTED;
1291  return S_OK;
1292 }
1293 
1295 {
1296  UNIMPLEMENTED;
1297  return S_OK;
1298 }
1299 
1301 {
1302  UNIMPLEMENTED;
1303  return S_OK;
1304 }
1305 
1306 HRESULT STDMETHODCALLTYPE CMenuBand::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
1307 {
1308  UNIMPLEMENTED;
1309  return S_OK;
1310 }
1311 
1312 extern "C"
1314 {
1315  return ShellObjectCreator<CMenuBand>(riid, ppv);
1316 }
DBIM_BKCOLOR struct tagDESKBANDINFO DESKBANDINFO
HWND m_topLevelWindow
Definition: CMenuBand.h:62
HRESULT _BeforeCancelPopup()
Definition: CMenuBand.cpp:1101
#define TPM_VERTICAL
Definition: winuser.h:2336
HRESULT _CallCB(UINT uMsg, WPARAM wParam, LPARAM lParam, UINT id=0, LPITEMIDLIST pidl=NULL)
Definition: CMenuBand.cpp:778
virtual HRESULT STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER *pcbSize)
Definition: CMenuBand.cpp:1294
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define max(a, b)
Definition: svc.c:63
#define REFIID
Definition: guiddef.h:113
#define TRUE
Definition: types.h:120
HWND m_menuOwner
Definition: CMenuBand.h:59
HMENU m_hmenu
Definition: CMenuBand.h:58
HRESULT QueryContextMenu([in] HMENU hmenu, [in] UINT indexMenu, [in] UINT idCmdFirst, [in] UINT idCmdLast, [in] UINT uFlags)
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
#define E_NOINTERFACE
Definition: winerror.h:2364
virtual HRESULT STDMETHODCALLTYPE GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi)
Definition: CMenuBand.cpp:342
static CMenuFocusManager * AcquireManager()
virtual HRESULT STDMETHODCALLTYPE SetMinWidth(THIS)
Definition: CMenuBand.cpp:1203
LPITEMIDLIST pidlItem
Definition: shobjidl.idl:2624
virtual HRESULT STDMETHODCALLTYPE GetMenu(HMENU *phmenu, HWND *phwnd, DWORD *pdwFlags)
Definition: CMenuBand.cpp:176
HRESULT hr
Definition: shlfolder.c:183
static HMENU hmenu
Definition: win.c:66
Definition: scsiwmi.h:51
BOOL WINAPI IsWindow(_In_opt_ HWND)
virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, PVOID *ppvSite)
Definition: CMenuBand.cpp:251
virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject)
Definition: CMenuBand.cpp:542
#define THIS
Definition: basetyps.h:66
HRESULT _KeyboardItemChange(DWORD change)
Definition: CMenuBand.cpp:911
virtual HRESULT STDMETHODCALLTYPE GetState(LPSMDATA psmd)
Definition: CMenuBand.cpp:1167
#define TPM_LEFTALIGN
Definition: winuser.h:2331
REFIID riid
Definition: precomp.h:44
HRESULT PopTrackedPopup(HMENU popup)
virtual HRESULT FillToolbar(BOOL clearFirst=FALSE)
INT m_popupItem
Definition: CMenuBand.h:67
INT BOOL fShow
Definition: msvc.h:54
#define TPM_RETURNCMD
Definition: winuser.h:2341
HRESULT _GetTopLevelWindow(HWND *topLevel)
Definition: CMenuBand.cpp:874
UINT uIdParent
Definition: shobjidl.idl:2620
virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm)
Definition: CMenuBand.cpp:1282
HRESULT ChangeHotItem(CMenuToolbarBase *toolbar, INT item, DWORD dwFlags)
CMenuStaticToolbar * m_staticToolbar
Definition: CMenuBand.h:44
BOOL m_shellBottom
Definition: CMenuBand.h:70
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define WARN(fmt,...)
Definition: debug.h:111
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
virtual HRESULT STDMETHODCALLTYPE HasFocusIO()
Definition: CMenuBand.cpp:1263
virtual HRESULT STDMETHODCALLTYPE DoDefaultAction(THIS)
Definition: CMenuBand.cpp:1251
CComPtr< IOleWindow > m_site
Definition: CMenuBand.h:47
HWND hWnd
Definition: settings.c:17
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define SystemParametersInfo
Definition: winuser.h:5724
LONG top
Definition: windef.h:292
IUnknown * punk
Definition: shobjidl.idl:2622
#define VK_LEFT
Definition: winuser.h:2178
const char * wine_dbgstr_guid(const GUID *guid)
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
HRESULT CreateToolbar(HWND hwndParent, DWORD dwFlags)
HRESULT WINAPI IUnknown_QueryServiceExec(IUnknown *lpUnknown, REFIID service, const GUID *group, DWORD cmdId, DWORD cmdOpt, VARIANT *pIn, VARIANT *pOut)
Definition: ordinal.c:1500
#define VK_DOWN
Definition: winuser.h:2181
HRESULT PushTrackedPopup(HMENU popup)
#define CMenuDeskBar_CreateInstance
Definition: shellmenu.h:75
LONG left
Definition: windef.h:291
virtual HRESULT STDMETHODCALLTYPE GetMenuInfo(IShellMenuCallback **ppsmc, UINT *puId, UINT *puIdAncestor, DWORD *pdwFlags)
Definition: CMenuBand.cpp:91
CComPtr< IShellMenuCallback > m_psmc
Definition: CMenuBand.h:48
LONG right
Definition: windef.h:293
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
HRESULT _CancelCurrentPopup()
Definition: CMenuBand.cpp:1038
int32_t INT
Definition: typedefs.h:56
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1448
static HWND child
Definition: cursoricon.c:298
virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow)
Definition: CMenuBand.cpp:391
WPARAM wParam
Definition: combotst.c:138
UINT_PTR WPARAM
Definition: windef.h:207
INT INT y
Definition: msvc.h:62
virtual HRESULT STDMETHODCALLTYPE IsEmpty(THIS)
Definition: CMenuBand.cpp:1257
#define VK_HOME
Definition: winuser.h:2177
HRESULT PopMenuBar(CMenuBand *mb)
HRESULT KillPopupTimer()
#define VK_UP
Definition: winuser.h:2179
HRESULT _KillPopupTimers()
Definition: CMenuBand.cpp:1119
GLenum const GLfloat * params
Definition: glext.h:5645
HRESULT PushMenuBar(CMenuBand *mb)
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
LONG_PTR LPARAM
Definition: windef.h:208
HRESULT MenuBarMouseUp(INT iIndex, BOOL isLButton)
PVOID m_UserData
Definition: CMenuBand.h:57
HRESULT _ChangeHotItem(CMenuToolbarBase *tb, INT id, DWORD dwFlags)
Definition: CMenuBand.cpp:880
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: ordinal.c:1358
HRESULT BeforeCancelPopup()
HRESULT PopMenuPopup(CMenuBand *mb)
ULONG Release()
#define S_FALSE
Definition: winerror.h:2357
virtual HRESULT STDMETHODCALLTYPE OnPosRectChangeDB(RECT *prc)
Definition: CMenuBand.cpp:272
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT _MenuBarMouseUp(HWND hwnd, INT item, BOOL isLButton)
Definition: CMenuBand.cpp:1142
virtual HRESULT STDMETHODCALLTYPE InvalidateItem(LPSMDATA psmd, DWORD dwFlags)
Definition: CMenuBand.cpp:1161
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
HRESULT ShowDW(BOOL fShow)
#define CMenuSite_CreateInstance
Definition: shellmenu.h:87
#define WM_WININICHANGE
Definition: winuser.h:1612
HRESULT PopupItem(INT iItem, BOOL keyInitiated)
LONG cx
Definition: windef.h:319
virtual HRESULT STDMETHODCALLTYPE SetShellFolder(IShellFolder *psf, LPCITEMIDLIST pidlFolder, HKEY hKey, DWORD dwFlags)
Definition: CMenuBand.cpp:683
HRESULT _SetChildBand(CMenuBand *child)
Definition: CMenuBand.cpp:603
BOOL m_useBigIcons
Definition: CMenuBand.h:61
virtual HRESULT STDMETHODCALLTYPE CloseDW(DWORD dwReserved)
Definition: CMenuBand.cpp:443
virtual HRESULT STDMETHODCALLTYPE IsMenuMessage(MSG *pmsg)
Definition: CMenuBand.cpp:665
UINT m_uIdAncestor
Definition: CMenuBand.h:55
HRESULT _OnPopupSubMenu(IShellMenu *childShellMenu, POINTL *pAt, RECTL *pExclude, BOOL mouseInitiated)
Definition: CMenuBand.cpp:1055
HRESULT OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
HRESULT _CallCBWithItemPidl(LPITEMIDLIST pidl, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CMenuBand.cpp:773
virtual HRESULT STDMETHODCALLTYPE GetParentSite(THIS)
Definition: CMenuBand.cpp:1239
virtual HRESULT STDMETHODCALLTYPE OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
Definition: CMenuBand.cpp:724
CComPtr< CMenuBand > m_childBand
Definition: CMenuBand.h:51
IShellFolder * psf
Definition: shobjidl.idl:2625
HRESULT _ChangePopupItem(CMenuToolbarBase *tb, INT id)
Definition: CMenuBand.cpp:899
struct tagTPMPARAMS TPMPARAMS
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int BOOL
Definition: ntddk_ex.h:94
r parent
Definition: btrfs.c:2659
UINT uIdAncestor
Definition: shobjidl.idl:2621
HRESULT _DisableMouseTrack(BOOL bDisable)
Definition: CMenuBand.cpp:1110
LONG HRESULT
Definition: typedefs.h:77
virtual HRESULT STDMETHODCALLTYPE GetTracked(THIS)
Definition: CMenuBand.cpp:1233
virtual HRESULT STDMETHODCALLTYPE GetShellFolder(DWORD *pdwFlags, LPITEMIDLIST *ppidl, REFIID riid, void **ppv)
Definition: CMenuBand.cpp:717
HRESULT _TrackContextMenu(IContextMenu *popup, INT x, INT y)
Definition: CMenuBand.cpp:821
virtual HRESULT STDMETHODCALLTYPE SetMenu(HMENU hmenu, HWND hwnd, DWORD dwFlags)
Definition: CMenuBand.cpp:118
virtual HRESULT STDMETHODCALLTYPE IsWindowOwner(HWND hWnd)
Definition: CMenuBand.cpp:757
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
BOOL m_Show
Definition: CMenuBand.h:69
unsigned int UINT
Definition: ndis.h:50
HWND m_trackedHwnd
Definition: CMenuBand.h:73
virtual HRESULT STDMETHODCALLTYPE Popup(POINTL *ppt, RECTL *prcExclude, MP_POPUPFLAGS dwFlags)
Definition: CMenuBand.cpp:552
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
nsrefcnt Release()
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR tb[]
Definition: suminfo.c:286
CMenuToolbarBase * m_popupBar
Definition: CMenuBand.h:66
HRESULT SetMenu(HMENU hmenu, HWND hwnd, DWORD dwFlags)
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode)
Definition: CMenuBand.cpp:1185
virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW(LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved)
Definition: CMenuBand.cpp:1179
GLbitfield flags
Definition: glext.h:7161
CComPtr< CMenuBand > m_parentBand
Definition: CMenuBand.h:52
WINE_DEFAULT_DEBUG_CHANNEL(CMenuBand)
virtual HRESULT STDMETHODCALLTYPE SetTheme(THIS)
Definition: CMenuBand.cpp:1215
virtual HRESULT STDMETHODCALLTYPE GetTop(THIS)
Definition: CMenuBand.cpp:1221
HRESULT _CallCBWithItemId(UINT Id, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CMenuBand.cpp:768
DWORD m_dwFlags
Definition: CMenuBand.h:56
HRESULT _SetParentBand(CMenuBand *parent)
Definition: CMenuBand.cpp:614
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
INT m_hotItem
Definition: CMenuBand.h:65
#define WM_CANCELMODE
Definition: winuser.h:1617
UINT m_uId
Definition: CMenuBand.h:54
virtual HRESULT STDMETHODCALLTYPE GetClient(IUnknown **ppunkClient)
Definition: CMenuBand.cpp:650
REFIID LPVOID * ppvObject
Definition: precomp.h:44
virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL fActivate, LPMSG lpMsg)
Definition: CMenuBand.cpp:476
LPITEMIDLIST pidlFolder
Definition: shobjidl.idl:2623
#define WINAPI
Definition: msvc.h:20
HRESULT _IsPopup()
Definition: CMenuBand.cpp:620
BOOL WINAPI DestroyMenu(_In_ HMENU)
CComPtr< IMenuPopup > m_subMenuParent
Definition: CMenuBand.h:50
CComPtr< IMenuPopup > m_subMenuChild
Definition: CMenuBand.h:49
virtual HRESULT STDMETHODCALLTYPE TranslateMenuMessage(MSG *pmsg, LRESULT *plRet)
Definition: CMenuBand.cpp:670
#define VK_RIGHT
Definition: winuser.h:2180
HRESULT AdjustForTheme(BOOL bFlatStyle)
Definition: CMenuBand.cpp:1156
virtual HRESULT STDMETHODCALLTYPE GetBottom(THIS)
Definition: CMenuBand.cpp:1227
HRESULT ChangePopupItem(CMenuToolbarBase *toolbar, INT item)
HRESULT _HasSubMenu()
Definition: CMenuBand.cpp:1151
virtual HRESULT STDMETHODCALLTYPE SetToolbar(THIS)
Definition: CMenuBand.cpp:1197
HMENU m_trackedPopup
Definition: CMenuBand.h:72
#define UINT_MAX
Definition: limits.h:41
#define S_OK
Definition: intsafe.h:59
static ATOM item
Definition: dde.c:856
HRESULT SetShellFolder(IShellFolder *psf, LPCITEMIDLIST pidlFolder, HKEY hKey, DWORD dwFlags)
#define WM_ACTIVATE
Definition: winuser.h:1594
HRESULT IsWindowOwner(HWND hwnd)
INT x
Definition: msvc.h:62
#define UNIMPLEMENTED
Definition: CMenuBand.cpp:33
HRESULT _TrackSubMenu(HMENU popup, INT x, INT y, RECT &rcExclude)
Definition: CMenuBand.cpp:800
HRESULT MenuBarMouseDown(INT iIndex, BOOL isLButton)
void Release()
Definition: atlcomcli.h:134
virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty)
Definition: CMenuBand.cpp:1288
#define min(a, b)
Definition: monoChain.cc:55
HRESULT WINAPI RSHELL_CMenuBand_CreateInstance(REFIID riid, LPVOID *ppv)
Definition: CMenuBand.cpp:1313
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
HRESULT InvokeCommand([in] LPCMINVOKECOMMANDINFO lpici)
virtual HRESULT STDMETHODCALLTYPE SetSubMenu(IMenuPopup *pmp, BOOL fSet)
Definition: CMenuBand.cpp:596
HRESULT SetPosSize(int x, int y, int cx, int cy)
HRESULT _IsTracking()
Definition: CMenuBand.cpp:625
static void ReleaseManager(CMenuFocusManager *obj)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:846
HRESULT GetMenu(HMENU *phmenu, HWND *phwnd, DWORD *pdwFlags)
#define SendMessage
Definition: winuser.h:5709
virtual HRESULT FillToolbar(BOOL clearFirst=FALSE)
virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
Definition: CMenuBand.cpp:1306
unsigned int ULONG
Definition: retypes.h:1
GLenum GLuint id
Definition: glext.h:5579
LONG bottom
Definition: windef.h:294
HRESULT PushMenuPopup(CMenuBand *mb)
virtual HRESULT STDMETHODCALLTYPE Initialize(IShellMenuCallback *psmc, UINT uId, UINT uIdAncestor, DWORD dwFlags)
Definition: CMenuBand.cpp:71
virtual HRESULT STDMETHODCALLTYPE SetNoBorder(THIS)
Definition: CMenuBand.cpp:1209
virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: CMenuBand.cpp:506
virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID)
Definition: CMenuBand.cpp:1300
virtual ~CMenuBand()
Definition: CMenuBand.cpp:60
HRESULT _MenuBarMouseDown(HWND hwnd, INT item, BOOL isLButton)
Definition: CMenuBand.cpp:1133
virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *phwnd)
Definition: CMenuBand.cpp:259
LONG_PTR LRESULT
Definition: windef.h:209
virtual HRESULT STDMETHODCALLTYPE OnSelect(DWORD dwSelectType)
Definition: CMenuBand.cpp:558
HRESULT DisableMouseTrack(BOOL bDisable)
#define E_POINTER
Definition: winerror.h:2365
virtual HRESULT STDMETHODCALLTYPE SetMenuToolbar(IUnknown *punk, DWORD dwFlags)
Definition: CMenuBand.cpp:1173
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
int MP_POPUPFLAGS
Definition: shobjidl.idl:2486
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
CMenuSFToolbar * m_SFToolbar
Definition: CMenuBand.h:45
LONG cy
Definition: windef.h:320
CMenuFocusManager * m_focusManager
Definition: CMenuBand.h:43
LPARAM lParam
Definition: combotst.c:139
HMENU hmenu
Definition: shobjidl.idl:2617
virtual HRESULT STDMETHODCALLTYPE GetSubMenu(THIS)
Definition: CMenuBand.cpp:1191
#define VK_END
Definition: winuser.h:2176
virtual HRESULT STDMETHODCALLTYPE IsDirty()
Definition: CMenuBand.cpp:1276
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90
virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO(LPMSG lpMsg)
Definition: CMenuBand.cpp:1270
#define SUCCEEDED(hr)
Definition: intsafe.h:57
CMenuToolbarBase * m_hotBar
Definition: CMenuBand.h:64
HRESULT GetSizes(SIZE *pMinSize, SIZE *pMaxSize, SIZE *pIntegralSize)
HRESULT GetWindow(HWND *phwnd)
virtual HRESULT STDMETHODCALLTYPE SetClient(IUnknown *punkClient)
Definition: CMenuBand.cpp:630
HRESULT GetShellFolder(DWORD *pdwFlags, LPITEMIDLIST *ppidl, REFIID riid, void **ppv)
virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite)
Definition: CMenuBand.cpp:187
HRESULT _MenuItemSelect(DWORD changeType)
Definition: CMenuBand.cpp:954