ReactOS 0.4.17-dev-357-ga8f14ff
CTrayWindowCtxMenu Class Reference
Inheritance diagram for CTrayWindowCtxMenu:
Collaboration diagram for CTrayWindowCtxMenu:

Public Member Functions

HRESULT Initialize (ITrayWindow *pTrayWnd, IN HWND hWndOwner)
 
STDMETHODIMP QueryContextMenu (HMENU hPopup, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override
 
STDMETHODIMP InvokeCommand (LPCMINVOKECOMMANDINFO lpici) override
 
STDMETHODIMP GetCommandString (UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax) override
 
 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 ()
 
HRESULT QueryContextMenu ([in] HMENU hmenu, [in] UINT indexMenu, [in] UINT idCmdFirst, [in] UINT idCmdLast, [in] UINT uFlags)
 
HRESULT InvokeCommand ([in] LPCMINVOKECOMMANDINFO lpici)
 
HRESULT GetCommandString ([in] UINT_PTR idCmd, [in] UINT uType, [out] UINT *pwReserved, [out, size_is(cchMax)] LPSTR pszName, [in] UINT cchMax)
 
- 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 IContextMenuLPCONTEXTMENU
 
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
 
- Static Public Attributes inherited from IContextMenu
static 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 3640 of file traywnd.cpp.

Constructor & Destructor Documentation

◆ CTrayWindowCtxMenu()

CTrayWindowCtxMenu::CTrayWindowCtxMenu ( )
inline

Definition at line 3760 of file traywnd.cpp.

3761 {
3762 }

◆ ~CTrayWindowCtxMenu()

virtual CTrayWindowCtxMenu::~CTrayWindowCtxMenu ( )
inlinevirtual

Definition at line 3764 of file traywnd.cpp.

3765 {
3766 }

Member Function Documentation

◆ GetCommandString()

STDMETHODIMP CTrayWindowCtxMenu::GetCommandString ( UINT_PTR  idCmd,
UINT  uType,
UINT pwReserved,
LPSTR  pszName,
UINT  cchMax 
)
inlineoverride

Implements IContextMenu.

Definition at line 3750 of file traywnd.cpp.

3756 {
3757 return E_NOTIMPL;
3758 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Initialize()

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

Definition at line 3651 of file traywnd.cpp.

3652 {
3653 this->TrayWnd = (CTrayWindow *) pTrayWnd;
3654 this->hWndOwner = hWndOwner;
3655 this->m_idCmdCmFirst = 0;
3656 return S_OK;
3657 }
CComPtr< CTrayWindow > TrayWnd
Definition: traywnd.cpp:3646
#define S_OK
Definition: intsafe.h:52

Referenced by TrayWindowCtxMenuCreator().

◆ InvokeCommand()

STDMETHODIMP CTrayWindowCtxMenu::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpici)
inlineoverride

Implements IContextMenu.

Definition at line 3720 of file traywnd.cpp.

3721 {
3722 UINT uiCmdId = PtrToUlong(lpici->lpVerb);
3723 if (uiCmdId != 0)
3724 {
3725 if (uiCmdId >= m_idCmdCmFirst)
3726 {
3727 CMINVOKECOMMANDINFO cmici = { 0 };
3728
3729 if (pcm != NULL)
3730 {
3731 /* Setup and invoke the shell command */
3732 cmici.cbSize = sizeof(cmici);
3733 cmici.hwnd = hWndOwner;
3734 cmici.lpVerb = (LPCSTR) MAKEINTRESOURCEW(uiCmdId - m_idCmdCmFirst);
3735 cmici.nShow = SW_NORMAL;
3736
3737 pcm->InvokeCommand(&cmici);
3738 }
3739 }
3740 else
3741 {
3742 TrayWnd->ExecContextMenuCmd(uiCmdId);
3743 }
3744 }
3745
3746 return S_OK;
3747 }
CComPtr< IContextMenu > pcm
Definition: traywnd.cpp:3647
#define NULL
Definition: types.h:112
#define PtrToUlong(u)
Definition: config.h:107
struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
unsigned int UINT
Definition: ndis.h:50
const char * LPCSTR
Definition: typedefs.h:52
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define SW_NORMAL
Definition: winuser.h:780

◆ QueryContextMenu()

STDMETHODIMP CTrayWindowCtxMenu::QueryContextMenu ( HMENU  hPopup,
UINT  indexMenu,
UINT  idCmdFirst,
UINT  idCmdLast,
UINT  uFlags 
)
inlineoverride

Implements IContextMenu.

Definition at line 3660 of file traywnd.cpp.

3665 {
3666 HMENU hMenuBase;
3667
3669 if (!hMenuBase)
3671
3673 {
3675 MENUITEMINFOW mii = { sizeof(mii) };
3676 mii.fMask = MIIM_ID | MIIM_TYPE;
3678 mii.fType = MFT_STRING;
3679 mii.dwTypeData = const_cast<LPWSTR>(&strRestoreAll[0]);
3681 }
3682
3684 {
3685 DeleteMenu(hPopup,
3687 MF_BYCOMMAND);
3688 }
3689
3690 CheckMenuItem(hMenuBase,
3693
3694 UINT idCmdNext;
3695 idCmdNext = Shell_MergeMenus(hPopup, hMenuBase, indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS | MM_ADDSEPARATOR);
3696 m_idCmdCmFirst = idCmdNext - idCmdFirst;
3697
3698 ::DestroyMenu(hMenuBase);
3699
3700 if (TrayWnd->m_TrayBandSite != NULL)
3701 {
3702 pcm.Release();
3703 if (FAILED(TrayWnd->m_TrayBandSite->AddContextMenus(
3704 hPopup,
3705 indexMenu,
3706 idCmdNext,
3707 idCmdLast,
3708 CMF_NORMAL,
3709 &pcm)))
3710 {
3711 WARN("AddContextMenus failed.\n");
3712 pcm.Release();
3713 }
3714 }
3715
3716 return S_OK;
3717 }
#define WARN(fmt,...)
Definition: precomp.h:61
HMENU LoadPopupMenu(IN HINSTANCE hInstance, IN LPCWSTR lpMenuName)
Definition: util.cpp:33
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
#define IDS_RESTORE_ALL
Definition: resource.h:111
#define IDM_TRAYWND
Definition: resource.h:63
#define ID_SHELL_CMD_RESTORE_ALL
Definition: resource.h:223
#define ID_LOCKTASKBAR
Definition: resource.h:214
#define ID_SHELL_CMD_SHOW_DESKTOP
Definition: resource.h:217
void Release()
Definition: atlcomcli.h:170
int GetSize() const
Definition: atlsimpcoll.h:104
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
#define FAILED(hr)
Definition: intsafe.h:51
#define HResultFromWin32
Definition: loader.cpp:14
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:856
#define MM_SUBMENUSHAVEIDS
Definition: shlobj.h:2537
#define MM_ADDSEPARATOR
Definition: shlobj.h:2536
@ REST_CLASSICSHELL
Definition: shlobj.h:1687
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:166
LPWSTR dwTypeData
Definition: winuser.h:3377
CSimpleArray< MINWNDPOS > g_MinimizedAll
Definition: traywnd.cpp:172
static BOOL IsThereAnyEffectiveWindow(BOOL bMustBeInMonitor)
Definition: traywnd.cpp:153
uint16_t * LPWSTR
Definition: typedefs.h:56
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define MF_BYCOMMAND
Definition: winuser.h:202
#define MIIM_ID
Definition: winuser.h:733
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_CHECKED
Definition: winuser.h:132
#define MF_UNCHECKED
Definition: winuser.h:204
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define MFT_STRING
Definition: winuser.h:757
#define MIIM_TYPE
Definition: winuser.h:736

Member Data Documentation

◆ hWndOwner

HWND CTrayWindowCtxMenu::hWndOwner
private

Definition at line 3645 of file traywnd.cpp.

Referenced by Initialize(), and InvokeCommand().

◆ m_idCmdCmFirst

UINT CTrayWindowCtxMenu::m_idCmdCmFirst
private

Definition at line 3648 of file traywnd.cpp.

Referenced by InvokeCommand(), and QueryContextMenu().

◆ pcm

CComPtr<IContextMenu> CTrayWindowCtxMenu::pcm
private

Definition at line 3647 of file traywnd.cpp.

Referenced by InvokeCommand(), and QueryContextMenu().

◆ TrayWnd

CComPtr<CTrayWindow> CTrayWindowCtxMenu::TrayWnd
private

Definition at line 3646 of file traywnd.cpp.

Referenced by InvokeCommand(), and QueryContextMenu().


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