ReactOS  0.4.14-dev-376-gaedba84
CRecycleBinItemContextMenu Class Reference
Inheritance diagram for CRecycleBinItemContextMenu:
Collaboration diagram for CRecycleBinItemContextMenu:

Public Member Functions

 CRecycleBinItemContextMenu ()
 
 ~CRecycleBinItemContextMenu ()
 
HRESULT WINAPI Initialize (LPCITEMIDLIST pidl)
 
virtual HRESULT WINAPI QueryContextMenu (HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
 
virtual HRESULT WINAPI InvokeCommand (LPCMINVOKECOMMANDINFO lpcmi)
 
virtual HRESULT WINAPI GetCommandString (UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen)
 
virtual HRESULT WINAPI HandleMenuMsg (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- 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

LPITEMIDLIST apidl
 

Additional Inherited Members

- Public Types inherited from IContextMenu2
typedef IContextMenu2LPCONTEXTMENU2
 
- 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::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 94 of file CRecycleBin.cpp.

Constructor & Destructor Documentation

◆ CRecycleBinItemContextMenu()

CRecycleBinItemContextMenu::CRecycleBinItemContextMenu ( )

Definition at line 298 of file CRecycleBin.cpp.

299 {
300  apidl = NULL;
301 }
smooth NULL
Definition: ftsmooth.c:416

◆ ~CRecycleBinItemContextMenu()

CRecycleBinItemContextMenu::~CRecycleBinItemContextMenu ( )

Definition at line 303 of file CRecycleBin.cpp.

304 {
305  ILFree(apidl);
306 }
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925

Member Function Documentation

◆ GetCommandString()

HRESULT WINAPI CRecycleBinItemContextMenu::GetCommandString ( UINT_PTR  idCommand,
UINT  uFlags,
UINT lpReserved,
LPSTR  lpszName,
UINT  uMaxNameLen 
)
virtual

Implements IContextMenu.

Definition at line 398 of file CRecycleBin.cpp.

399 {
400  TRACE("(%p)->(idcom=%lx flags=%x %p name=%p len=%x)\n", this, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
401 
402  return E_FAIL;
403 }
UINT uFlags
Definition: api.c:59
#define E_FAIL
Definition: ddrawi.h:102
#define TRACE(s)
Definition: solgame.cpp:4

◆ HandleMenuMsg()

HRESULT WINAPI CRecycleBinItemContextMenu::HandleMenuMsg ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
virtual

Implements IContextMenu2.

Definition at line 405 of file CRecycleBin.cpp.

406 {
407  TRACE("CRecycleBin_IContextMenu2Item_HandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n", this, uMsg, wParam, lParam);
408 
409  return E_NOTIMPL;
410 }
WPARAM wParam
Definition: combotst.c:138
#define TRACE(s)
Definition: solgame.cpp:4
#define E_NOTIMPL
Definition: ddrawi.h:99
LPARAM lParam
Definition: combotst.c:139

◆ Initialize()

HRESULT WINAPI CRecycleBinItemContextMenu::Initialize ( LPCITEMIDLIST  pidl)

Definition at line 308 of file CRecycleBin.cpp.

309 {
310  apidl = ILClone(pidl);
311  if (apidl == NULL)
312  return E_OUTOFMEMORY;
313  return S_OK;
314 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228

◆ InvokeCommand()

HRESULT WINAPI CRecycleBinItemContextMenu::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpcmi)
virtual

Implements IContextMenu.

Definition at line 354 of file CRecycleBin.cpp.

355 {
357  static LPCWSTR szDrive = L"C:\\";
358 
359  TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n", this, lpcmi, lpcmi->lpVerb, lpcmi->hwnd);
360 
361  if (lpcmi->lpVerb == MAKEINTRESOURCEA(1) || lpcmi->lpVerb == MAKEINTRESOURCEA(5))
362  {
363  Context.pFileDetails = _ILGetRecycleStruct(apidl);
364  Context.bFound = FALSE;
365 
367  if (!Context.bFound)
368  return E_FAIL;
369 
370  if (lpcmi->lpVerb == MAKEINTRESOURCEA(1))
371  {
372  /* restore file */
373  if (RestoreFile(Context.hDeletedFile))
374  return S_OK;
375  else
376  return E_FAIL;
377  }
378  else
379  {
381  return E_NOTIMPL;
382  }
383  }
384  else if (lpcmi->lpVerb == MAKEINTRESOURCEA(3))
385  {
386  FIXME("implement cut\n");
387  return E_NOTIMPL;
388  }
389  else if (lpcmi->lpVerb == MAKEINTRESOURCEA(7))
390  {
391  FIXME("implement properties\n");
392  return E_NOTIMPL;
393  }
394 
395  return S_OK;
396 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define E_FAIL
Definition: ddrawi.h:102
BOOL WINAPI DeleteFileHandleToRecycleBin(IN HANDLE hDeletedFile)
Definition: recyclebin.c:93
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI CBSearchRecycleBin(IN PVOID Context, IN HANDLE hDeletedFile)
BOOL WINAPI RestoreFile(IN HANDLE hDeletedFile)
Definition: recyclebin.c:366
static const WCHAR L[]
Definition: oid.c:1250
BOOL WINAPI EnumerateRecycleBinW(IN LPCWSTR pszRoot OPTIONAL, IN PENUMERATE_RECYCLEBIN_CALLBACK pFnCallback, IN PVOID Context OPTIONAL)
Definition: recyclebin.c:205
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
static PIDLRecycleStruct * _ILGetRecycleStruct(LPCITEMIDLIST pidl)
struct tagContext Context
Definition: acpixf.h:1030

◆ QueryContextMenu()

HRESULT WINAPI CRecycleBinItemContextMenu::QueryContextMenu ( HMENU  hMenu,
UINT  indexMenu,
UINT  idCmdFirst,
UINT  idCmdLast,
UINT  uFlags 
)
virtual

Implements IContextMenu.

Definition at line 316 of file CRecycleBin.cpp.

317 {
318  WCHAR szBuffer[30] = {0};
319  ULONG Count = 1;
320 
321  TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n", this, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
322 
323  if (LoadStringW(shell32_hInstance, IDS_RESTORE, szBuffer, _countof(szBuffer)))
324  {
325  szBuffer[_countof(szBuffer)-1] = L'\0';
326  _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED);
327  Count++;
328  }
329 
330  if (LoadStringW(shell32_hInstance, IDS_CUT, szBuffer, _countof(szBuffer)))
331  {
332  _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED);
333  szBuffer[_countof(szBuffer)-1] = L'\0';
334  _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED);
335  }
336 
337  if (LoadStringW(shell32_hInstance, IDS_DELETE, szBuffer, _countof(szBuffer)))
338  {
339  szBuffer[_countof(szBuffer)-1] = L'\0';
340  _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED);
341  _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED);
342  }
343 
344  if (LoadStringW(shell32_hInstance, IDS_PROPERTIES, szBuffer, _countof(szBuffer)))
345  {
346  szBuffer[_countof(szBuffer)-1] = L'\0';
347  _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED);
348  _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_DEFAULT);
349  }
350 
351  return MAKE_HRESULT(SEVERITY_SUCCESS, 0, Count);
352 }
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
#define IDS_CUT
Definition: shresdef.h:211
#define MFT_STRING
Definition: winuser.h:741
#define TRUE
Definition: types.h:120
#define _countof(array)
Definition: fontsub.cpp:30
#define IDS_RESTORE
Definition: shresdef.h:212
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define IDS_PROPERTIES
Definition: resource.h:101
UINT uFlags
Definition: api.c:59
#define MFS_DEFAULT
Definition: winuser.h:743
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define SEVERITY_SUCCESS
Definition: winerror.h:64
#define MFS_ENABLED
Definition: winuser.h:745
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
smooth NULL
Definition: ftsmooth.c:416
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MFT_SEPARATOR
Definition: winuser.h:739
static const WCHAR L[]
Definition: oid.c:1250
unsigned int ULONG
Definition: retypes.h:1
#define IDS_DELETE
Definition: resource.h:40

Member Data Documentation

◆ apidl

LPITEMIDLIST CRecycleBinItemContextMenu::apidl
private

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