ReactOS  0.4.15-dev-3456-g4a17d4b
CTrayWindowCtxMenu Class Reference
Inheritance diagram for CTrayWindowCtxMenu:
Collaboration diagram for CTrayWindowCtxMenu:

Public Member Functions

HRESULT Initialize (ITrayWindow *pTrayWnd, IN HWND hWndOwner)
 
virtual HRESULT STDMETHODCALLTYPE QueryContextMenu (HMENU hPopup, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
 
virtual HRESULT STDMETHODCALLTYPE InvokeCommand (LPCMINVOKECOMMANDINFO lpici)
 
virtual HRESULT STDMETHODCALLTYPE GetCommandString (UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax)
 
 CTrayWindowCtxMenu ()
 
virtual ~CTrayWindowCtxMenu ()
 
- 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 ()
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Private Attributes

HWND hWndOwner
 
CComPtr< CTrayWindowTrayWnd
 
CComPtr< IContextMenupcm
 
UINT m_idCmdCmFirst
 

Additional Inherited Members

- Public Types inherited from IContextMenu
typedef struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMINVOKECOMMANDINFOLPCMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMInvokeCommandInfoEx CMINVOKECOMMANDINFOEX
 
typedef struct IContextMenu::tagCMInvokeCommandInfoExLPCMINVOKECOMMANDINFOEX
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Static Public Member Functions inherited from ATL::CComCoClass< CTrayWindowCtxMenu >
static LPCTSTR WINAPI GetObjectDescription ()
 
- 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
 
- Public Attributes inherited from IContextMenu
CMIC_MASK_NOZONECHECKS typedef IContextMenuLPCONTEXTMENU
 
- Static Public Attributes inherited from IContextMenu
static CMDSTR_VIEWDETAILSW(const WCHAR []) const WCHAR CMDSTR_NEWFOLDERW [] = {'N','e','w','F','o','l','d','e','r',0}
 
static const WCHAR CMDSTR_VIEWLISTW [] = {'V','i','e','w','L','i','s','t',0}
 
static const WCHAR CMDSTR_VIEWDETAILSW [] = {'V','i','e','w','D','e','t','a','i','l','s',0}
 

Detailed Description

Definition at line 3267 of file traywnd.cpp.

Constructor & Destructor Documentation

◆ CTrayWindowCtxMenu()

CTrayWindowCtxMenu::CTrayWindowCtxMenu ( )
inline

Definition at line 3386 of file traywnd.cpp.

3387  {
3388  }

◆ ~CTrayWindowCtxMenu()

virtual CTrayWindowCtxMenu::~CTrayWindowCtxMenu ( )
inlinevirtual

Definition at line 3390 of file traywnd.cpp.

3391  {
3392  }

Member Function Documentation

◆ GetCommandString()

virtual HRESULT STDMETHODCALLTYPE CTrayWindowCtxMenu::GetCommandString ( UINT_PTR  idCmd,
UINT  uType,
UINT pwReserved,
LPSTR  pszName,
UINT  cchMax 
)
inlinevirtual

Implements IContextMenu.

Definition at line 3377 of file traywnd.cpp.

3382  {
3383  return E_NOTIMPL;
3384  }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Initialize()

HRESULT CTrayWindowCtxMenu::Initialize ( ITrayWindow *  pTrayWnd,
IN HWND  hWndOwner 
)
inline

Definition at line 3278 of file traywnd.cpp.

3279  {
3280  this->TrayWnd = (CTrayWindow *) pTrayWnd;
3281  this->hWndOwner = hWndOwner;
3282  this->m_idCmdCmFirst = 0;
3283  return S_OK;
3284  }
#define S_OK
Definition: intsafe.h:52
CComPtr< CTrayWindow > TrayWnd
Definition: traywnd.cpp:3273

Referenced by TrayWindowCtxMenuCreator().

◆ InvokeCommand()

virtual HRESULT STDMETHODCALLTYPE CTrayWindowCtxMenu::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpici)
inlinevirtual

Implements IContextMenu.

Definition at line 3347 of file traywnd.cpp.

3348  {
3349  UINT uiCmdId = PtrToUlong(lpici->lpVerb);
3350  if (uiCmdId != 0)
3351  {
3352  if (uiCmdId >= m_idCmdCmFirst)
3353  {
3354  CMINVOKECOMMANDINFO cmici = { 0 };
3355 
3356  if (pcm != NULL)
3357  {
3358  /* Setup and invoke the shell command */
3359  cmici.cbSize = sizeof(cmici);
3360  cmici.hwnd = hWndOwner;
3361  cmici.lpVerb = (LPCSTR) MAKEINTRESOURCEW(uiCmdId - m_idCmdCmFirst);
3362  cmici.nShow = SW_NORMAL;
3363 
3364  pcm->InvokeCommand(&cmici);
3365  }
3366  }
3367  else
3368  {
3369  TrayWnd->ExecContextMenuCmd(uiCmdId);
3370  }
3371  }
3372 
3373  return S_OK;
3374  }
CComPtr< IContextMenu > pcm
Definition: traywnd.cpp:3274
#define SW_NORMAL
Definition: winuser.h:763
struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
const char * LPCSTR
Definition: xmlstorage.h:183
#define PtrToUlong(u)
Definition: config.h:107
#define S_OK
Definition: intsafe.h:52
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
CComPtr< CTrayWindow > TrayWnd
Definition: traywnd.cpp:3273
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

◆ QueryContextMenu()

virtual HRESULT STDMETHODCALLTYPE CTrayWindowCtxMenu::QueryContextMenu ( HMENU  hPopup,
UINT  indexMenu,
UINT  idCmdFirst,
UINT  idCmdLast,
UINT  uFlags 
)
inlinevirtual

Implements IContextMenu.

Definition at line 3287 of file traywnd.cpp.

3292  {
3293  HMENU hMenuBase;
3294 
3296 
3297  if (g_MinimizedAll.GetSize() != 0 && !::IsThereAnyEffectiveWindow(TRUE))
3298  {
3299  CStringW strRestoreAll(MAKEINTRESOURCEW(IDS_RESTORE_ALL));
3300  MENUITEMINFOW mii = { sizeof(mii) };
3301  mii.fMask = MIIM_ID | MIIM_TYPE;
3303  mii.fType = MFT_STRING;
3304  mii.dwTypeData = const_cast<LPWSTR>(&strRestoreAll[0]);
3306  }
3307 
3308  if (!hMenuBase)
3309  return HRESULT_FROM_WIN32(GetLastError());
3310 
3311  if (SHRestricted(REST_CLASSICSHELL) != 0)
3312  {
3313  DeleteMenu(hPopup,
3315  MF_BYCOMMAND);
3316  }
3317 
3318  CheckMenuItem(hMenuBase,
3321 
3322  UINT idCmdNext;
3323  idCmdNext = Shell_MergeMenus(hPopup, hMenuBase, indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS | MM_ADDSEPARATOR);
3324  m_idCmdCmFirst = idCmdNext - idCmdFirst;
3325 
3326  ::DestroyMenu(hMenuBase);
3327 
3328  if (TrayWnd->m_TrayBandSite != NULL)
3329  {
3330  if (FAILED(TrayWnd->m_TrayBandSite->AddContextMenus(
3331  hPopup,
3332  indexMenu,
3333  idCmdNext,
3334  idCmdLast,
3335  CMF_NORMAL,
3336  &pcm)))
3337  {
3338  WARN("AddContextMenus failed.\n");
3339  pcm = NULL;
3340  }
3341  }
3342 
3343  return S_OK;
3344  }
CComPtr< IContextMenu > pcm
Definition: traywnd.cpp:3274
#define MFT_STRING
Definition: winuser.h:741
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define MF_BYCOMMAND
Definition: winuser.h:202
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:857
#define TRUE
Definition: types.h:120
#define ID_SHELL_CMD_RESTORE_ALL
Definition: resource.h:197
#define WARN(fmt,...)
Definition: debug.h:112
#define ID_SHELL_CMD_SHOW_DESKTOP
Definition: resource.h:191
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
LPWSTR dwTypeData
Definition: winuser.h:3249
static BOOL IsThereAnyEffectiveWindow(BOOL bMustBeInMonitor)
Definition: traywnd.cpp:111
#define IDM_TRAYWND
Definition: resource.h:57
#define FALSE
Definition: types.h:117
CSimpleArray< HWND > g_MinimizedAll
Definition: traywnd.cpp:131
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
#define MIIM_ID
Definition: winuser.h:717
#define MF_CHECKED
Definition: winuser.h:132
#define MM_ADDSEPARATOR
Definition: shlobj.h:2345
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MIIM_TYPE
Definition: winuser.h:720
#define MF_UNCHECKED
Definition: winuser.h:204
BOOL WINAPI DestroyMenu(_In_ HMENU)
HMENU LoadPopupMenu(IN HINSTANCE hInstance, IN LPCWSTR lpMenuName)
Definition: util.cpp:33
#define S_OK
Definition: intsafe.h:52
#define ID_LOCKTASKBAR
Definition: resource.h:188
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define MM_SUBMENUSHAVEIDS
Definition: shlobj.h:2346
CComPtr< CTrayWindow > TrayWnd
Definition: traywnd.cpp:3273
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDS_RESTORE_ALL
Definition: resource.h:104
DWORD WINAPI SHRestricted(RESTRICTIONS policy)
Definition: shpolicy.c:836
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

Member Data Documentation

◆ hWndOwner

HWND CTrayWindowCtxMenu::hWndOwner
private

Definition at line 3272 of file traywnd.cpp.

◆ m_idCmdCmFirst

UINT CTrayWindowCtxMenu::m_idCmdCmFirst
private

Definition at line 3275 of file traywnd.cpp.

◆ pcm

CComPtr<IContextMenu> CTrayWindowCtxMenu::pcm
private

Definition at line 3274 of file traywnd.cpp.

◆ TrayWnd

CComPtr<CTrayWindow> CTrayWindowCtxMenu::TrayWnd
private

Definition at line 3273 of file traywnd.cpp.


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