ReactOS 0.4.15-dev-8102-g108db8f
CMenuDeskBar Class Reference

#include <CMenuDeskBar.h>

Inheritance diagram for CMenuDeskBar:
Collaboration diagram for CMenuDeskBar:

Public Member Functions

 CMenuDeskBar ()
 
virtual ~CMenuDeskBar ()
 
STDMETHOD() Popup (POINTL *ppt, RECTL *prcExclude, MP_POPUPFLAGS dwFlags) override
 
STDMETHOD() OnSelect (DWORD dwSelectType) override
 
STDMETHOD() SetSubMenu (IMenuPopup *pmp, BOOL fSet) override
 
STDMETHOD() GetWindow (HWND *phwnd) override
 
STDMETHOD() ContextSensitiveHelp (BOOL fEnterMode) override
 
STDMETHOD() SetSite (IUnknown *pUnkSite) override
 
STDMETHOD() GetSite (REFIID riid, PVOID *ppvSite) override
 
STDMETHOD() SetIconSize (DWORD iIcon) override
 
STDMETHOD() GetIconSize (DWORD *piIcon) override
 
STDMETHOD() SetBitmap (HBITMAP hBitmap) override
 
STDMETHOD() GetBitmap (HBITMAP *phBitmap) override
 
STDMETHOD() Initialize (THIS) override
 
STDMETHOD() QueryStatus (const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) override
 
STDMETHOD() Exec (const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override
 
STDMETHOD() QueryService (REFGUID guidService, REFIID riid, void **ppvObject) override
 
STDMETHOD() OnFocusChangeIS (LPUNKNOWN lpUnknown, BOOL bFocus) override
 
STDMETHOD() UIActivateIO (BOOL bActivating, LPMSG lpMsg) override
 
STDMETHOD() HasFocusIO (THIS) override
 
STDMETHOD() TranslateAcceleratorIO (LPMSG lpMsg) override
 
STDMETHOD() SetClient (IUnknown *punkClient) override
 
STDMETHOD() GetClient (IUnknown **ppunkClient) override
 
STDMETHOD() OnPosRectChangeDB (LPRECT prc) override
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
HRESULT QueryStatus ([in, unique] const GUID *pguidCmdGroup, [in] ULONG cCmds, [in, out, size_is(cCmds)] OLECMD prgCmds[], [in, out, unique] OLECMDTEXT *pCmdText)
 
HRESULT Exec ([in, unique] const GUID *pguidCmdGroup, [in] DWORD nCmdID, [in] DWORD nCmdexecopt, [in, unique] VARIANT *pvaIn, [in, out, unique] VARIANT *pvaOut)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
- Public Member Functions inherited from IServiceProvider
HRESULT QueryService ([in] REFGUID guidService, [in] REFIID riid, [out] void **ppvObject)
 
HRESULT RemoteQueryService ([in] REFGUID guidService, [in] REFIID riid, [out, iid_is(riid)] IUnknown **ppvObject)
 
HRESULT Popup ([in] POINTL *ppt, [in] RECTL *prcExclude, [in] MP_POPUPFLAGS dwFlags)
 
HRESULT OnSelect ([in] DWORD dwSelectType)
 
HRESULT SetSubMenu ([in] IMenuPopup *pmp, [in] BOOL fSet)
 
- Public Member Functions inherited from IDeskBar
HRESULT SetClient ([in] IUnknown *punkClient)
 
HRESULT GetClient ([out] IUnknown **ppunkClient)
 
HRESULT OnPosRectChangeDB ([in] RECT *prc)
 
HRESULT GetWindow ([out] HWND *phwnd)
 
HRESULT ContextSensitiveHelp ([in] BOOL fEnterMode)
 
HRESULT SetSite ([in] IUnknown *pUnkSite)
 
HRESULT GetSite ([in] REFIID riid, [out, iid_is(riid)] PVOID *ppvSite)
 

Private Member Functions

virtual void OnFinalMessage (HWND hWnd)
 
LRESULT _OnCreate (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT _OnSize (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT _OnNotify (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT _OnPaint (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 _OnAppActivate (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT _OnWinIniChange (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT _OnNcPaint (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT _OnClose (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
HRESULT _AdjustForTheme (BOOL bFlatStyle)
 
BOOL _IsSubMenuParent (HWND hwnd)
 
HRESULT _CloseBar ()
 

Private Attributes

CComPtr< IUnknownm_Site
 
CComPtr< IUnknownm_Client
 
CComPtr< IMenuPopupm_SubMenuParent
 
CComPtr< IMenuPopupm_SubMenuChild
 
HWND m_ClientWindow
 
DWORD m_IconSize
 
HBITMAP m_Banner
 
BOOL m_Shown
 
DWORD m_ShowFlags
 
BOOL m_didAddRef
 

Additional Inherited Members

- Public Types inherited from IOleCommandTarget
enum  OLECMDF {
  OLECMDF_SUPPORTED = 0x1 , OLECMDF_ENABLED = 0x2 , OLECMDF_LATCHED = 0x4 , OLECMDF_NINCHED = 0x8 ,
  OLECMDF_INVISIBLE = 0x10 , OLECMDF_DEFHIDEONCTXTMENU = 0x20
}
 
enum  OLECMDTEXTF { OLECMDTEXTF_NONE = 0 , OLECMDTEXTF_NAME = 1 , OLECMDTEXTF_STATUS = 2 }
 
enum  OLECMDEXECOPT { OLECMDEXECOPT_DODEFAULT = 0 , OLECMDEXECOPT_PROMPTUSER = 1 , OLECMDEXECOPT_DONTPROMPTUSER = 2 , OLECMDEXECOPT_SHOWHELP = 3 }
 
enum  OLECMDID {
  OLECMDID_OPEN = 1 , OLECMDID_NEW = 2 , OLECMDID_SAVE = 3 , OLECMDID_SAVEAS = 4 ,
  OLECMDID_SAVECOPYAS = 5 , OLECMDID_PRINT = 6 , OLECMDID_PRINTPREVIEW = 7 , OLECMDID_PAGESETUP = 8 ,
  OLECMDID_SPELL = 9 , OLECMDID_PROPERTIES = 10 , OLECMDID_CUT = 11 , OLECMDID_COPY = 12 ,
  OLECMDID_PASTE = 13 , OLECMDID_PASTESPECIAL = 14 , OLECMDID_UNDO = 15 , OLECMDID_REDO = 16 ,
  OLECMDID_SELECTALL = 17 , OLECMDID_CLEARSELECTION = 18 , OLECMDID_ZOOM = 19 , OLECMDID_GETZOOMRANGE = 20 ,
  OLECMDID_UPDATECOMMANDS = 21 , OLECMDID_REFRESH = 22 , OLECMDID_STOP = 23 , OLECMDID_HIDETOOLBARS = 24 ,
  OLECMDID_SETPROGRESSMAX = 25 , OLECMDID_SETPROGRESSPOS = 26 , OLECMDID_SETPROGRESSTEXT = 27 , OLECMDID_SETTITLE = 28 ,
  OLECMDID_SETDOWNLOADSTATE = 29 , OLECMDID_STOPDOWNLOAD = 30 , OLECMDID_ONTOOLBARACTIVATED = 31 , OLECMDID_FIND = 32 ,
  OLECMDID_DELETE = 33 , OLECMDID_HTTPEQUIV = 34 , OLECMDID_HTTPEQUIV_DONE = 35 , OLECMDID_ENABLE_INTERACTION = 36 ,
  OLECMDID_ONUNLOAD = 37 , OLECMDID_PROPERTYBAG2 = 38 , OLECMDID_PREREFRESH = 39 , OLECMDID_SHOWSCRIPTERROR = 40 ,
  OLECMDID_SHOWMESSAGE = 41 , OLECMDID_SHOWFIND = 42 , OLECMDID_SHOWPAGESETUP = 43 , OLECMDID_SHOWPRINT = 44 ,
  OLECMDID_CLOSE = 45 , OLECMDID_ALLOWUILESSSAVEAS = 46 , OLECMDID_DONTDOWNLOADCSS = 47 , OLECMDID_UPDATEPAGESTATUS = 48 ,
  OLECMDID_PRINT2 = 49 , OLECMDID_PRINTPREVIEW2 = 50 , OLECMDID_SETPRINTTEMPLATE = 51 , OLECMDID_GETPRINTTEMPLATE = 52 ,
  OLECMDID_PAGEACTIONBLOCKED = 55 , OLECMDID_PAGEACTIONUIQUERY = 56 , OLECMDID_FOCUSVIEWCONTROLS = 57 , OLECMDID_FOCUSVIEWCONTROLSQUERY = 58 ,
  OLECMDID_SHOWPAGEACTIONMENU = 59 , OLECMDID_ADDTRAVELENTRY = 60 , OLECMDID_UPDATETRAVELENTRY = 61 , OLECMDID_UPDATEBACKFORWARDSTATE = 62 ,
  OLECMDID_OPTICAL_ZOOM = 63 , OLECMDID_OPTICAL_GETZOOMRANGE = 64 , OLECMDID_WINDOWSTATECHANGED = 65 , OLECMDID_ACTIVEXINSTALLSCOPE = 66 ,
  OLECMDID_UPDATETRAVELENTRY_DATARECOVERY = 67 , OLECMDID_SHOWTASKDLG = 68 , OLECMDID_POPSTATEEVENT = 69 , OLECMDID_VIEWPORT_MODE = 70 ,
  OLECMDID_LAYOUT_VIEWPORT_WIDTH = 71 , OLECMDID_VISUAL_VIEWPORT_EXCLUDE_BOTTOM = 72 , OLECMDID_USER_OPTICAL_ZOOM = 73 , OLECMDID_PAGEAVAILABLE = 74 ,
  OLECMDID_GETUSERSCALABLE = 75 , OLECMDID_UPDATE_CARET = 76 , OLECMDID_ENABLE_VISIBILITY = 77 , OLECMDID_MEDIA_PLAYBACK = 78
}
 
typedef IOleCommandTargetLPOLECOMMANDTARGET
 
typedef enum IOleCommandTarget::OLECMDF OLECMDF
 
typedef struct IOleCommandTarget::_tagOLECMD OLECMD
 
typedef struct IOleCommandTarget::_tagOLECMDTEXT OLECMDTEXT
 
typedef enum IOleCommandTarget::OLECMDTEXTF OLECMDTEXTF
 
typedef enum IOleCommandTarget::OLECMDEXECOPT OLECMDEXECOPT
 
typedef enum IOleCommandTarget::OLECMDID OLECMDID
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IServiceProvider
typedef IServiceProviderLPSERVICEPROVIDER
 
- Public Types inherited from IMenuPopup
enum  tagMENUPOPUPSELECT {
  MPOS_EXECUTE = 0 , MPOS_FULLCANCEL , MPOS_CANCELLEVEL , MPOS_SELECTLEFT ,
  MPOS_SELECTRIGHT , MPOS_CHILDTRACKING
}
 
enum  tagMENUPOPUPPOPUPFLAGS {
  MPPF_SETFOCUS = 0x00000001 , MPPF_INITIALSELECT = 0x00000002 , MPPF_NOANIMATE = 0x00000004 , MPPF_KEYBOARD = 0x00000010 ,
  MPPF_REPOSITION = 0x00000020 , MPPF_FORCEZORDER = 0x00000040 , MPPF_FINALSELECT = 0x00000080 , MPPF_TOP = 0x20000000 ,
  MPPF_LEFT = 0x40000000 , MPPF_RIGHT = 0x60000000 , MPPF_BOTTOM = 0x80000000 , MPPF_POS_MASK = 0xE0000000 ,
  MPPF_ALIGN_LEFT = 0x02000000 , MPPF_ALIGN_RIGHT = 0x04000000
}
 
typedef int MP_POPUPFLAGS
 
- Public Types inherited from IOleWindow
typedef IOleWindowLPOLEWINDOW
 
- Public Types inherited from IObjectWithSite
typedef IObjectWithSiteLPOBJECTWITHSITE
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 

Detailed Description

Definition at line 27 of file CMenuDeskBar.h.

Constructor & Destructor Documentation

◆ CMenuDeskBar()

CMenuDeskBar::CMenuDeskBar ( )

Definition at line 48 of file CMenuDeskBar.cpp.

48 :
51 m_IconSize(0),
54 m_ShowFlags(0),
56{
57}
BOOL m_didAddRef
Definition: CMenuDeskBar.h:54
HWND m_ClientWindow
Definition: CMenuDeskBar.h:46
DWORD m_IconSize
Definition: CMenuDeskBar.h:48
HBITMAP m_Banner
Definition: CMenuDeskBar.h:49
CComPtr< IUnknown > m_Client
Definition: CMenuDeskBar.h:42
DWORD m_ShowFlags
Definition: CMenuDeskBar.h:52
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117

◆ ~CMenuDeskBar()

CMenuDeskBar::~CMenuDeskBar ( )
virtual

Definition at line 59 of file CMenuDeskBar.cpp.

60{
61}

Member Function Documentation

◆ _AdjustForTheme()

HRESULT CMenuDeskBar::_AdjustForTheme ( BOOL  bFlatStyle)
private

Definition at line 846 of file CMenuDeskBar.cpp.

847{
851 return S_OK;
852}
Arabic default style
Definition: afstyles.h:94
LONG WINAPI SHSetWindowBits(HWND hwnd, INT offset, UINT mask, UINT flags)
Definition: ordinal.c:1126
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLint GLuint mask
Definition: glext.h:6028
#define S_OK
Definition: intsafe.h:52
#define WS_BORDER
Definition: pedump.c:625
#define WS_DLGFRAME
Definition: pedump.c:626
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define GWL_STYLE
Definition: winuser.h:852

Referenced by Exec().

◆ _CloseBar()

HRESULT CMenuDeskBar::_CloseBar ( )
private

Definition at line 621 of file CMenuDeskBar.cpp.

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}
CComPtr< IMenuPopup > m_SubMenuParent
Definition: CMenuDeskBar.h:43
CComPtr< IMenuPopup > m_SubMenuChild
Definition: CMenuDeskBar.h:44
STDMETHOD() UIActivateIO(BOOL bActivating, LPMSG lpMsg) override
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
@ MPOS_CANCELLEVEL
Definition: shobjidl.idl:2516
HRESULT hr
Definition: shlfolder.c:183
#define SWP_NOACTIVATE
Definition: winuser.h:1242
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOMOVE
Definition: winuser.h:1244
#define SWP_HIDEWINDOW
Definition: winuser.h:1241
#define IID_PPV_ARG(Itype, ppType)

Referenced by OnSelect(), and SetSite().

◆ _IsSubMenuParent()

BOOL CMenuDeskBar::_IsSubMenuParent ( HWND  hwnd)
private

Definition at line 657 of file CMenuDeskBar.cpp.

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}
#define TRUE
Definition: types.h:120
HRESULT WINAPI IUnknown_GetSite(LPUNKNOWN lpUnknown, REFIID iid, PVOID *lppSite)
Definition: ordinal.c:2638
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1332
r parent
Definition: btrfs.c:3010
#define FAILED(hr)
Definition: intsafe.h:51
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by _OnActivate().

◆ _OnActivate()

LRESULT CMenuDeskBar::_OnActivate ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 763 of file CMenuDeskBar.cpp.

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}
BOOL _IsSubMenuParent(HWND hwnd)
STDMETHOD() OnSelect(DWORD dwSelectType) override
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1497
#define LOWORD(l)
Definition: pedump.c:82

◆ _OnAppActivate()

LRESULT CMenuDeskBar::_OnAppActivate ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 799 of file CMenuDeskBar.cpp.

800{
801#if 0
802 if (wParam == 0 && m_Shown)
803 {
805 }
806#endif
807 return 0;
808}

◆ _OnClose()

LRESULT CMenuDeskBar::_OnClose ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 840 of file CMenuDeskBar.cpp.

841{
842 /* Prevent the CMenuDeskBar from destroying on being sent a WM_CLOSE */
843 return 0;
844}

◆ _OnCreate()

LRESULT CMenuDeskBar::_OnCreate ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 63 of file CMenuDeskBar.cpp.

64{
65 if (!m_didAddRef)
66 {
67 this->AddRef();
69 }
70
71 bHandled = FALSE;
72 return 0;
73}
ULONG AddRef()

◆ _OnMouseActivate()

LRESULT CMenuDeskBar::_OnMouseActivate ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 794 of file CMenuDeskBar.cpp.

795{
796 return MA_NOACTIVATE;
797}
#define MA_NOACTIVATE
Definition: winuser.h:2503

◆ _OnNcPaint()

LRESULT CMenuDeskBar::_OnNcPaint ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 818 of file CMenuDeskBar.cpp.

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}
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
int WINAPI FrameRect(_In_ HDC, _In_ LPCRECT, _In_ HBRUSH)
HDC WINAPI GetWindowDC(_In_opt_ HWND)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define COLOR_BTNSHADOW
Definition: winuser.h:930
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)

◆ _OnNotify()

LRESULT CMenuDeskBar::_OnNotify ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 701 of file CMenuDeskBar.cpp.

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}
GLuint64EXT * result
Definition: glext.h:11304
LONG_PTR LRESULT
Definition: windef.h:209

Referenced by _OnWinIniChange().

◆ _OnPaint()

LRESULT CMenuDeskBar::_OnPaint ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 723 of file CMenuDeskBar.cpp.

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}
#define WARN(fmt,...)
Definition: debug.h:115
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
GLbyte by
Definition: glext.h:8766
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define TRACE(s)
Definition: solgame.cpp:4
Definition: bl.h:1331
LONG bottom
Definition: windef.h:309
HDC hdcMem
Definition: welcome.c:104
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)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)

