ReactOS 0.4.15-dev-6056-gb29b268
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{
555
556 BOOL bHandled;
557 _OnSize(WM_SIZE, 0, 0, bHandled);
558
559 return S_OK;
560}
561
563{
564 if (phBitmap)
565 *phBitmap = m_Banner;
566 return S_OK;
567}
568
570{
571 // Called by the MenuBand to assign itself as the logical child of the DeskBar
572
573 if (fSet)
574 {
575 m_SubMenuChild = pmp;
576 }
577 else
578 {
579 if (m_SubMenuChild)
580 {
581 if (pmp == m_SubMenuChild)
582 {
584 }
585 }
586 }
587 return S_OK;
588}
589
591{
592 CComPtr<IDeskBar> safeThis = this;
593 CComPtr<IMenuPopup> oldParent = m_SubMenuParent;
594
595 TRACE("OnSelect dwSelectType=%d\n", this, dwSelectType);
596 switch (dwSelectType)
597 {
598 case MPOS_EXECUTE:
599 case MPOS_FULLCANCEL:
600 case MPOS_CANCELLEVEL:
601
602 _CloseBar();
603
604 if (dwSelectType == MPOS_CANCELLEVEL)
605 return S_OK;
606
607 case MPOS_SELECTLEFT:
608 case MPOS_SELECTRIGHT:
610 if (oldParent)
611 return oldParent->OnSelect(dwSelectType);
612 break;
613 }
614
615 return S_OK;
616}
617
619{
620 CComPtr<IDeskBarClient> dbc;
621 HRESULT hr;
622
623 // Ensure that our data isn't destroyed while we are working
624 CComPtr<IDeskBar> safeThis = this;
625
626 m_Shown = false;
627
628 if (m_SubMenuParent)
629 {
630 m_SubMenuParent->SetSubMenu(this, FALSE);
631 }
632
633 if (m_SubMenuChild)
634 {
637 return hr;
638 }
639
640 hr = m_Client->QueryInterface(IID_PPV_ARG(IDeskBarClient, &dbc));
642 return hr;
643
644 hr = dbc->UIActivateDBC(FALSE);
646 return hr;
647
648 if (m_hWnd)
650
651 return UIActivateIO(FALSE, NULL);
652}
653
655{
656 CComPtr<IMenuPopup> popup = m_SubMenuParent;
657
658 while (popup)
659 {
660 HRESULT hr;
661 HWND parent;
662
663 hr = IUnknown_GetWindow(popup, &parent);
665 return FALSE;
666 if (hwnd == parent)
667 return TRUE;
668
669 hr = IUnknown_GetSite(popup, IID_PPV_ARG(IMenuPopup, &popup));
670 if (FAILED(hr))
671 return FALSE;
672 }
673
674 return FALSE;
675}
676
678{
679 if (m_Client)
680 {
681 RECT rc;
682
683 GetClientRect(&rc);
684
685 if (m_Banner != NULL)
686 {
687 BITMAP bm;
688 ::GetObject(m_Banner, sizeof(bm), &bm);
689 rc.left += bm.bmWidth;
690 }
691
692 ::SetWindowPos(m_ClientWindow, NULL, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, 0);
693 }
694
695 return 0;
696}
697
699{
700 if (!m_Client)
701 return 0;
702
703 CComPtr<IWinEventHandler> winEventHandler;
704 HRESULT hr = m_Client->QueryInterface(IID_PPV_ARG(IWinEventHandler, &winEventHandler));
706 return 0;
707
708 if (winEventHandler)
709 {
711 hr = winEventHandler->OnWinEvent(NULL, uMsg, wParam, lParam, &result);
713 return 0;
714 return result;
715 }
716
717 return 0;
718}
719
721{
722 bHandled = FALSE;
723
724 if (m_Banner && !m_IconSize)
725 {
726 BITMAP bm;
727 PAINTSTRUCT ps;
728 HDC hdc = BeginPaint(&ps);
729
732
733 ::GetObject(m_Banner, sizeof(bm), &bm);
734
735 RECT rc;
736 if (!GetClientRect(&rc))
737 WARN("GetClientRect failed\n");
738
739 const int bx = bm.bmWidth;
740 const int by = bm.bmHeight;
741 const int cy = rc.bottom;
742
743 TRACE("Painting banner: %d by %d\n", bm.bmWidth, bm.bmHeight);
744
745 if (!::StretchBlt(hdc, 0, 0, bx, cy - by, hdcMem, 0, 0, bx, 1, SRCCOPY))
746 WARN("StretchBlt failed\n");
747
748 if (!::BitBlt(hdc, 0, cy - by, bx, by, hdcMem, 0, 0, SRCCOPY))
749 WARN("BitBlt failed\n");
750
751 ::SelectObject(hdcMem, hbmOld);
753
754 EndPaint(&ps);
755 }
756
757 return TRUE;
758}
759
761{
762 // BUG in ReactOS: WM_ACTIVATE/WA_INACTIVE makes no sense with lParam==hWnd
763 if (LOWORD(wParam) != 0 || reinterpret_cast<HWND>(lParam) == m_hWnd)
764 {
765 return 0;
766 }
767
768 // HACK! I just want it to work !!!
769 CComPtr<IDeskBar> db;
770 HRESULT hr = IUnknown_QueryService(m_Client, SID_SMenuBandChild, IID_PPV_ARG(IDeskBar, &db));
772 return 0;
773
774 CComPtr<IUnknown> punk;
775
776 hr = db->GetClient(&punk);
778 return 0;
779
780 if (!punk && m_Shown)
781 {
782 if (!_IsSubMenuParent(reinterpret_cast<HWND>(lParam)))
783 {
785 }
786 }
787
788 return 0;
789}
790
792{
793 return MA_NOACTIVATE;
794}
795
797{
798#if 0
799 if (wParam == 0 && m_Shown)
800 {
802 }
803#endif
804 return 0;
805}
806
808{
809 if (wParam == SPI_SETFLATMENU)
810 return _OnNotify(uMsg, wParam, lParam, bHandled);
811
812 return 0;
813}
814
816{
817 /* If it is a flat style menu we need to handle WM_NCPAINT
818 * and paint the border with the right colour */
819 if ((GetStyle() & WS_BORDER) == 0)
820 {
821 /* This isn't a flat style menu. */
822 bHandled = FALSE;
823 return 0;
824 }
825
826 HDC hdc;
827 RECT rcWindow;
828
829 hdc = GetWindowDC();
830 GetWindowRect(&rcWindow);
831 OffsetRect(&rcWindow, -rcWindow.left, -rcWindow.top);
833 ReleaseDC(hdc);
834 return 0;
835}
836
838{
839 /* Prevent the CMenuDeskBar from destroying on being sent a WM_CLOSE */
840 return 0;
841}
842
844{
848 return S_OK;
849}
850
851extern "C"
853{
854 return ShellObjectCreator<CMenuDeskBar>(riid, ppv);
855}
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 THIS_
Definition: basetyps.h:65
#define THIS
Definition: basetyps.h:66
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
#define WARN(fmt,...)
Definition: debug.h:112
virtual HRESULT STDMETHODCALLTYPE OnPosRectChangeDB(LPRECT prc)
BOOL m_didAddRef
Definition: CMenuDeskBar.h:54
HWND m_ClientWindow
Definition: CMenuDeskBar.h:46
virtual HRESULT STDMETHODCALLTYPE Initialize(THIS)
virtual HRESULT STDMETHODCALLTYPE OnFocusChangeIS(LPUNKNOWN lpUnknown, BOOL bFocus)
LRESULT _OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
BOOL _IsSubMenuParent(HWND hwnd)
LRESULT _OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
virtual HRESULT STDMETHODCALLTYPE GetIconSize(DWORD *piIcon)
virtual HRESULT STDMETHODCALLTYPE HasFocusIO(THIS)
LRESULT _OnWinIniChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *phwnd)
LRESULT _OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT _OnMouseActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
virtual HRESULT STDMETHODCALLTYPE Popup(POINTL *ppt, RECTL *prcExclude, MP_POPUPFLAGS dwFlags)
LRESULT _OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject)
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode)
DWORD m_IconSize
Definition: CMenuDeskBar.h:48
virtual HRESULT STDMETHODCALLTYPE GetClient(IUnknown **ppunkClient)
CComPtr< IMenuPopup > m_SubMenuParent
Definition: CMenuDeskBar.h:43
HRESULT _AdjustForTheme(BOOL bFlatStyle)
virtual HRESULT STDMETHODCALLTYPE SetBitmap(HBITMAP hBitmap)
HRESULT _CloseBar()
CComPtr< IMenuPopup > m_SubMenuChild
Definition: CMenuDeskBar.h:44
CComPtr< IUnknown > m_Site
Definition: CMenuDeskBar.h:41
virtual void OnFinalMessage(HWND hWnd)
LRESULT _OnAppActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
HBITMAP m_Banner
Definition: CMenuDeskBar.h:49
virtual ~CMenuDeskBar()
virtual HRESULT STDMETHODCALLTYPE SetClient(IUnknown *punkClient)
LRESULT _OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
virtual HRESULT STDMETHODCALLTYPE GetBitmap(HBITMAP *phBitmap)
virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL bActivating, LPMSG lpMsg)
virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite)
CComPtr< IUnknown > m_Client
Definition: CMenuDeskBar.h:42
virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, PVOID *ppvSite)
virtual HRESULT STDMETHODCALLTYPE OnSelect(DWORD dwSelectType)
virtual HRESULT STDMETHODCALLTYPE SetIconSize(DWORD iIcon)
virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO(LPMSG lpMsg)
LRESULT _OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
DWORD m_ShowFlags
Definition: CMenuDeskBar.h:52
virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
LRESULT _OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
virtual HRESULT STDMETHODCALLTYPE SetSubMenu(IMenuPopup *pmp, BOOL fSet)
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
HRESULT WINAPI IUnknown_UIActivateIO(IUnknown *unknown, BOOL activate, LPMSG msg)
Definition: ordinal.c:1626
HRESULT WINAPI IUnknown_QueryServiceExec(IUnknown *lpUnknown, REFIID service, const GUID *group, DWORD cmdId, DWORD cmdOpt, VARIANT *pIn, VARIANT *pOut)
Definition: ordinal.c:1546
HRESULT WINAPI IUnknown_TranslateAcceleratorIO(IUnknown *lpUnknown, LPMSG lpMsg)
Definition: ordinal.c:4177
LONG WINAPI SHSetWindowBits(HWND hwnd, INT offset, UINT mask, UINT flags)
Definition: ordinal.c:1123
HRESULT WINAPI IUnknown_HasFocusIO(IUnknown *lpUnknown)
Definition: ordinal.c:4209
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1494
HRESULT WINAPI IUnknown_GetSite(LPUNKNOWN lpUnknown, REFIID iid, PVOID *lppSite)
Definition: ordinal.c:2593
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1329
HRESULT WINAPI IUnknown_OnFocusChangeIS(LPUNKNOWN lpUnknown, LPUNKNOWN pFocusObject, BOOL bFocus)
Definition: ordinal.c:4679
static VOID NTAPI 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:49
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
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:2493
@ MPOS_CANCELLEVEL
Definition: shobjidl.idl:2470
@ MPOS_SELECTRIGHT
Definition: shobjidl.idl:2472
@ MPOS_CHILDTRACKING
Definition: shobjidl.idl:2473
@ MPPF_FINALSELECT
Definition: shobjidl.idl:2484
@ MPPF_INITIALSELECT
Definition: shobjidl.idl:2479
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:92
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
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
HRESULT hr
Definition: shlfolder.c:183
#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:1539
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:1232
HDC WINAPI GetWindowDC(_In_opt_ HWND)
#define HWND_TOPMOST
Definition: winuser.h:1198
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:1601
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define SWP_NOMOVE
Definition: winuser.h:1234
#define MA_NOACTIVATE
Definition: winuser.h:2493
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define SWP_SHOWWINDOW
Definition: winuser.h:1238
#define GetWindowLong
Definition: winuser.h:5786
#define COLOR_BTNSHADOW
Definition: winuser.h:924
#define SWP_HIDEWINDOW
Definition: winuser.h:1231
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI DestroyWindow(_In_ HWND)
#define IID_PPV_ARG(Itype, ppType)