Click here to Skip to main content
15,896,606 members
Articles / Programming Languages / C++

Listing Used Files

Rate me:
Please Sign up or sign in to vote.
4.81/5 (95 votes)
29 Sep 2010CPOL11 min read 637.9K   23.2K   220  
A ShellExtension that lists all the used files in a folder.
// InterFaceCls.h : Declaration of the CInterFaceCls

#ifndef __INTERFACECLS_H_
#define __INTERFACECLS_H_

#include "resource.h"       // main symbols
#include <shlobj.h>
#include <comdef.h>

/////////////////////////////////////////////////////////////////////////////
// CInterFaceCls
class ATL_NO_VTABLE CInterFaceCls : 
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CInterFaceCls, &CLSID_InterFaceCls>,
	public IShellExtInit,
    public IContextMenu
{

public:
	CInterFaceCls()
	{
	}

DECLARE_REGISTRY_RESOURCEID(IDR_INTERFACECLS)
DECLARE_NOT_AGGREGATABLE(CInterFaceCls)

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CInterFaceCls)
	COM_INTERFACE_ENTRY(IShellExtInit)
    COM_INTERFACE_ENTRY(IContextMenu)
END_COM_MAP()

// IInterFaceCls

public:

  STDMETHODIMP Initialize( LPCITEMIDLIST pidlFolder, LPDATAOBJECT pDataObj, HKEY hProgID );

  STDMETHODIMP GetCommandString( UINT idCmd, UINT uFlags, UINT* pwReserved, LPSTR pszName, UINT cchMax );
  
  STDMETHODIMP InvokeCommand( LPCMINVOKECOMMANDINFO pCmdInfo );
  
  STDMETHODIMP QueryContextMenu( HMENU hmenu, UINT uMenuIndex, UINT uidFirstCmd, UINT uidLastCmd, UINT uFlags );

private:

    CString m_csPath;
};

#endif //__INTERFACECLS_H_

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Australia Australia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions