ReactOS 0.4.16-dev-122-g325d74c
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 ()
 
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 3556 of file traywnd.cpp.

Constructor & Destructor Documentation

◆ CTrayWindowCtxMenu()

CTrayWindowCtxMenu::CTrayWindowCtxMenu ( )
inline

Definition at line 3675 of file traywnd.cpp.

3676 {
3677 }

◆ ~CTrayWindowCtxMenu()

virtual CTrayWindowCtxMenu::~CTrayWindowCtxMenu ( )
inlinevirtual

Definition at line 3679 of file traywnd.cpp.

3680 {
3681 }

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

3671 {
3672 return E_NOTIMPL;
3673 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Initialize()

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

Definition at line 3567 of file traywnd.cpp.

3568 {
3569 this->TrayWnd = (CTrayWindow *) pTrayWnd;
3570 this->hWndOwner = hWndOwner;
3571 this->m_idCmdCmFirst = 0;
3572 return S_OK;
3573 }
CComPtr< CTrayWindow > TrayWnd
Definition: traywnd.cpp:3562
#define S_OK
Definition: intsafe.h:52

Referenced by TrayWindowCtxMenuCreator().

◆ InvokeCommand()

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

Implements IContextMenu.

Definition at line 3636 of file traywnd.cpp.

3637 {
3638 UINT uiCmdId = PtrToUlong(lpici->lpVerb);
3639 if (uiCmdId != 0)
3640 {
3641 if (uiCmdId >= m_idCmdCmFirst)
3642 {
3643 CMINVOKECOMMANDINFO cmici = { 0 };
3644
3645 if (pcm != NULL)
3646 {
3647 /* Setup and invoke the shell command */
3648 cmici.cbSize = sizeof(cmici);
3649 cmici.hwnd = hWndOwner;
3650 cmici.lpVerb = (LPCSTR) MAKEINTRESOURCEW(uiCmdId - m_idCmdCmFirst);
3651 cmici.nShow = SW_NORMAL;
3652
3653 pcm->InvokeCommand(&cmici);
3654 }
3655 }
3656 else
3657 {
3658 TrayWnd->ExecContextMenuCmd(uiCmdId);
3659 }
3660 }
3661
3662 return S_OK;
3663 }
CComPtr< IContextMenu > pcm
Definition: traywnd.cpp:3563
#define NULL
Definition: types.h:112
#define PtrToUlong(u)
Definition: config.h:107
struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
unsigned int UINT
Definition: ndis.h:50
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define SW_NORMAL
Definition: winuser.h:772
const char * LPCSTR
Definition: xmlstorage.h:183

◆ QueryContextMenu()

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

Implements IContextMenu.

Definition at line 3576 of file traywnd.cpp.

3581 {
3582 HMENU hMenuBase;
3583
3585 if (!hMenuBase)
3587
3589 {
3591 MENUITEMINFOW mii = { sizeof(mii) };
3592 mii.fMask = MIIM_ID | MIIM_TYPE;
3594 mii.fType = MFT_STRING;
3595 mii.dwTypeData = const_cast<LPWSTR>(&strRestoreAll[0]);
3597 }
3598
3600 {
3601 DeleteMenu(hPopup,
3603 MF_BYCOMMAND);
3604 }
3605
3606 CheckMenuItem(hMenuBase,
3609
3610 UINT idCmdNext;
3611 idCmdNext = Shell_MergeMenus(hPopup, hMenuBase, indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS | MM_ADDSEPARATOR);
3612 m_idCmdCmFirst = idCmdNext - idCmdFirst;
3613
3614 ::DestroyMenu(hMenuBase);
3615
3616 if (TrayWnd->m_TrayBandSite != NULL)
3617 {
3618 pcm.Release();
3619 if (FAILED(TrayWnd->m_TrayBandSite->AddContextMenus(
3620 hPopup,
3621 indexMenu,
3622 idCmdNext,
3623 idCmdLast,
3624 CMF_NORMAL,
3625 &pcm)))
3626 {
3627 WARN("AddContextMenus failed.\n");
3628 pcm.Release();
3629 }
3630 }
3631
3632 return S_OK;
3633 }
#define WARN(fmt,...)
Definition: precomp.h:61
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
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:105
#define IDM_TRAYWND
Definition: resource.h:57
#define ID_SHELL_CMD_RESTORE_ALL
Definition: resource.h:216
#define ID_LOCKTASKBAR
Definition: resource.h:207
#define ID_SHELL_CMD_SHOW_DESKTOP
Definition: resource.h:210
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
#define FAILED(hr)
Definition: intsafe.h:51
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
HRESULT HResultFromWin32(DWORD hr)
Definition: shellutils.h:70
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:2529
#define MM_ADDSEPARATOR
Definition: shlobj.h:2528
@ REST_CLASSICSHELL
Definition: shlobj.h:1680
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:150
LPWSTR dwTypeData
Definition: winuser.h:3272
CSimpleArray< MINWNDPOS > g_MinimizedAll
Definition: traywnd.cpp:186
static BOOL IsThereAnyEffectiveWindow(BOOL bMustBeInMonitor)
Definition: traywnd.cpp:167
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define MF_BYCOMMAND
Definition: winuser.h:202
#define MIIM_ID
Definition: winuser.h:725
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:749
#define MIIM_TYPE
Definition: winuser.h:728
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Member Data Documentation

◆ hWndOwner

HWND CTrayWindowCtxMenu::hWndOwner
private

Definition at line 3561 of file traywnd.cpp.

◆ m_idCmdCmFirst

UINT CTrayWindowCtxMenu::m_idCmdCmFirst
private

Definition at line 3564 of file traywnd.cpp.

◆ pcm

CComPtr<IContextMenu> CTrayWindowCtxMenu::pcm
private

Definition at line 3563 of file traywnd.cpp.

◆ TrayWnd

CComPtr<CTrayWindow> CTrayWindowCtxMenu::TrayWnd
private

Definition at line 3562 of file traywnd.cpp.


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