◆ _OnSize()

LRESULT CMenuDeskBar::_OnSize ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 680 of file CMenuDeskBar.cpp.

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}
@ BMICON_SMALL
Definition: shlobj_undoc.h:115
LONG right
Definition: windef.h:308

Referenced by Popup(), SetBitmap(), and SetIconSize().

◆ _OnWinIniChange()

LRESULT CMenuDeskBar::_OnWinIniChange ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 810 of file CMenuDeskBar.cpp.

811{
812 if (wParam == SPI_SETFLATMENU)
813 return _OnNotify(uMsg, wParam, lParam, bHandled);
814
815 return 0;
816}
LRESULT _OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)

◆ ContextSensitiveHelp()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::ContextSensitiveHelp ( BOOL  fEnterMode)
override

Implements IOleWindow.

Definition at line 97 of file CMenuDeskBar.cpp.

98{
99 return E_NOTIMPL;
100}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Exec()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::Exec ( const GUID pguidCmdGroup,
DWORD  nCmdID,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
override

Implements IOleCommandTarget.

Definition at line 113 of file CMenuDeskBar.cpp.

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}
HRESULT _AdjustForTheme(BOOL bFlatStyle)
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ GetBitmap()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetBitmap ( HBITMAP phBitmap)
override

Definition at line 565 of file CMenuDeskBar.cpp.

566{
567 if (phBitmap)
568 *phBitmap = m_Banner;
569 return S_OK;
570}

◆ GetClient()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetClient ( IUnknown **  ppunkClient)
override

Implements IDeskBar.

Definition at line 234 of file CMenuDeskBar.cpp.

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}
#define E_FAIL
Definition: ddrawi.h:102
#define E_POINTER
Definition: winerror.h:2365

◆ GetIconSize()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetIconSize ( DWORD piIcon)
override

Definition at line 545 of file CMenuDeskBar.cpp.

546{
547 if (piIcon)
548 *piIcon = m_IconSize;
549 return S_OK;
550}

◆ GetSite()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetSite ( REFIID  riid,
PVOID ppvSite 
)
override

Implements IObjectWithSite.

Definition at line 277 of file CMenuDeskBar.cpp.

278{
279 if (m_Site == NULL)
280 return E_FAIL;
281
282 return m_Site->QueryInterface(riid, ppvSite);
283}
CComPtr< IUnknown > m_Site
Definition: CMenuDeskBar.h:41
REFIID riid
Definition: atlbase.h:39

◆ GetWindow()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetWindow ( HWND phwnd)
override

Implements IOleWindow.

Definition at line 89 of file CMenuDeskBar.cpp.

90{
91 if (lphwnd == NULL)
92 return E_POINTER;
93 *lphwnd = m_hWnd;
94 return S_OK;
95}

◆ HasFocusIO()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::HasFocusIO ( THIS  )
override

Definition at line 184 of file CMenuDeskBar.cpp.

185{
187}
HRESULT WINAPI IUnknown_HasFocusIO(IUnknown *lpUnknown)
Definition: ordinal.c:4295

◆ Initialize()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::Initialize ( THIS  )
override

Definition at line 84 of file CMenuDeskBar.cpp.

85{
86 return S_OK;
87}

◆ OnFinalMessage()

void CMenuDeskBar::OnFinalMessage ( HWND  hWnd)
privatevirtual

Definition at line 75 of file CMenuDeskBar.cpp.

76{
77 if (m_didAddRef)
78 {
79 this->Release();
81 }
82}
ULONG Release()

◆ OnFocusChangeIS()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnFocusChangeIS ( LPUNKNOWN  lpUnknown,
BOOL  bFocus 
)
override

Definition at line 102 of file CMenuDeskBar.cpp.

103{
104 return IUnknown_OnFocusChangeIS(m_Client, punkObj, fSetFocus);
105}
HRESULT WINAPI IUnknown_OnFocusChangeIS(LPUNKNOWN lpUnknown, LPUNKNOWN pFocusObject, BOOL bFocus)
Definition: ordinal.c:4767

◆ OnPosRectChangeDB()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnPosRectChangeDB ( LPRECT  prc)
override

