Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Classic Shell

, 23 Feb 2010 MIT
Classic Start menu and other shell features for Windows 7 and Vista.
ClassicShellSetup.zip
ClassicShellSetup.exe
ClassicShellSrc.zip
ClassicShell
ClassicExplorer
ClassicCopyExt.rgs
ClassicExplorer.rgs
ClassicExplorer32.def
ClassicExplorer64.def
Explorer.ini
ExplorerBand.rgs
ExplorerBHO.rgs
ExplorerL10N.ini
up.ico
up2Disabled.ico
up2Hot.ico
up2Normal.ico
up2Pressed.ico
upDisabled.ico
ClassicShellSetup
ClassicShell.ico
ClassicShellBanner.jpg
ClassicShellSetup.manifest
ClassicShellSetup32
ClassicShellSetup32.vdproj
ClassicShellSetup64
ClassicShellSetup64.vdproj
ClassicStartMenu
ClassicStartMenu.manifest
ClassicStartMenuDLL
StartMenu.ini
StartMenuItems.ini
StartMenuL10N.ini
Docs
ClassicExplorer_files
after.png
before.png
ClassicShell.png
FolderView.gif
iconoffset.png
statusbar.png
titlebar.png
toolbar.png
ClassicShellEULA.rtf
ClassicShellReadme.rtf
ClassicStartMenu_files
ClassicShell.png
screenshot.png
skins.gif
ParseSettings
Skins
ClassicSkin
main_bitmap.bmp
selection.bmp
VistaAero
main_bitmap.bmp
selection.bmp
Win7Aero
main_bitmap.bmp
selection.bmp
Win7Basic
main_bitmap.bmp
selection.bmp
// Classic Shell (c) 2009-2010, Ivo Beltchev
// The sources for Classic Shell are distributed under the MIT open source license

#pragma once

class CMenuContainer;

// CMenuAccessible - provides accessibility services for a CMenuContainer
class CMenuAccessible: public IAccessible
{
public:
	CMenuAccessible( CMenuContainer *pOwner );
	~CMenuAccessible( void );
	void Reset( void ); // called by the owner when it is destroyed

	// IUnknown
	virtual STDMETHODIMP QueryInterface( REFIID riid, void **ppvObject )
	{
		*ppvObject=NULL;
		if (IID_IUnknown==riid || IID_IDispatch==riid || IID_IAccessible==riid)
		{
			AddRef();
			*ppvObject=static_cast<IAccessible*>(this);
			return S_OK;
		}
		return E_NOINTERFACE;
	}

	virtual ULONG STDMETHODCALLTYPE AddRef( void ) 
	{ 
		return InterlockedIncrement(&m_RefCount);
	}

	virtual ULONG STDMETHODCALLTYPE Release( void )
	{
		long nTemp=InterlockedDecrement(&m_RefCount);
		if (!nTemp) delete this;
		return nTemp;
	}

	// IDispatch
	virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount( UINT *pctinfo ) { return E_NOTIMPL; }
	virtual HRESULT STDMETHODCALLTYPE GetTypeInfo( UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo ) { *ppTInfo=NULL; return E_NOTIMPL; }
	virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames( REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId ) { return E_NOTIMPL; }
	virtual HRESULT STDMETHODCALLTYPE Invoke( DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr ) { return E_NOTIMPL; }

	// IAccessible
	virtual HRESULT STDMETHODCALLTYPE get_accParent( IDispatch **ppdispParent );
	virtual HRESULT STDMETHODCALLTYPE get_accChildCount( long *pcountChildren );
	virtual HRESULT STDMETHODCALLTYPE get_accChild( VARIANT varChild, IDispatch **ppdispChild );
	virtual HRESULT STDMETHODCALLTYPE get_accName( VARIANT varChild, BSTR *pszName );
	virtual HRESULT STDMETHODCALLTYPE get_accValue( VARIANT varChild, BSTR *pszValue ) { *pszValue=NULL; return DISP_E_MEMBERNOTFOUND; }
	virtual HRESULT STDMETHODCALLTYPE get_accDescription( VARIANT varChild, BSTR *pszDescription );
	virtual HRESULT STDMETHODCALLTYPE get_accRole( VARIANT varChild, VARIANT *pvarRole );
	virtual HRESULT STDMETHODCALLTYPE get_accState( VARIANT varChild, VARIANT *pvarState );
	virtual HRESULT STDMETHODCALLTYPE get_accHelp( VARIANT varChild, BSTR *pszHelp ) { *pszHelp=NULL; return S_FALSE; }
	virtual HRESULT STDMETHODCALLTYPE get_accHelpTopic( BSTR *pszHelpFile, VARIANT varChild, long *pidTopic ) { *pszHelpFile=NULL; return S_FALSE; }
	virtual HRESULT STDMETHODCALLTYPE get_accKeyboardShortcut( VARIANT varChild, BSTR *pszKeyboardShortcut );
	virtual HRESULT STDMETHODCALLTYPE get_accFocus( VARIANT *pvarChild );
	virtual HRESULT STDMETHODCALLTYPE get_accSelection( VARIANT *pvarChildren );
	virtual HRESULT STDMETHODCALLTYPE get_accDefaultAction( VARIANT varChild, BSTR *pszDefaultAction );
	virtual HRESULT STDMETHODCALLTYPE accSelect( long flagsSelect, VARIANT varChild );
	virtual HRESULT STDMETHODCALLTYPE accLocation( long *pxLeft, long *pyTop, long *pcxWidth, long *pcyHeight, VARIANT varChild );
	virtual HRESULT STDMETHODCALLTYPE accNavigate( long navDir, VARIANT varStart, VARIANT *pvarEndUpAt );
	virtual HRESULT STDMETHODCALLTYPE accHitTest( long xLeft, long yTop, VARIANT *pvarChild );
	virtual HRESULT STDMETHODCALLTYPE accDoDefaultAction( VARIANT varChild );
	virtual HRESULT STDMETHODCALLTYPE put_accName( VARIANT varChild, BSTR szName ) { return E_NOTIMPL; }
	virtual HRESULT STDMETHODCALLTYPE put_accValue( VARIANT varChild, BSTR szValue ) { return DISP_E_MEMBERNOTFOUND; }

private:
	LONG m_RefCount;
	CMenuContainer *m_pOwner;
	CComPtr<IAccessible> m_pStdAccessible;
};

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 MIT License

Share

About the Author

Ivo Beltchev
Software Developer (Senior)
United States United States
Ivo started programming in 1985 on an Apple ][ clone. He graduated from Sofia University, Bulgaria with a MSCS degree. Ivo has been working as a professional programmer for over 12 years, and as a professional game programmer for over 10. He is currently employed in Pandemic Studios, a video game company in Los Angeles, California.

| Advertise | Privacy | Mobile
Web02 | 2.8.141015.1 | Last Updated 23 Feb 2010
Article Copyright 2009 by Ivo Beltchev
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid