ReactOS 0.4.17-dev-116-ga4b6fe9
MockContextMenu Struct Reference
Inheritance diagram for MockContextMenu:
Collaboration diagram for MockContextMenu:

Public Member Functions

 STDMETHODIMP_ (ULONG) AddRef() override
 
 STDMETHODIMP_ (ULONG) Release() override
 
STDMETHODIMP QueryInterface (REFIID, void **) override
 
STDMETHODIMP QueryContextMenu (HMENU hmenu, UINT, UINT idCmdFirst, UINT, UINT uFlags) override
 
STDMETHODIMP InvokeCommand (LPCMINVOKECOMMANDINFO pici) override
 
STDMETHODIMP GetCommandString (UINT_PTR, UINT, UINT *, CHAR *, UINT) override
 
- Public Member Functions inherited from IContextMenu
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 ()
 

Public Attributes

HRESULT queryResult = S_OK
 
HRESULT invokeResult = S_OK
 
UINT defaultItemId = (UINT)-1
 
INT queryCalled = 0
 
INT invokeCalled = 0
 
DWORD lastQueryFlags = 0
 
CHAR lastVerb [MAX_PATH] = {}
 
WCHAR lastVerbW [MAX_PATH] = {}
 
DWORD lastFMask = 0
 
BOOL lastHadUnicode = FALSE
 

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 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 20 of file SHInvokeCommandsOnContextMenu.cpp.

Member Function Documentation

◆ GetCommandString()

STDMETHODIMP MockContextMenu::GetCommandString ( UINT_PTR  ,
UINT  ,
UINT ,
CHAR ,
UINT   
)
inlineoverride

Definition at line 80 of file SHInvokeCommandsOnContextMenu.cpp.

81 {
82 return E_NOTIMPL;
83 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InvokeCommand()

STDMETHODIMP MockContextMenu::InvokeCommand ( LPCMINVOKECOMMANDINFO  pici)
inlineoverride

Implements IContextMenu.

Definition at line 59 of file SHInvokeCommandsOnContextMenu.cpp.

60 {
62 const CMINVOKECOMMANDINFOEX* iciex = reinterpret_cast<const CMINVOKECOMMANDINFOEX*>(pici);
63
64 lastFMask = iciex->fMask;
65 lastHadUnicode = !!(iciex->fMask & CMIC_MASK_UNICODE);
66
67 if (HIWORD(iciex->lpVerb))
68 lstrcpyA(lastVerb, iciex->lpVerb);
69 else
71
72 if (lastHadUnicode && iciex->lpVerbW && HIWORD(iciex->lpVerbW))
73 lstrcpyW(lastVerbW, iciex->lpVerbW);
74 else
76
77 return invokeResult;
78 }
#define lstrcpyW
Definition: compat.h:749
struct IContextMenu::tagCMInvokeCommandInfoEx CMINVOKECOMMANDINFOEX
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
#define UNICODE_NULL
#define ANSI_NULL
#define HIWORD(l)
Definition: typedefs.h:247

◆ QueryContextMenu()

STDMETHODIMP MockContextMenu::QueryContextMenu ( HMENU  hmenu,
UINT  ,
UINT  idCmdFirst,
UINT  ,
UINT  uFlags 
)
inlineoverride

Implements IContextMenu.

Definition at line 43 of file SHInvokeCommandsOnContextMenu.cpp.

44 {
47
49 return queryResult;
50
51 if (defaultItemId != (UINT)-1)
52 {
53 AppendMenuA(hmenu, MF_STRING, idCmdFirst + defaultItemId - 1, "Item");
54 SetMenuDefaultItem(hmenu, idCmdFirst + defaultItemId - 1, FALSE);
55 }
56 return queryResult;
57 }
#define FALSE
Definition: types.h:117
UINT uFlags
Definition: api.c:59
#define FAILED(hr)
Definition: intsafe.h:51
static HMENU hmenu
Definition: win.c:78
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_STRING
Definition: winuser.h:138
BOOL WINAPI AppendMenuA(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCSTR)

◆ QueryInterface()

STDMETHODIMP MockContextMenu::QueryInterface ( REFIID  ,
void **   
)
inlineoverride

Implements IUnknown.

Definition at line 37 of file SHInvokeCommandsOnContextMenu.cpp.

38 {
39 return E_NOINTERFACE;
40 }
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ STDMETHODIMP_() [1/2]

MockContextMenu::STDMETHODIMP_ ( ULONG  )
inlineoverride

Definition at line 35 of file SHInvokeCommandsOnContextMenu.cpp.

35{ return 1; }

◆ STDMETHODIMP_() [2/2]

MockContextMenu::STDMETHODIMP_ ( ULONG  )
inlineoverride

Definition at line 36 of file SHInvokeCommandsOnContextMenu.cpp.

36{ return 1; }

Member Data Documentation

◆ defaultItemId

UINT MockContextMenu::defaultItemId = (UINT)-1

◆ invokeCalled

◆ invokeResult

◆ lastFMask

DWORD MockContextMenu::lastFMask = 0

◆ lastHadUnicode

BOOL MockContextMenu::lastHadUnicode = FALSE

◆ lastQueryFlags

◆ lastVerb

CHAR MockContextMenu::lastVerb[MAX_PATH] = {}

◆ lastVerbW

WCHAR MockContextMenu::lastVerbW[MAX_PATH] = {}

◆ queryCalled

INT MockContextMenu::queryCalled = 0

◆ queryResult

HRESULT MockContextMenu::queryResult = S_OK

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