Definition at line 245 of file CMenuDeskBar.cpp.

246{
247 if (prc == NULL)
248 return E_POINTER;
249
250 return S_OK;
251}
_Out_ LPRECT prc
Definition: ntgdi.h:1658

◆ OnSelect()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnSelect ( DWORD  dwSelectType)
override

Implements IMenuPopup.

Definition at line 593 of file CMenuDeskBar.cpp.

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}
HRESULT _CloseBar()
@ MPOS_SELECTRIGHT
Definition: shobjidl.idl:2518
@ MPOS_CHILDTRACKING
Definition: shobjidl.idl:2519

Referenced by _OnActivate(), and _OnAppActivate().

◆ Popup()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::Popup ( POINTL ppt,
RECTL prcExclude,
MP_POPUPFLAGS  dwFlags 
)
override

Implements IMenuPopup.

Definition at line 316 of file CMenuDeskBar.cpp.

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}
static void AdjustForExcludeArea(BOOL alignLeft, BOOL alignTop, BOOL preferVertical, PINT px, PINT py, INT cx, INT cy, RECTL rcExclude)
ios_base &_STLP_CALL oct(ios_base &__s)
Definition: _ios_base.h:327
LRESULT _OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
HRESULT WINAPI IUnknown_QueryServiceExec(IUnknown *lpUnknown, REFIID service, const GUID *group, DWORD cmdId, DWORD cmdOpt, VARIANT *pIn, VARIANT *pOut)
Definition: ordinal.c:1549
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLbitfield flags
Definition: glext.h:7161
@ MPPF_FINALSELECT
Definition: shobjidl.idl:2530
@ MPPF_INITIALSELECT
Definition: shobjidl.idl:2525
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK io
Definition: file.c:100
_Out_opt_ int * cx
Definition: commctrl.h:585
#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
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define HWND_TOPMOST
Definition: winuser.h:1208
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
#define WM_SIZE
Definition: winuser.h:1611
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define SWP_SHOWWINDOW
Definition: winuser.h:1248
#define GetWindowLong
Definition: winuser.h:5796

◆ QueryService()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::QueryService ( REFGUID  guidService,
REFIID  riid,
void **  ppvObject 
)
override

Implements IServiceProvider.

Definition at line 147 of file CMenuDeskBar.cpp.

148{
149 HRESULT hr;
150
151 if (IsEqualGUID(guidService, SID_SMenuPopup) ||
152 IsEqualGUID(guidService, SID_SMenuBandParent) ||
153 IsEqualGUID(guidService, SID_STopLevelBrowser))
154 {
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}
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ QueryStatus()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::QueryStatus ( const GUID pguidCmdGroup,
ULONG  cCmds,
OLECMD  prgCmds[],
OLECMDTEXT pCmdText 
)
override

Implements IOleCommandTarget.

Definition at line 107 of file CMenuDeskBar.cpp.

109{
110 return E_NOTIMPL;
111}

◆ SetBitmap()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetBitmap ( HBITMAP  hBitmap)
override

Definition at line 552 of file CMenuDeskBar.cpp.

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}
static HBITMAP hBitmap
Definition: timezone.c:26
pKey DeleteObject()

