ReactOS  0.4.14-dev-1256-g2125fec
CMenuFocusManager.h
Go to the documentation of this file.
1 /*
2 * Shell Menu Band
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 
22 class CMenuBand;
23 
25  public CComCoClass<CMenuFocusManager>,
26  public CComObjectRootEx<CComMultiThreadModelNoCS>
27 {
28 private:
29  static DWORD TlsIndex;
30 
31  static CMenuFocusManager * GetManager();
32 
34  {
39  };
40 
41  struct StackEntry
42  {
47  };
48 
49 public:
51 
52  static void ReleaseManager(CMenuFocusManager * obj);
53 
54 private:
57 
58 private:
62 
66 
68 
70 
72 
75 
79 
82 
84 
85  // TODO: make dynamic
86 #define MAX_RECURSE 20
90 
92  HRESULT PopFromArray(StackEntryType * pType, CMenuBand ** pMb, HMENU * pHmenu);
93 
94 protected:
97 
98 public:
99 
103  END_COM_MAP()
104 
105 private:
113 
114  void DisableMouseTrack(HWND parent, BOOL disableThis);
115  void SetMenuCapture(HWND child);
116 
118  LRESULT ProcessMouseDown(MSG* msg, BOOL isLButton);
119  LRESULT ProcessMouseUp(MSG* msg, BOOL isLButton);
120 public:
127 };
HRESULT IsTrackedWindowOrParent(HWND hWnd)
StackEntry * m_current
static CMenuFocusManager * AcquireManager()
StackEntry * m_parent
static HMENU hmenu
Definition: win.c:66
HRESULT PushToArray(StackEntryType type, CMenuBand *mb, HMENU hmenu)
HRESULT PopTrackedPopup(HMENU popup)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define CALLBACK
Definition: compat.h:27
HWND hWnd
Definition: settings.c:17
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:611
static LRESULT CALLBACK s_GetMsgHook(INT nCode, WPARAM wParam, LPARAM lParam)
UINT_PTR WPARAM
Definition: windef.h:207
HRESULT PushTrackedPopup(HMENU popup)
int32_t INT
Definition: typedefs.h:57
static HWND child
Definition: cursoricon.c:298
WPARAM wParam
Definition: combotst.c:138
StackEntry * m_entryUnderMouse
HRESULT PopMenuBar(CMenuBand *mb)
HRESULT PushMenuBar(CMenuBand *mb)
unsigned int BOOL
Definition: ntddk_ex.h:94
HRESULT PopMenuPopup(CMenuBand *mb)
HRESULT IsTrackedWindow(HWND hWnd, StackEntry **pentry=NULL)
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
StackEntry * m_menuBar
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
LRESULT GetMsgHook(INT nCode, WPARAM wParam, LPARAM lParam)
LRESULT ProcessMouseUp(MSG *msg, BOOL isLButton)
#define MAX_RECURSE
r parent
Definition: btrfs.c:2869
LONG HRESULT
Definition: typedefs.h:78
unsigned long DWORD
Definition: ntddk_ex.h:95
LRESULT MsgFilterHook(INT nCode, WPARAM wParam, LPARAM lParam)
static LRESULT CALLBACK s_MsgFilterHook(INT nCode, WPARAM wParam, LPARAM lParam)
LRESULT ProcessMouseDown(MSG *msg, BOOL isLButton)
static void ReleaseManager(CMenuFocusManager *obj)
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
#define msg(x)
Definition: auth_time.c:54
static CMenuFocusManager * GetManager()
void SetMenuCapture(HWND child)
static DWORD TlsIndex
HRESULT PushMenuPopup(CMenuBand *mb)
#define END_COM_MAP()
Definition: atlcom.h:552
LONG_PTR LRESULT
Definition: windef.h:209
LRESULT ProcessMouseMove(MSG *msg)
StackEntry m_bandStack[MAX_RECURSE]
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
HRESULT PopFromArray(StackEntryType *pType, CMenuBand **pMb, HMENU *pHmenu)
LPARAM lParam
Definition: combotst.c:139
void DisableMouseTrack(HWND parent, BOOL disableThis)