Click here to Skip to main content
15,880,725 members
Articles / Programming Languages / C++

sdeExtensions: Some shell extensions to make a developer's life easier

Rate me:
Please Sign up or sign in to vote.
4.17/5 (5 votes)
1 Nov 2004CPOL3 min read 41.3K   962   18  
Shell extensions to make a file read/write, make a file readonly, make a new folder, clean up temporary files and MP3 assignment.
/**
 * @name makeDir.h
 * @purpose Make a directory
 * @date 11 May 2003
 * @author S.Deckers
 */

#ifndef _MAKEDIR_H_
#define _MAKEDIR_H_

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

/////////////////////////////////////////////////////////////////////////////
// CMakeDir

class ATL_NO_VTABLE CMakeDir : 
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CMakeDir, &CLSID_MakeDir>,
	public IDispatchImpl<IMakeDir, &IID_IMakeDir, &LIBID_sdeExtensions>,
    public IShellExtInit,
    public IContextMenu
{
public:		// --- Ctor


	/**
	 * @name CMakeDir
	 * @Purpose ctor
	 */

	CMakeDir( )
	{
		AtlTrace( "CMakeDir ctor\n");
		m_hBmp = LoadBitmap ( _Module.GetModuleInstance(),MAKEINTRESOURCE( IDB_MAKEDIR) );
	}

public:		// --- COM Macros

	DECLARE_REGISTRY_RESOURCEID		( IDR_MAKEDIR)

	DECLARE_PROTECT_FINAL_CONSTRUCT	( )

	BEGIN_COM_MAP					( CMakeDir)
		COM_INTERFACE_ENTRY			( IMakeDir)
		COM_INTERFACE_ENTRY			( IDispatch)
		COM_INTERFACE_ENTRY			( IShellExtInit)
		COM_INTERFACE_ENTRY			( IContextMenu)
	END_COM_MAP						( )

public:		// --- Implemented interfaces
	
	// --- IShellExtInit
    
    STDMETHOD( Initialize)			( LPCITEMIDLIST, LPDATAOBJECT, HKEY);

    // --- IContextMenu : interface for interacting with the context menu

    STDMETHOD( GetCommandString)	( UINT, UINT, UINT*, LPSTR, UINT);
    STDMETHOD( InvokeCommand)		( LPCMINVOKECOMMANDINFO);
    STDMETHOD( QueryContextMenu)	( HMENU, UINT, UINT, UINT, UINT);

private:	// --- Protected members

    TCHAR	m_szDirClickedIn [MAX_PATH];
	HBITMAP	m_hBmp;
};

#endif //_MAKEDIR_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) Merkator
Netherlands Netherlands
Busy with Intergraph G/Technology-GIS

Comments and Discussions