◆ SetClient()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetClient ( IUnknown punkClient)
override

Implements IDeskBar.

Definition at line 194 of file CMenuDeskBar.cpp.

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}
@ Create
Definition: registry.c:563

Referenced by SetSite().

◆ SetIconSize()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetIconSize ( DWORD  iIcon)
override

Definition at line 526 of file CMenuDeskBar.cpp.

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}

◆ SetSite()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetSite ( IUnknown pUnkSite)
override

Implements IObjectWithSite.

Definition at line 253 of file CMenuDeskBar.cpp.

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}
STDMETHOD() SetClient(IUnknown *punkClient) override
BOOL WINAPI DestroyWindow(_In_ HWND)

◆ SetSubMenu()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetSubMenu ( IMenuPopup pmp,
BOOL  fSet 
)
override

Implements IMenuPopup.

Definition at line 572 of file CMenuDeskBar.cpp.

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}

◆ TranslateAcceleratorIO()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::TranslateAcceleratorIO ( LPMSG  lpMsg)
override

Definition at line 189 of file CMenuDeskBar.cpp.

190{
192}
HRESULT WINAPI IUnknown_TranslateAcceleratorIO(IUnknown *lpUnknown, LPMSG lpMsg)
Definition: ordinal.c:4263

◆ UIActivateIO()

HRESULT STDMETHODCALLTYPE CMenuDeskBar::UIActivateIO ( BOOL  bActivating,
LPMSG  lpMsg 
)
override

Definition at line 179 of file CMenuDeskBar.cpp.

180{
181 return IUnknown_UIActivateIO(m_Client, fActivate, lpMsg);
182}
HRESULT WINAPI IUnknown_UIActivateIO(IUnknown *unknown, BOOL activate, LPMSG msg)
Definition: ordinal.c:1629

Referenced by _CloseBar(), and Popup().

Member Data Documentation

◆ m_Banner

HBITMAP CMenuDeskBar::m_Banner
private

Definition at line 49 of file CMenuDeskBar.h.

Referenced by _OnPaint(), _OnSize(), GetBitmap(), Popup(), and SetBitmap().

◆ m_Client

◆ m_ClientWindow

HWND CMenuDeskBar::m_ClientWindow
private

Definition at line 46 of file CMenuDeskBar.h.

Referenced by _OnSize(), and SetClient().

◆ m_didAddRef

BOOL CMenuDeskBar::m_didAddRef
private

Definition at line 54 of file CMenuDeskBar.h.

Referenced by _OnCreate(), and OnFinalMessage().

◆ m_IconSize

DWORD CMenuDeskBar::m_IconSize
private

Definition at line 48 of file CMenuDeskBar.h.

Referenced by _OnPaint(), _OnSize(), GetIconSize(), and SetIconSize().

◆ m_ShowFlags

DWORD CMenuDeskBar::m_ShowFlags
private

Definition at line 52 of file CMenuDeskBar.h.

Referenced by Popup().

◆ m_Shown

BOOL CMenuDeskBar::m_Shown
private

Definition at line 51 of file CMenuDeskBar.h.

Referenced by _CloseBar(), _OnActivate(), _OnAppActivate(), Popup(), and SetSite().

◆ m_Site

CComPtr<IUnknown> CMenuDeskBar::m_Site
private

Definition at line 41 of file CMenuDeskBar.h.

Referenced by GetSite(), QueryService(), and SetSite().

◆ m_SubMenuChild

CComPtr<IMenuPopup> CMenuDeskBar::m_SubMenuChild
private

Definition at line 44 of file CMenuDeskBar.h.

Referenced by _CloseBar(), and SetSubMenu().

◆ m_SubMenuParent

CComPtr<IMenuPopup> CMenuDeskBar::m_SubMenuParent
private

Definition at line 43 of file CMenuDeskBar.h.

Referenced by _CloseBar(), _IsSubMenuParent(), OnSelect(), and SetSite().


The documentation for this class was generated from the following files: