ReactOS 0.4.16-dev-109-gf4cb10f
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 if (IsEqualIID(*pguidCmdGroup, CGID_Explorer))
129 {
130 }
131 else if (IsEqualIID(*pguidCmdGroup, IID_IDeskBarClient))
132 {
133 switch (nCmdID)
134 {
135 case 0:
136 // hide current band
137 break;
138 case 2:
139 break;
140 case 3:
141 break;
142 }
143 }
144 return E_NOTIMPL;
145}
146
148{
149 HRESULT hr;
150
151 if (IsEqualGUID(guidService, SID_SMenuPopup) ||
152 IsEqualGUID(guidService, SID_SMenuBandParent) ||
153 IsEqualGUID(guidService, SID_STopLevelBrowser))
154 {
155 hr = this->QueryInterface(riid, ppvObject);
156 if (SUCCEEDED(hr))
157 return hr;
158 }
159
160 if (IsEqualGUID(guidService, SID_SMenuBandBottom) ||
161 IsEqualGUID(guidService, SID_SMenuBandBottomSelected) ||
162 IsEqualGUID(guidService, SID_SMenuBandChild))
163 {
164 if (m_Client == NULL)
165 return E_NOINTERFACE;
166
168 if (SUCCEEDED(hr))
169 return hr;
170 }
171
172
173 if (m_Site == NULL)
174 return E_NOINTERFACE;
175
176 return IUnknown_QueryService(m_Site, guidService, riid, ppvObject);
177}
178
180{
181 return IUnknown_UIActivateIO(m_Client, fActivate, lpMsg);
182}
183
185{
187}
188
190{
192}
193
195{
196 CComPtr<IDeskBarClient> pDeskBandClient;
197 HRESULT hr;
198
199 if (m_Client)
200 {
201 hr = m_Client->QueryInterface(IID_PPV_ARG(IDeskBarClient, &pDeskBandClient));
203 return hr;
204
205 pDeskBandClient->SetDeskBarSite(NULL);
206
207 pDeskBandClient = NULL;
208 m_Client = NULL;
209 }
210
211 if (punkClient == NULL)
212 return S_OK;
213
214 if (m_hWnd == NULL)
215 {
216 Create(NULL);
217 }
218
221 return hr;
222
223 hr = m_Client->QueryInterface(IID_PPV_ARG(IDeskBarClient, &pDeskBandClient));
225 return hr;
226
227 hr = pDeskBandClient->SetDeskBarSite(static_cast<IDeskBar*>(this));
229 return hr;
230
232}
233
235{
236 if (ppunkClient == NULL)
237 return E_POINTER;
238
239 if (!m_Client)
240 return E_FAIL;
241
242 return m_Client->QueryInterface(IID_PPV_ARG(IUnknown, ppunkClient));
243}
244
246{
247 if (prc == NULL)
248 return E_POINTER;
249
250 return S_OK;
251}
252
254{
255 // Windows closes the bar if this is called when the bar is shown
256
257 if (m_Shown)
258 _CloseBar();
259
261
262 m_Site = pUnkSite;
263
264 if (m_Site)
265 {
267 }
268 else
269 {
272 }
273
274 return S_OK;
275}
276
278{
279 if (m_Site == NULL)
280 return E_FAIL;
281
282 return m_Site->QueryInterface(riid, ppvSite);
283}
284
285static void AdjustForExcludeArea(BOOL alignLeft, BOOL alignTop, BOOL preferVertical, PINT px, PINT py, INT cx, INT cy, RECTL rcExclude) {
286 RECT rcWindow = { *px, *py, *px + cx, *py + cy };
287
288 if (rcWindow.right > rcExclude.left && rcWindow.left < rcExclude.right &&
289 rcWindow.bottom > rcExclude.top && rcWindow.top < rcExclude.bottom)
290 {
291 if (preferVertical)
292 {
293 if (alignTop && rcWindow.bottom > rcExclude.top)
294 *py = rcExclude.top - cy;
295 else if (!alignTop && rcWindow.top < rcExclude.bottom)
296 *py = rcExclude.bottom;
297 else if (alignLeft && rcWindow.right > rcExclude.left)
298 *px = rcExclude.left - cx;
299 else if (!alignLeft && rcWindow.left < rcExclude.right)
300 *px = rcExclude.right;
301 }
302 else
303 {
304 if (alignLeft && rcWindow.right > rcExclude.left)
305 *px = rcExclude.left - cx;
306 else if (!alignLeft && rcWindow.left < rcExclude.right)
307 *px = rcExclude.right;
308 else if (alignTop && rcWindow.bottom > rcExclude.top)
309 *py = rcExclude.top - cy;
310 else if (!alignTop && rcWindow.top < rcExclude.bottom)
311 *py = rcExclude.bottom;
312 }
313 }
314}
315
317{
318 HRESULT hr;
319 CComPtr<IOleCommandTarget> oct;
320 CComPtr<IInputObject> io;
321 CComPtr<IDeskBand> band;
322 CComPtr<IDeskBarClient> dbc;
323
324 if (m_hWnd == NULL)
325 return E_FAIL;
326
329 return hr;
330
331 hr = m_Client->QueryInterface(IID_PPV_ARG(IDeskBarClient, &dbc));
333 return hr;
334
335 // Windows calls this, but it appears to be unimplemented?
336 hr = dbc->SetModeDBC(1);
337 // Allow it to fail with E_NOTIMPL.
338
339 // No clue about the arg, using anything != 0
340 hr = dbc->UIActivateDBC(TRUE);
342 return hr;
343
344 RECT rc = { 0 };
345 hr = dbc->GetSize(0, &rc);
347 return hr;
348
349 // Unknown meaning
350 const int CMD = 19;
351 const int CMD_EXEC_OPT = 0;
352
353 hr = IUnknown_QueryServiceExec(m_Client, SID_SMenuBandChild, &CLSID_MenuBand, CMD, CMD_EXEC_OPT, NULL, NULL);
355 return hr;
356
358 ::OffsetRect(&rc, -rc.left, -rc.top);
359
360 if (m_Banner != NULL)
361 {
362 BITMAP bm;
363 ::GetObject(m_Banner, sizeof(bm), &bm);
364 rc.right += bm.bmWidth;
365 }
366
367 RECT rcWorkArea;
368 ::GetWindowRect(GetDesktopWindow(), &rcWorkArea);
369 int cxWorkArea = rcWorkArea.right - rcWorkArea.left;
370 int cyWorkArea = rcWorkArea.bottom - rcWorkArea.top;
371
372 int x = ppt->x;
373 int y = ppt->y;
374 int cx = rc.right - rc.left;
375 int cy = rc.bottom - rc.top;
376
377 // TODO: Make alignLeft default to TRUE in LTR systems or whenever necessary.
378 BOOL alignLeft = FALSE;
379 BOOL alignTop = FALSE;
380 BOOL preferVertical = FALSE;
381 switch (dwFlags & MPPF_POS_MASK)
382 {
383 case MPPF_TOP:
384 alignTop = TRUE;
385 preferVertical = TRUE;
386 break;
387 case MPPF_LEFT:
388 alignLeft = TRUE;
389 break;
390 case MPPF_BOTTOM:
391 alignTop = FALSE;
392 preferVertical = TRUE;
393 break;
394 case MPPF_RIGHT:
395 alignLeft = FALSE;
396 break;
397 }
398
399 // Try the selected alignment and verify that it doesn't escape the work area.
400 if (alignLeft)
401 {
402 x = ppt->x - cx;
403 }
404 else
405 {
406 x = ppt->x;
407 }
408
409 if (alignTop)
410 {
411 y = ppt->y - cy;
412 }
413 else
414 {
415 y = ppt->y;
416 }
417
418 if (prcExclude)
419 AdjustForExcludeArea(alignLeft, alignTop, preferVertical, &x, &y, cx, cy, *prcExclude);
420
421 // Verify that it doesn't escape the work area, and flip.
422 if (alignLeft)
423 {
424 if (x < rcWorkArea.left && (ppt->x+cx) <= rcWorkArea.right)
425 {
426 alignLeft = FALSE;
427 if (prcExclude)
428 x = prcExclude->right - ((x + cx) - prcExclude->left);
429 else
430 x = ppt->x;
431 }
432 }
433 else
434 {
435 if ((ppt->x + cx) > rcWorkArea.right && x >= rcWorkArea.left)
436 {
437 alignLeft = TRUE;
438 if (prcExclude)
439 x = prcExclude->left - cx + (prcExclude->right - x);
440 else
441 x = ppt->x - cx;
442 }
443 }
444
445 BOOL flipV = FALSE;
446 if (alignTop)
447 {
448 if (y < rcWorkArea.top && (ppt->y + cy) <= rcWorkArea.bottom)
449 {
450 alignTop = FALSE;
451 if (prcExclude)
452 y = prcExclude->bottom - ((y + cy) - prcExclude->top);
453 else
454 y = ppt->y;
455
456 flipV = true;
457 }
458 }
459 else
460 {
461 if ((ppt->y + cy) > rcWorkArea.bottom && y >= rcWorkArea.top)
462 {
463 alignTop = TRUE;
464 if (prcExclude)
465 y = prcExclude->top - cy + (prcExclude->bottom - y);
466 else
467 y = ppt->y - cy;
468
469 flipV = true;
470 }
471 }
472
473 if (prcExclude)
474 AdjustForExcludeArea(alignLeft, alignTop, preferVertical, &x, &y, cx, cy, *prcExclude);
475
476 if (x < rcWorkArea.left)
477 x = rcWorkArea.left;
478
479 if (cx > cxWorkArea)
480 cx = cxWorkArea;
481
482 if (x + cx > rcWorkArea.right)
483 x = rcWorkArea.right - cx;
484
485 if (y < rcWorkArea.top)
486 y = rcWorkArea.top;
487
488 if (cy > cyWorkArea)
489 cy = cyWorkArea;
490
491 if (y + cy > rcWorkArea.bottom)
492 y = rcWorkArea.bottom - cy;
493
495
496 this->SetWindowPos(HWND_TOPMOST, x, y, cx, cy, flags);
497
498 if (flipV)
499 {
502 else if (dwFlags & MPPF_FINALSELECT)
504 }
505
507 m_Shown = true;
508
509 // HACK: The bar needs to be notified of the size AFTER it is shown.
510 // Quick & dirty way of getting it done.
511 BOOL bHandled;
512 _OnSize(WM_SIZE, 0, 0, bHandled);
513
515
517 {
518 const int CMD_SELECT = 5;
519 int CMD_SELECT_OPTS = dwFlags & MPPF_INITIALSELECT ? 0 : -2;
520 IUnknown_QueryServiceExec(m_Client, SID_SMenuBandChild, &CLSID_MenuBand, CMD_SELECT, CMD_SELECT_OPTS, NULL, NULL);
521 }
522
523 return S_OK;
524}
525
527{
528 HRESULT hr;
529 m_IconSize = iIcon;
530
531 // Unknown meaning (set flags? set icon size?)
532 const int CMD = 16;
533 const int CMD_EXEC_OPT = iIcon ? 0 : 2; // seems to work
534
535 hr = IUnknown_QueryServiceExec(m_Client, SID_SMenuBandChild, &CLSID_MenuBand, CMD, CMD_EXEC_OPT, NULL, NULL);
537 return hr;
538
539 BOOL bHandled;
540 _OnSize(WM_SIZE, 0, 0, bHandled);
541
542 return hr;
543}
544
546{
547 if (piIcon)
548 *piIcon = m_IconSize;
549 return S_OK;
550}
551
553{
554 if (m_Banner && m_Banner != hBitmap)
556
558
559 BOOL bHandled;
560 _OnSize(WM_SIZE, 0, 0, bHandled);
561
562 return S_OK;
563}
564
566{
567 if (phBitmap)
568 *phBitmap = m_Banner;
569 return S_OK;
570}
571
573{
574 // Called by the MenuBand to assign itself as the logical child of the DeskBar
575
576 if (fSet)
577 {
578 m_SubMenuChild = pmp;
579 }
580 else
581 {
582 if (m_SubMenuChild)
583 {
584 if (pmp == m_SubMenuChild)
585 {
587 }
588 }
589 }
590 return S_OK;
591}
592
594{
595 CComPtr<IDeskBar> safeThis = this;
596 CComPtr<IMenuPopup> oldParent = m_SubMenuParent;
597
598 TRACE("OnSelect dwSelectType=%d\n", this, dwSelectType);
599 switch (dwSelectType)
600 {
601 case MPOS_EXECUTE:
602 case MPOS_FULLCANCEL:
603 case MPOS_CANCELLEVEL:
604
605 _CloseBar();
606
607 if (dwSelectType == MPOS_CANCELLEVEL)
608 return S_OK;
609
610 case MPOS_SELECTLEFT:
611 case MPOS_SELECTRIGHT:
613 if (oldParent)
614 return oldParent->OnSelect(dwSelectType);
615 break;
616 }
617
618 return S_OK;
619}
620
622{
623 CComPtr<IDeskBarClient> dbc;
624 HRESULT hr;
625
626 // Ensure that our data isn't destroyed while we are working
627 CComPtr<IDeskBar> safeThis = this;
628
629 m_Shown = false;
630
631 if (m_SubMenuParent)
632 {
633 m_SubMenuParent->SetSubMenu(this, FALSE);
634 }
635
636 if (m_SubMenuChild)
637 {
640 return hr;
641 }
642
643 hr = m_Client->QueryInterface(IID_PPV_ARG(IDeskBarClient, &dbc));
645 return hr;
646
647 hr = dbc->UIActivateDBC(FALSE);
649 return hr;
650
651 if (m_hWnd)
653
654 return UIActivateIO(FALSE, NULL);
655}
656
658{
659 CComPtr<IMenuPopup> popup = m_SubMenuParent;
660
661 while (popup)
662 {
663 HRESULT hr;
664 HWND parent;
665
666 hr = IUnknown_GetWindow(popup, &parent);
668 return FALSE;
669 if (hwnd == parent)
670 return TRUE;
671
672 hr = IUnknown_GetSite(popup, IID_PPV_ARG(IMenuPopup, &popup));
673 if (FAILED(hr))
674 return FALSE;
675 }
676
677 return FALSE;
678}
679
681{
682 if (m_Client)
683 {
684 RECT rc;
685
686 GetClientRect(&rc);
687
689 {
690 BITMAP bm;
691 ::GetObject(m_Banner, sizeof(bm), &bm);
692 rc.left += bm.bmWidth;
693 }
694
695 ::SetWindowPos(m_ClientWindow, NULL, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, 0);
696 }
697
698 return 0;
699}
700
702{
703 if (!m_Client)
704 return 0;
705
706 CComPtr<IWinEventHandler> winEventHandler;
707 HRESULT hr = m_Client->QueryInterface(IID_PPV_ARG(IWinEventHandler, &winEventHandler));
709 return 0;
710
711 if (winEventHandler)
712 {
714 hr = winEventHandler->OnWinEvent(NULL, uMsg, wParam, lParam, &result);
716 return 0;
717 return result;
718 }
719
720 return 0;
721}
722
724{
725 bHandled = FALSE;
726
727 if (m_Banner && !m_IconSize)
728 {
729 BITMAP bm;
730 PAINTSTRUCT ps;
731 HDC hdc = BeginPaint(&ps);
732
735
736 ::GetObject(m_Banner, sizeof(bm), &bm);
737
738 RECT rc;
739 if (!GetClientRect(&rc))
740 WARN("GetClientRect failed\n");
741
742 const int bx = bm.bmWidth;
743 const int by = bm.bmHeight;
744 const int cy = rc.bottom;
745
746 TRACE("Painting banner: %d by %d\n", bm.bmWidth, bm.bmHeight);
747
748 if (!::StretchBlt(hdc, 0, 0, bx, cy - by, hdcMem, 0, 0, bx, 1, SRCCOPY))
749 WARN("StretchBlt failed\n");
750
751 if (!::BitBlt(hdc, 0, cy - by, bx, by, hdcMem, 0, 0, SRCCOPY))
752 WARN("BitBlt failed\n");
753
754 ::SelectObject(hdcMem, hbmOld);
756
757 EndPaint(&ps);
758 }
759
760 return TRUE;
761}
762
764{
765 // BUG in ReactOS: WM_ACTIVATE/WA_INACTIVE makes no sense with lParam==hWnd
766 if (LOWORD(wParam) != 0 || reinterpret_cast<HWND>(lParam) == m_hWnd)
767 {
768 return 0;
769 }
770
771 // HACK! I just want it to work !!!
772 CComPtr<IDeskBar> db;
773 HRESULT hr = IUnknown_QueryService(m_Client, SID_SMenuBandChild, IID_PPV_ARG(IDeskBar, &db));
775 return 0;
776
777 CComPtr<IUnknown> punk;
778
779 hr = db->GetClient(&punk);
781 return 0;
782
783 if (!punk && m_Shown)
784 {
785 if (!_IsSubMenuParent(reinterpret_cast<HWND>(lParam)))
786 {
788 }
789 }
790
791 return 0;
792}
793
795{
796 return MA_NOACTIVATE;
797}
798
800{
801#if 0
802 if (wParam == 0 && m_Shown)
803 {
805 }
806#endif
807 return 0;
808}
809
811{
812 if (wParam == SPI_SETFLATMENU)
813 return _OnNotify(uMsg, wParam, lParam, bHandled);
814
815 return 0;
816}
817
819{
820 /* If it is a flat style menu we need to handle WM_NCPAINT
821 * and paint the border with the right colour */
822 if ((GetStyle() & WS_BORDER) == 0)
823 {
824 /* This isn't a flat style menu. */
825 bHandled = FALSE;
826 return 0;
827 }
828
829 HDC hdc;
830 RECT rcWindow;
831
832 hdc = GetWindowDC();
833 GetWindowRect(&rcWindow);
834 OffsetRect(&rcWindow, -rcWindow.left, -rcWindow.top);
836 ReleaseDC(hdc);
837 return 0;
838}
839
841{
842 /* Prevent the CMenuDeskBar from destroying on being sent a WM_CLOSE */
843 return 0;
844}
845
847{
851 return S_OK;
852}
853
854extern "C"
856{
857 return ShellObjectCreator<CMenuDeskBar>(riid, ppv);
858}
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
#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
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT WINAPI IUnknown_UIActivateIO(IUnknown *unknown, BOOL activate, LPMSG msg)
Definition: ordinal.c:1633
HRESULT WINAPI IUnknown_QueryServiceExec(IUnknown *lpUnknown, REFIID service, const GUID *group, DWORD cmdId, DWORD cmdOpt, VARIANT *pIn, VARIANT *pOut)
Definition: ordinal.c:1553
HRESULT WINAPI IUnknown_TranslateAcceleratorIO(IUnknown *lpUnknown, LPMSG lpMsg)
Definition: ordinal.c:4279
LONG WINAPI SHSetWindowBits(HWND hwnd, INT offset, UINT mask, UINT flags)
Definition: ordinal.c:1130
HRESULT WINAPI IUnknown_HasFocusIO(IUnknown *lpUnknown)
Definition: ordinal.c:4311
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1501
HRESULT WINAPI IUnknown_GetSite(LPUNKNOWN lpUnknown, REFIID iid, PVOID *lppSite)
Definition: ordinal.c:2642
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1336
HRESULT WINAPI IUnknown_OnFocusChangeIS(LPUNKNOWN lpUnknown, LPUNKNOWN pFocusObject, BOOL bFocus)
Definition: ordinal.c:4783
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
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:2610
@ MPOS_CANCELLEVEL
Definition: shobjidl.idl:2587
@ MPOS_SELECTRIGHT
Definition: shobjidl.idl:2589
@ MPOS_CHILDTRACKING
Definition: shobjidl.idl:2590
@ MPPF_FINALSELECT
Definition: shobjidl.idl:2601
@ MPPF_INITIALSELECT
Definition: shobjidl.idl:2596
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
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:100
unsigned int UINT
Definition: ndis.h:50
_Out_ LPRECT prc
Definition: ntgdi.h:1658
#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
HRESULT hr
Definition: shlfolder.c:183
@ BMICON_SMALL
Definition: shlobj_undoc.h:121
#define TRACE(s)
Definition: solgame.cpp:4
#define CMD
Definition: stat64.c:23
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: bl.h:1331
Definition: scsiwmi.h:51
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
HDC hdcMem
Definition: welcome.c:104
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
int * PINT
Definition: windef.h:177
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define E_POINTER
Definition: winerror.h:2365
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:4468
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:1245
HDC WINAPI GetWindowDC(_In_opt_ HWND)
#define HWND_TOPMOST
Definition: winuser.h:1211
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:1614
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define SWP_NOMOVE
Definition: winuser.h:1247
#define MA_NOACTIVATE
Definition: winuser.h:2506
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:1251
#define GetWindowLong
Definition: winuser.h:5808
#define COLOR_BTNSHADOW
Definition: winuser.h:933
#define SWP_HIDEWINDOW
Definition: winuser.h:1244
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define GWL_STYLE
Definition: winuser.h:855
BOOL WINAPI DestroyWindow(_In_ HWND)
#define IID_PPV_ARG(Itype, ppType)