ReactOS 0.4.15-dev-8393-g61b7fb9
CMenuDeskBar.h
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#pragma once
21
22typedef CWinTraits<
26
28 public CComCoClass<CMenuDeskBar, &CLSID_MenuDeskBar>,
29 public CComObjectRootEx<CComMultiThreadModelNoCS>,
30 public CWindowImpl<CMenuDeskBar, CWindow, CMenuWinTraits>,
31 public IOleCommandTarget,
32 public IServiceProvider,
33 public IInputObjectSite,
34 public IInputObject,
35 public IMenuPopup,
36 public IObjectWithSite,
37 public IBanneredBar,
38 public IInitializeObject
39{
40private:
41 CComPtr<IUnknown> m_Site;
42 CComPtr<IUnknown> m_Client;
43 CComPtr<IMenuPopup> m_SubMenuParent;
44 CComPtr<IMenuPopup> m_SubMenuChild;
45
47
50
53
55
56 virtual void OnFinalMessage(HWND hWnd);
57public:
59 virtual ~CMenuDeskBar();
60
64
66
79
81 COM_INTERFACE_ENTRY_IID(IID_IMenuPopup, IMenuPopup)
82 COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
83 COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
84 COM_INTERFACE_ENTRY_IID(IID_IInputObjectSite, IInputObjectSite)
85 COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
89 COM_INTERFACE_ENTRY_IID(IID_IBanneredBar, IBanneredBar)
90 COM_INTERFACE_ENTRY_IID(IID_IInitializeObject, IInitializeObject)
92
93 // *** IMenuPopup methods ***
95 STDMETHOD(OnSelect)(DWORD dwSelectType) override;
97
98 // *** IOleWindow methods ***
101
102 // *** IObjectWithSite methods ***
105
106 // *** IBanneredBar methods ***
111
112 // *** IInitializeObject methods ***
114
115 // *** IOleCommandTarget methods ***
116 STDMETHOD(QueryStatus)(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText) override;
117 STDMETHOD(Exec)(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override;
118
119 // *** IServiceProvider methods ***
121
122 // *** IInputObjectSite methods ***
123 STDMETHOD(OnFocusChangeIS)(LPUNKNOWN lpUnknown, BOOL bFocus) override;
124
125 // *** IInputObject methods ***
126 STDMETHOD(UIActivateIO)(BOOL bActivating, LPMSG lpMsg) override;
129
130 // *** IDeskBar methods ***
131 STDMETHOD(SetClient)(IUnknown *punkClient) override;
132 STDMETHOD(GetClient)(IUnknown **ppunkClient) override;
134
135private:
136 // message handlers
137 LRESULT _OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
138 LRESULT _OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
139 LRESULT _OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
140 LRESULT _OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
146 LRESULT _OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
147
148 HRESULT _AdjustForTheme(BOOL bFlatStyle);
151};
CWinTraits< WS_POPUP|WS_DLGFRAME|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, WS_EX_LEFT|WS_EX_LTRREADING|WS_EX_RIGHTSCROLLBAR|WS_EX_PALETTEWINDOW > CMenuWinTraits
Definition: CMenuDeskBar.h:25
HWND hWnd
Definition: settings.c:17
#define THIS
Definition: basetyps.h:66
#define STDMETHOD(m)
Definition: basetyps.h:62
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
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
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
@ Popup
Definition: console.h:35
static HBITMAP hBitmap
Definition: timezone.c:26
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID riid
Definition: atlbase.h:39
int MP_POPUPFLAGS
Definition: shobjidl.idl:2572
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:679
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:651
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:645
#define END_COM_MAP()
Definition: atlcom.h:592
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1926
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1898
#define END_MSG_MAP()
Definition: atlwin.h:1917
#define DECLARE_WND_CLASS_EX(WndClassName, style, bkgnd)
Definition: atlwin.h:2004
static HBITMAP
Definition: button.c:44
const IID IID_IObjectWithSite
static HKEY override
Definition: compobj.c:81
unsigned int UINT
Definition: ndis.h:50
_Out_ LPRECT prc
Definition: ntgdi.h:1658
const GUID IID_IOleWindow
#define WS_POPUP
Definition: pedump.c:616
#define WS_DLGFRAME
Definition: pedump.c:626
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define REFIID
Definition: guiddef.h:118
#define WM_NOTIFY
Definition: richedit.h:61
#define IDR_MENUDESKBAR
Definition: shresdef.h:907
Definition: scsiwmi.h:51
uint32_t ULONG
Definition: typedefs.h:59
#define _T(x)
Definition: vfdio.h:22
_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
#define WM_PAINT
Definition: winuser.h:1620
#define CS_DROPSHADOW
Definition: winuser.h:660
#define WM_CLOSE
Definition: winuser.h:1621
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
#define WM_CREATE
Definition: winuser.h:1608
#define WM_SIZE
Definition: winuser.h:1611
#define WM_WININICHANGE
Definition: winuser.h:1630
#define WS_EX_PALETTEWINDOW
Definition: winuser.h:399
#define WM_ACTIVATE
Definition: winuser.h:1612
#define WM_MOUSEACTIVATE
Definition: winuser.h:1637
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define CS_SAVEBITS
Definition: winuser.h:657
#define WM_ACTIVATEAPP
Definition: winuser.h:1632
#define WS_EX_LEFT
Definition: winuser.h:391
#define WM_NCPAINT
Definition: winuser.h:1687
#define COLOR_3DFACE
Definition: winuser.h:929
static void Initialize()
Definition: xlate.c:212
#define const
Definition: zconf.h:233