ReactOS  0.4.14-dev-833-g5f692ed
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 3250 of file traywnd.cpp.

Constructor & Destructor Documentation

◆ CTrayWindowCtxMenu()

CTrayWindowCtxMenu::CTrayWindowCtxMenu ( )
inline

Definition at line 3369 of file traywnd.cpp.

3370  {
3371  }

◆ ~CTrayWindowCtxMenu()

virtual CTrayWindowCtxMenu::~CTrayWindowCtxMenu ( )
inlinevirtual

Definition at line 3373 of file traywnd.cpp.

3374  {
3375  }

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 3360 of file traywnd.cpp.

3365  {
3366  return E_NOTIMPL;
3367  }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Initialize()

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

Definition at line 3261 of file traywnd.cpp.

3262  {
3263  this->TrayWnd = (CTrayWindow *) pTrayWnd;
3264  this->hWndOwner = hWndOwner;
3265  this->m_idCmdCmFirst = 0;
3266  return S_OK;
3267  }
#define S_OK
Definition: intsafe.h:59
CComPtr< CTrayWindow > TrayWnd
Definition: traywnd.cpp:3256

Referenced by TrayWindowCtxMenuCreator().

◆ InvokeCommand()

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

Implements IContextMenu.

Definition at line 3330 of file traywnd.cpp.

3331  {
3332  UINT uiCmdId = PtrToUlong(lpici->lpVerb);
3333  if (uiCmdId != 0)
3334  {
3335  if (uiCmdId >= m_idCmdCmFirst)
3336  {
3337  CMINVOKECOMMANDINFO cmici = { 0 };
3338 
3339  if (pcm != NULL)
3340  {
3341  /* Setup and invoke the shell command */
3342  cmici.cbSize = sizeof(cmici);
3343  cmici.hwnd = hWndOwner;
3344  cmici.lpVerb = (LPCSTR) MAKEINTRESOURCEW(uiCmdId - m_idCmdCmFirst);
3345  cmici.nShow = SW_NORMAL;
3346 
3347  pcm->InvokeCommand(&cmici);
3348  }
3349  }
3350  else
3351  {
3352  TrayWnd->ExecContextMenuCmd(uiCmdId);
3353  }
3354  }
3355 
3356  return S_OK;
3357  }
CComPtr< IContextMenu > pcm
Definition: traywnd.cpp:3257
#define SW_NORMAL
Definition: winuser.h:763
struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
#define PtrToUlong(u)
Definition: config.h:107
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
CComPtr< CTrayWindow > TrayWnd
Definition: traywnd.cpp:3256
#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 3270 of file traywnd.cpp.

3275  {
3276  HMENU hMenuBase;
3277 
3279 
3280  if (g_MinimizedAll.GetSize() != 0 && !::IsThereAnyEffectiveWindow(TRUE))
3281  {
3282  CStringW strRestoreAll(MAKEINTRESOURCEW(IDS_RESTORE_ALL));
3283  MENUITEMINFOW mii = { sizeof(mii) };
3284  mii.fMask = MIIM_ID | MIIM_TYPE;
3286  mii.fType = MFT_STRING;
3287  mii.dwTypeData = const_cast<LPWSTR>(&strRestoreAll[0]);
3289  }
3290 
3291  if (!hMenuBase)
3292  return HRESULT_FROM_WIN32(GetLastError());
3293 
3294  if (SHRestricted(REST_CLASSICSHELL) != 0)
3295  {
3296  DeleteMenu(hPopup,
3298  MF_BYCOMMAND);
3299  }
3300 
3301  CheckMenuItem(hMenuBase,
3304 
3305  UINT idCmdNext;
3306  idCmdNext = Shell_MergeMenus(hPopup, hMenuBase, indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS | MM_ADDSEPARATOR);
3307  m_idCmdCmFirst = idCmdNext - idCmdFirst;
3308 
3309  ::DestroyMenu(hMenuBase);
3310 
3311  if (TrayWnd->m_TrayBandSite != NULL)
3312  {
3313  if (FAILED(TrayWnd->m_TrayBandSite->AddContextMenus(
3314  hPopup,
3315  indexMenu,
3316  idCmdNext,
3317  idCmdLast,
3318  CMF_NORMAL,
3319  &pcm)))
3320  {
3321  WARN("AddContextMenus failed.\n");
3322  pcm = NULL;
3323  }
3324  }
3325 
3326  return S_OK;
3327  }
CComPtr< IContextMenu > pcm
Definition: traywnd.cpp:3257
#define MFT_STRING
Definition: winuser.h:741
#define TRUE
Definition: types.h:120
#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 ID_SHELL_CMD_RESTORE_ALL
Definition: resource.h:197
#define WARN(fmt,...)
Definition: debug.h:111
#define ID_SHELL_CMD_SHOW_DESKTOP
Definition: resource.h:191
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
LPWSTR dwTypeData
Definition: winuser.h:3244
static BOOL IsThereAnyEffectiveWindow(BOOL bMustBeInMonitor)
Definition: traywnd.cpp:109
#define IDM_TRAYWND
Definition: resource.h:57
CSimpleArray< HWND > g_MinimizedAll
Definition: traywnd.cpp:129
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
smooth NULL
Definition: ftsmooth.c:416
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:2327
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:59
#define ID_LOCKTASKBAR
Definition: resource.h:188
unsigned int UINT
Definition: ndis.h:50
#define MM_SUBMENUSHAVEIDS
Definition: shlobj.h:2328
CComPtr< CTrayWindow > TrayWnd
Definition: traywnd.cpp:3256
#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 3255 of file traywnd.cpp.

◆ m_idCmdCmFirst

UINT CTrayWindowCtxMenu::m_idCmdCmFirst
private

Definition at line 3258 of file traywnd.cpp.

◆ pcm

CComPtr<IContextMenu> CTrayWindowCtxMenu::pcm
private

Definition at line 3257 of file traywnd.cpp.

◆ TrayWnd

CComPtr<CTrayWindow> CTrayWindowCtxMenu::TrayWnd
private

Definition at line 3256 of file traywnd.cpp.


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