ReactOS 0.4.17-dev-357-ga8f14ff
CMenuDeskBar.cpp
Go to the documentation of this file.
1/*
2 * Shell Menu Desk Bar
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 <atlwin.h>
22#include <shlwapi_undoc.h>
23
24#include "CMenuDeskBar.h"
25
26/* As far as I can tell, the submenu hierarchy looks like this:
27*
28* The DeskBar's Child is the Band it contains.
29* The DeskBar's Parent is the SID_SMenuPopup of the Site.
30*
31* The Band's Child is the IMenuPopup of the child submenu.
32* The Band's Parent is the SID_SMenuPopup of the Site (the DeskBar).
33*
34* When the DeskBar receives a selection event:
35* If it requires closing the window, it will notify the Child (Band) using CancelLevel.
36* If it has to spread upwards (everything but CancelLevel), it will notify the Parent.
37*
38* When the Band receives a selection event, this is where it gets fuzzy:
39* In which cases does it call the Parent? Probably not CancelLevel.
40* In which cases does it call the Child?
41* How does it react to calls?
42*
43*/
44
45
47
49 m_Client(NULL),
50 m_ClientWindow(NULL),
51 m_IconSize(0),
52 m_Banner(NULL),
53 m_Shown(FALSE),
54 m_ShowFlags(0),
55 m_didAddRef(FALSE)
56{
57}
58
60{
61}
62
64{
65 if (!m_didAddRef)
66 {
67 this->AddRef();
69 }
70
71 bHandled = FALSE;
72 return 0;
73}
74
76{
77 if (m_didAddRef)
78 {
79 this->Release();
81 }
82}
83
85{
86 return S_OK;
87}
88
90{
91 if (lphwnd == NULL)
92 return E_POINTER;
93 *lphwnd = m_hWnd;
94 return S_OK;
95}
96
98{
99 return E_NOTIMPL;
100}
101
103{
104 return IUnknown_OnFocusChangeIS(m_Client, punkObj, fSetFocus);
105}
106
108 OLECMD prgCmds [], OLECMDTEXT *pCmdText)
109{
110 return E_NOTIMPL;
111}
112
114 DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
115{
116 if (IsEqualIID(*pguidCmdGroup, CGID_MenuDeskBar))
117 {
118 switch (nCmdID)
119 {
120 case 2: // refresh
121 return S_OK;
122 case 3: // load complete
123 return S_OK;
124 case 4: // set font metrics
125 return _AdjustForTheme(nCmdexecopt);
126 }
127 }
128 else if (IsEqualIID(*pguidCmdGroup, CLSID_MenuBand))
129 {
130 switch (nCmdID)
131 {
132 case 0x10000000: // refresh (sent from TRAYCMD_RELOAD_STARTMENUCFG)
133 {
134 CComPtr<IShellMenu2> pSM; // We just want IShellMenu but CMenuBand::QI is broken?
135 if (SUCCEEDED(IUnknown_QueryService(m_Client, SID_SMenuBandBottom, IID_PPV_ARG(IShellMenu2, &pSM))))
136 pSM->InvalidateItem(NULL, SMINV_REFRESH);
137 return S_OK;
138 }
139 }
140 }
141 /*else if (IsEqualIID(*pguidCmdGroup, CGID_Explorer))
142 {
143 }*/
144 else if (IsEqualIID(*pguidCmdGroup, IID_IDeskBarClient))
145 {
146 switch (nCmdID)
147 {
148 case 0:
149 // hide current band
150 break;
151 case 2:
152 break;
153 case 3:
154 break;
155 }
156 }
157 return E_NOTIMPL;
158}
159
161{
162 HRESULT hr;
163
164 if (IsEqualGUID(guidService, SID_SMenuPopup) ||
165 IsEqualGUID(guidService, SID_SMenuBandParent) ||
166 IsEqualGUID(guidService, SID_STopLevelBrowser))
167 {
168 hr = this->QueryInterface(riid, ppvObject);
169 if (SUCCEEDED(hr))
170 return hr;
171 }
172
173 if (IsEqualGUID(guidService, SID_SMenuBandBottom) ||
174 IsEqualGUID(guidService, SID_SMenuBandBottomSelected) ||
175 IsEqualGUID(guidService, SID_SMenuBandChild))
176 {
177 if (m_Client == NULL)
178 return E_NOINTERFACE;
179
180 hr = IUnknown_QueryService(m_Client, guidService, riid, ppvObject);
181 if (SUCCEEDED(hr))
182 return hr;
183 }
184
185
186 if (m_Site == NULL)
187 return E_NOINTERFACE;
188
189 return IUnknown_QueryService(m_Site, guidService, riid, ppvObject);
190}
191
193{
194 return IUnknown_UIActivateIO(m_Client, fActivate, lpMsg);
195}
196
198{
200}
201
203{
205}
206
208{
209 CComPtr<IDeskBarClient> pDeskBandClient;
210 HRESULT hr;
211
212 if (m_Client)
213 {
214 hr = m_Client->QueryInterface(IID_PPV_ARG(IDeskBarClient, &pDeskBandClient));
216 return hr;
217
218 pDeskBandClient->SetDeskBarSite(NULL);
219
220 pDeskBandClient = NULL;
221 m_Client = NULL;
222 }
223
224 if (punkClient == NULL)
225 return S_OK;
226
227 if (m_hWnd == NULL)
228 {
229 Create(NULL);
230 }
231
234 return hr;
235
236 hr = m_Client->QueryInterface(IID_PPV_ARG(IDeskBarClient, &pDeskBandClient));
238 return hr;
239
240 hr = pDeskBandClient->SetDeskBarSite(static_cast<IDeskBar*>(this));
242 return hr;
243
245}
246
248{
249 if (ppunkClient == NULL)
250 return E_POINTER;
251
252 if (!m_Client)
253 return E_FAIL;
254
255 return m_Client->QueryInterface(IID_PPV_ARG(IUnknown, ppunkClient));
256}
257
259{
260 if (prc == NULL)
261 return E_POINTER;
262
263 return S_OK;
264}
265
267{
268 // Windows closes the bar if this is called when the bar is shown
269
270 if (m_Shown)
271 _CloseBar();
272
274
275 m_Site = pUnkSite;
276
277 if (m_Site)
278 {
280 }
281 else
282 {
285 }
286
287 return S_OK;
288}
289
291{
292 if (m_Site == NULL)
293 return E_FAIL;
294
295 return m_Site->QueryInterface(riid, ppvSite);
296}
297
298static void AdjustForExcludeArea(BOOL alignLeft, BOOL alignTop, BOOL preferVertical, PINT px, PINT py, INT cx, INT cy, RECTL rcExclude) {
299 RECT rcWindow = { *px, *py, *px + cx, *py + cy };
300
301 if (rcWindow.right > rcExclude.left && rcWindow.left < rcExclude.right &&
302 rcWindow.bottom > rcExclude.top && rcWindow.top < rcExclude.bottom)
303 {
304 if (preferVertical)
305 {
306 if (alignTop && rcWindow.bottom > rcExclude.top)
307 *py = rcExclude.top - cy;
308 else if (!alignTop && rcWindow.top < rcExclude.bottom)
309 *py = rcExclude.bottom;
310 else if (alignLeft && rcWindow.right > rcExclude.left)
311 *px = rcExclude.left - cx;
312 else if (!alignLeft && rcWindow.left < rcExclude.right)
313 *px = rcExclude.right;
314 }
315 else
316 {
317 if (alignLeft && rcWindow.right > rcExclude.left)
318 *px = rcExclude.left - cx;
319 else if (!alignLeft && rcWindow.left < rcExclude.right)
320 *px = rcExclude.right;
321 else if (alignTop && rcWindow.bottom > rcExclude.top)
322 *py = rcExclude.top - cy;
323 else if (!alignTop && rcWindow.top < rcExclude.bottom)
324 *py = rcExclude.bottom;
325 }
326 }
327}
328
330{
331 HRESULT hr;
332 CComPtr<IOleCommandTarget> oct;
333 CComPtr<IInputObject> io;
334 CComPtr<IDeskBand> band;
335 CComPtr<IDeskBarClient> dbc;
336
337 if (m_hWnd == NULL)
338 return E_FAIL;
339
342 return hr;
343
344 hr = m_Client->QueryInterface(IID_PPV_ARG(IDeskBarClient, &dbc));
346 return hr;
347
348 // Windows calls this, but it appears to be unimplemented?
349 hr = dbc->SetModeDBC(1);
350 // Allow it to fail with E_NOTIMPL.
351
352 // No clue about the arg, using anything != 0
353 hr = dbc->UIActivateDBC(TRUE);
355 return hr;
356
357 RECT rc = { 0 };
358 hr = dbc->GetSize(0, &rc);
360 return hr;
361
362 // Unknown meaning
363 const int CMD = 19;
364 const int CMD_EXEC_OPT = 0;
365
366 hr = IUnknown_QueryServiceExec(m_Client, SID_SMenuBandChild, &CLSID_MenuBand, CMD, CMD_EXEC_OPT, NULL, NULL);
368 return hr;
369
371 ::OffsetRect(&rc, -rc.left, -rc.top);
372
373 if (m_Banner != NULL)
374 {
375 BITMAP bm;
376 ::GetObject(m_Banner, sizeof(bm), &bm);
377 rc.right += bm.bmWidth;
378 }
379
380 RECT rcWorkArea;
381 ::GetWindowRect(GetDesktopWindow(), &rcWorkArea);
382 int cxWorkArea = rcWorkArea.right - rcWorkArea.left;
383 int cyWorkArea = rcWorkArea.bottom - rcWorkArea.top;
384
385 int x = ppt->x;
386 int y = ppt->y;
387 int cx = rc.right - rc.left;
388 int cy = rc.bottom - rc.top;
389
390 // TODO: Make alignLeft default to TRUE in LTR systems or whenever necessary.
391 BOOL alignLeft = FALSE;
392 BOOL alignTop = FALSE;
393 BOOL preferVertical = FALSE;
394 switch (dwFlags & MPPF_POS_MASK)
395 {
396 case MPPF_TOP:
397 alignTop = TRUE;
398 preferVertical = TRUE;
399 break;
400 case MPPF_LEFT:
401 alignLeft = TRUE;
402 break;
403 case MPPF_BOTTOM:
404 alignTop = FALSE;
405 preferVertical = TRUE;
406 break;
407 case MPPF_RIGHT:
408 alignLeft = FALSE;
409 break;
410 }
411
412 // Try the selected alignment and verify that it doesn't escape the work area.
413 if (alignLeft)
414 {
415 x = ppt->x - cx;
416 }
417 else
418 {
419 x = ppt->x;
420 }
421
422 if (alignTop)
423 {
424 y = ppt->y - cy;
425 }
426 else
427 {
428 y = ppt->y;
429 }
430
431 if (prcExclude)
432 AdjustForExcludeArea(alignLeft, alignTop, preferVertical, &x, &y, cx, cy, *prcExclude);
433
434 // Verify that it doesn't escape the work area, and flip.
435 if (alignLeft)
436 {
437 if (x < rcWorkArea.left && (ppt->x+cx) <= rcWorkArea.right)
438 {
439 alignLeft = FALSE;
440 if (prcExclude)
441 x = prcExclude->right - ((x + cx) - prcExclude->left);
442 else
443 x = ppt->x;
444 }
445 }
446 else
447 {
448 if ((ppt->x + cx) > rcWorkArea.right && x >= rcWorkArea.left)
449 {
450 alignLeft = TRUE;
451 if (prcExclude)
452 x = prcExclude->left - cx + (prcExclude->right - x);
453 else
454 x = ppt->x - cx;
455 }
456 }
457
458 BOOL flipV = FALSE;
459 if (alignTop)
460 {
461 if (y < rcWorkArea.top && (ppt->y + cy) <= rcWorkArea.bottom)
462 {
463 alignTop = FALSE;
464 if (prcExclude)
465 y = prcExclude->bottom - ((y + cy) - prcExclude->top);
466 else
467 y = ppt->y;
468
469 flipV = true;
470 }
471 }
472 else
473 {
474 if ((ppt->y + cy) > rcWorkArea.bottom && y >= rcWorkArea.top)
475 {
476 alignTop = TRUE;
477 if (prcExclude)
478 y = prcExclude->top - cy + (prcExclude->bottom - y);
479 else
480 y = ppt->y - cy;
481
482 flipV = true;
483 }
484 }
485
486 if (prcExclude)
487 AdjustForExcludeArea(alignLeft, alignTop, preferVertical, &x, &y, cx, cy, *prcExclude);
488
489 if (x < rcWorkArea.left)
490 x = rcWorkArea.left;
491
492 if (cx > cxWorkArea)
493 cx = cxWorkArea;
494
495 if (x + cx > rcWorkArea.right)
496 x = rcWorkArea.right - cx;
497
498 if (y < rcWorkArea.top)
499 y = rcWorkArea.top;
500
501 if (cy > cyWorkArea)
502 cy = cyWorkArea;
503
504 if (y + cy > rcWorkArea.bottom)
505 y = rcWorkArea.bottom - cy;
506
508
509 this->SetWindowPos(HWND_TOPMOST, x, y, cx, cy, flags);
510
511 if (flipV)
512 {
515 else if (dwFlags & MPPF_FINALSELECT)
517 }
518
520 m_Shown = true;
521
522 // HACK: The bar needs to be notified of the size AFTER it is shown.
523 // Quick & dirty way of getting it done.
524 BOOL bHandled;
525 _OnSize(WM_SIZE, 0, 0, bHandled);
526
528
530 {
531 const int CMD_SELECT = 5;
532 int CMD_SELECT_OPTS = dwFlags & MPPF_INITIALSELECT ? 0 : -2;
533 IUnknown_QueryServiceExec(m_Client, SID_SMenuBandChild, &CLSID_MenuBand, CMD_SELECT, CMD_SELECT_OPTS, NULL, NULL);
534 }
535
536 return S_OK;
537}
538
540{
541 HRESULT hr;
542 m_IconSize = iIcon;
543
544 // Unknown meaning (set flags? set icon size?)
545 const int CMD = 16;
546 const int CMD_EXEC_OPT = iIcon ? 0 : 2; // seems to work
547
548 hr = IUnknown_QueryServiceExec(m_Client, SID_SMenuBandChild, &CLSID_MenuBand, CMD, CMD_EXEC_OPT, NULL, NULL);
550 return hr;
551
552 BOOL bHandled;
553 _OnSize(WM_SIZE, 0, 0, bHandled);
554
555 return hr;
556}
557
559{
560 if (piIcon)
561 *piIcon = m_IconSize;
562 return S_OK;
563}
564
566{
567 if (m_Banner && m_Banner != hBitmap)
569
571
572 BOOL bHandled;
573 _OnSize(WM_SIZE, 0, 0, bHandled);
574
575 return S_OK;
576}
577
579{
580 if (phBitmap)
581 *phBitmap = m_Banner;
582 return S_OK;
583}
584
586{
587 // Called by the MenuBand to assign itself as the logical child of the DeskBar
588
589 if (fSet)
590 {
591 m_SubMenuChild = pmp;
592 }
593 else
594 {
595 if (m_SubMenuChild)
596 {
597 if (pmp == m_SubMenuChild)
598 {
600 }
601 }
602 }
603 return S_OK;
604}
605
607{
608 CComPtr<IDeskBar> safeThis = this;
609 CComPtr<IMenuPopup> oldParent = m_SubMenuParent;
610
611 TRACE("OnSelect dwSelectType=%d\n", this, dwSelectType);
612 switch (dwSelectType)
613 {
614 case MPOS_EXECUTE:
615 case MPOS_FULLCANCEL:
616 case MPOS_CANCELLEVEL:
617
618 _CloseBar();
619
620 if (dwSelectType == MPOS_CANCELLEVEL)
621 return S_OK;
622
623 case MPOS_SELECTLEFT:
624 case MPOS_SELECTRIGHT:
626 if (oldParent)
627 return oldParent->OnSelect(dwSelectType);
628 break;
629 }
630
631 return S_OK;
632}
633
635{
636 CComPtr<IDeskBarClient> dbc;
637 HRESULT hr;
638
639 // Ensure that our data isn't destroyed while we are working
640 CComPtr<IDeskBar> safeThis = this;
641
642 m_Shown = false;
643
644 if (m_SubMenuParent)
645 {
646 m_SubMenuParent->SetSubMenu(this, FALSE);
647 }
648
649 if (m_SubMenuChild)
650 {
653 return hr;
654 }
655
656 hr = m_Client->QueryInterface(IID_PPV_ARG(IDeskBarClient, &dbc));
658 return hr;
659
660 hr = dbc->UIActivateDBC(FALSE);
662 return hr;
663
664 if (m_hWnd)
666
667 return UIActivateIO(FALSE, NULL);
668}
669
671{
672 CComPtr<IMenuPopup> popup = m_SubMenuParent;
673
674 while (popup)
675 {
676 HRESULT hr;
677 HWND parent;
678
679 hr = IUnknown_GetWindow(popup, &parent);
681 return FALSE;
682 if (hwnd == parent)
683 return TRUE;
684
685 hr = IUnknown_GetSite(popup, IID_PPV_ARG(IMenuPopup, &popup));
686 if (FAILED(hr))
687 return FALSE;
688 }
689
690 return FALSE;
691}
692
694{
695 if (m_Client)
696 {
697 RECT rc;
698
699 GetClientRect(&rc);
700
702 {
703 BITMAP bm;
704 ::GetObject(m_Banner, sizeof(bm), &bm);
705 rc.left += bm.bmWidth;
706 }
707
708 ::SetWindowPos(m_ClientWindow, NULL, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, 0);
709 }
710
711 return 0;
712}
713
715{
716 if (!m_Client)
717 return 0;
718
719 CComPtr<IWinEventHandler> winEventHandler;
720 HRESULT hr = m_Client->QueryInterface(IID_PPV_ARG(IWinEventHandler, &winEventHandler));
722 return 0;
723
724 if (winEventHandler)
725 {
727 hr = winEventHandler->OnWinEvent(NULL, uMsg, wParam, lParam, &result);
729 return 0;
730 return result;
731 }
732
733 return 0;
734}
735
737{
738 bHandled = FALSE;
739
740 if (m_Banner && !m_IconSize)
741 {
742 BITMAP bm;
743 PAINTSTRUCT ps;
744 HDC hdc = BeginPaint(&ps);
745
748
749 ::GetObject(m_Banner, sizeof(bm), &bm);
750
751 RECT rc;
752 if (!GetClientRect(&rc))
753 WARN("GetClientRect failed\n");
754
755 const int bx = bm.bmWidth;
756 const int by = bm.bmHeight;
757 const int cy = rc.bottom;
758
759 TRACE("Painting banner: %d by %d\n", bm.bmWidth, bm.bmHeight);
760
761 if (!::StretchBlt(hdc, 0, 0, bx, cy - by, hdcMem, 0, 0, bx, 1, SRCCOPY))
762 WARN("StretchBlt failed\n");
763
764 if (!::BitBlt(hdc, 0, cy - by, bx, by, hdcMem, 0, 0, SRCCOPY))
765 WARN("BitBlt failed\n");
766
767 ::SelectObject(hdcMem, hbmOld);
769
770 EndPaint(&ps);
771 }
772
773 return TRUE;
774}
775
777{
778 // BUG in ReactOS: WM_ACTIVATE/WA_INACTIVE makes no sense with lParam==hWnd
779 if (LOWORD(wParam) != 0 || reinterpret_cast<HWND>(lParam) == m_hWnd)
780 {
781 return 0;
782 }
783
784 // HACK! I just want it to work !!!
785 CComPtr<IDeskBar> db;
786 HRESULT hr = IUnknown_QueryService(m_Client, SID_SMenuBandChild, IID_PPV_ARG(IDeskBar, &db));
788 return 0;
789
790 CComPtr<IUnknown> punk;
791
792 hr = db->GetClient(&punk);
794 return 0;
795
796 if (!punk && m_Shown)
797 {
798 if (!_IsSubMenuParent(reinterpret_cast<HWND>(lParam)))
799 {
801 }
802 }
803
804 return 0;
805}
806
808{
809 return MA_NOACTIVATE;
810}
811
813{
814#if 0
815 if (wParam == 0 && m_Shown)
816 {
818 }
819#endif
820 return 0;
821}
822
824{
825 if (wParam == SPI_SETFLATMENU)
826 return _OnNotify(uMsg, wParam, lParam, bHandled);
827
828 return 0;
829}
830
832{
833 /* If it is a flat style menu we need to handle WM_NCPAINT
834 * and paint the border with the right colour */
835 if ((GetStyle() & WS_BORDER) == 0)
836 {
837 /* This isn't a flat style menu. */
838 bHandled = FALSE;
839 return 0;
840 }
841
842 HDC hdc;
843 RECT rcWindow;
844
845 hdc = GetWindowDC();
846 GetWindowRect(&rcWindow);
847 OffsetRect(&rcWindow, -rcWindow.left, -rcWindow.top);
849 ReleaseDC(hdc);
850 return 0;
851}
852
854{
855 /* Prevent the CMenuDeskBar from destroying on being sent a WM_CLOSE */
856 return 0;
857}
858
860{
864 return S_OK;
865}
866
867extern "C"
869{
870 return ShellObjectCreator<CMenuDeskBar>(riid, ppv);
871}
static void AdjustForExcludeArea(BOOL alignLeft, BOOL alignTop, BOOL preferVertical, PINT px, PINT py, INT cx, INT cy, RECTL rcExclude)
HRESULT WINAPI RSHELL_CMenuDeskBar_CreateInstance(REFIID riid, LPVOID *ppv)
ios_base &_STLP_CALL oct(ios_base &__s)
Definition: _ios_base.h:327
Arabic default style
Definition: afstyles.h:94
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
@ Create
Definition: registry.c:563
#define WARN(fmt,...)
Definition: precomp.h:61
#define THIS_
Definition: basetyps.h:65
#define THIS
Definition: basetyps.h:66
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
STDMETHOD() GetSite(REFIID riid, PVOID *ppvSite) override
STDMETHOD() SetSubMenu(IMenuPopup *pmp, BOOL fSet) override
BOOL m_didAddRef
Definition: CMenuDeskBar.h:54
HWND m_ClientWindow
Definition: CMenuDeskBar.h:46
STDMETHOD() QueryService(REFGUID guidService, REFIID riid, void **ppvObject) override
STDMETHOD() GetIconSize(DWORD *piIcon) override
LRESULT _OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
BOOL _IsSubMenuParent(HWND hwnd)
LRESULT _OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT _OnWinIniChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT _OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT _OnMouseActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT _OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
STDMETHOD() SetBitmap(HBITMAP hBitmap) override
STDMETHOD() SetClient(IUnknown *punkClient) override
DWORD m_IconSize
Definition: CMenuDeskBar.h:48
STDMETHOD() QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) override
STDMETHOD() ContextSensitiveHelp(BOOL fEnterMode) override
STDMETHOD() GetWindow(HWND *phwnd) override
CComPtr< IMenuPopup > m_SubMenuParent
Definition: CMenuDeskBar.h:43
STDMETHOD() OnSelect(DWORD dwSelectType) override
STDMETHOD() Popup(POINTL *ppt, RECTL *prcExclude, MP_POPUPFLAGS dwFlags) override
HRESULT _AdjustForTheme(BOOL bFlatStyle)
HRESULT _CloseBar()
CComPtr< IMenuPopup > m_SubMenuChild
Definition: CMenuDeskBar.h:44
CComPtr< IUnknown > m_Site
Definition: CMenuDeskBar.h:41
virtual void OnFinalMessage(HWND hWnd)
STDMETHOD() UIActivateIO(BOOL bActivating, LPMSG lpMsg) override
LRESULT _OnAppActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
STDMETHOD() Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override
HBITMAP m_Banner
Definition: CMenuDeskBar.h:49
STDMETHOD() GetClient(IUnknown **ppunkClient) override
STDMETHOD() Initialize(THIS) override
virtual ~CMenuDeskBar()
STDMETHOD() SetIconSize(DWORD iIcon) override
STDMETHOD() OnFocusChangeIS(LPUNKNOWN lpUnknown, BOOL bFocus) override
STDMETHOD() GetBitmap(HBITMAP *phBitmap) override
LRESULT _OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
CComPtr< IUnknown > m_Client
Definition: CMenuDeskBar.h:42
STDMETHOD() HasFocusIO(THIS) override
STDMETHOD() OnPosRectChangeDB(LPRECT prc) override
LRESULT _OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
STDMETHOD() SetSite(IUnknown *pUnkSite) override
DWORD m_ShowFlags
Definition: CMenuDeskBar.h:52
LRESULT _OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
STDMETHOD() TranslateAcceleratorIO(LPMSG lpMsg) override
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static HBITMAP hBitmap
Definition: timezone.c:26
HRESULT WINAPI IUnknown_QueryService(IUnknown *obj, REFGUID sid, REFIID iid, void **out)
Definition: main.c:181
HRESULT WINAPI IUnknown_GetSite(IUnknown *unk, REFIID iid, void **site)
Definition: main.c:161
HRESULT WINAPI IUnknown_UIActivateIO(IUnknown *unknown, BOOL activate, LPMSG msg)
Definition: ordinal.c:1228
HRESULT WINAPI IUnknown_QueryServiceExec(IUnknown *lpUnknown, REFIID service, const GUID *group, DWORD cmdId, DWORD cmdOpt, VARIANT *pIn, VARIANT *pOut)
Definition: ordinal.c:1148
HRESULT WINAPI IUnknown_TranslateAcceleratorIO(IUnknown *lpUnknown, LPMSG lpMsg)
Definition: ordinal.c:3692
LONG WINAPI SHSetWindowBits(HWND hwnd, INT offset, UINT mask, UINT flags)
Definition: ordinal.c:805
HRESULT WINAPI IUnknown_HasFocusIO(IUnknown *lpUnknown)
Definition: ordinal.c:3724
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:988
HRESULT WINAPI IUnknown_OnFocusChangeIS(LPUNKNOWN lpUnknown, LPUNKNOWN pFocusObject, BOOL bFocus)
Definition: ordinal.c:4231
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:33
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Height *Stride) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Stride)
Definition: common.c:42
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLenum GLint GLuint mask
Definition: glext.h:6028
GLbitfield flags
Definition: glext.h:7161
GLuint64EXT * result
Definition: glext.h:11304
GLbyte by
Definition: glext.h:8766
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
int MP_POPUPFLAGS
Definition: shobjidl.idl:2631
@ MPOS_CANCELLEVEL
Definition: shobjidl.idl:2608
@ MPOS_SELECTRIGHT
Definition: shobjidl.idl:2610
@ MPOS_CHILDTRACKING
Definition: shobjidl.idl:2611
@ MPPF_FINALSELECT
Definition: shobjidl.idl:2622
@ MPPF_INITIALSELECT
Definition: shobjidl.idl:2617
ULONG AddRef()
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
int * PINT
Definition: minwindef.h:150
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK io
Definition: file.c:72
unsigned int UINT
Definition: ndis.h:50
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
#define LOWORD(l)
Definition: pedump.c:82
#define WS_BORDER
Definition: pedump.c:625
#define WS_DLGFRAME
Definition: pedump.c:626
#define WS_CLIPCHILDREN
Definition: pedump.c:619
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
_Out_ LPRECT prc
Definition: ntgdi.h:1658
_In_opt_ IUnknown * punk
Definition: shlwapi.h:158
@ BMICON_SMALL
Definition: shlobj_undoc.h:168
#define TRACE(s)
Definition: solgame.cpp:4
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
Definition: scsiwmi.h:51
LONG y
Definition: windef.h:130
LONG x
Definition: windef.h:129
LONG bmHeight
Definition: wingdi.h:1869
LONG bmWidth
Definition: wingdi.h:1868
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
HDC hdcMem
Definition: welcome.c:104
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479
#define E_POINTER
Definition: winerror.h:3480
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
#define SRCCOPY
Definition: wingdi.h:333
#define GetObject
Definition: wingdi.h:4914
BOOL WINAPI DeleteDC(_In_ HDC)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
int WINAPI FrameRect(_In_ HDC, _In_ LPCRECT, _In_ HBRUSH)
#define SWP_NOACTIVATE
Definition: winuser.h:1253
HDC WINAPI GetWindowDC(_In_opt_ HWND)
#define HWND_TOPMOST
Definition: winuser.h:1219
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WM_SIZE
Definition: winuser.h:1639
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define SWP_NOMOVE
Definition: winuser.h:1255
#define MA_NOACTIVATE
Definition: winuser.h:2539
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define SWP_SHOWWINDOW
Definition: winuser.h:1259
#define GetWindowLong
Definition: winuser.h:5962
#define COLOR_BTNSHADOW
Definition: winuser.h:941
#define SWP_HIDEWINDOW
Definition: winuser.h:1252
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define GWL_STYLE
Definition: winuser.h:863
BOOL WINAPI DestroyWindow(_In_ HWND)
#define IID_PPV_ARG(Itype, ppType)