⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addincommandmanager.h

📁 ResOrg 图形化管理Vc项目的资源ID的工具的源代码。 ResOrg - Manage and Renumber Resource Symbol IDs Introduction The
💻 H
字号:
/************************************************************************
 *
 *            Resource ID Organiser Add-In for Visual C++
 *
 * (c) Copyright 2000-2005 by Riverblade Limited (UK). All rights reserved.
 *
 ************************************************************************
 *                                                                       
 *  Description : AddInCommandManager - Manages commands on behalf of the add-in
 *
 *  Compiler    : Microsoft Visual C++ .NET 2003
 *                                                                       
 *  Target                                                               
 *  Environment : Windows 2000/XP/Vista;
 *                Visual Studio 2002, 2003 or 2005
 *
 *  NOTE:
 *
 *    This software is provided "as is". All title and copyrights in and
 *    to the software, including but not limited to any images, text etc.
 *    etc. incorporated into it, are the property of Anna-Jayne Metcalfe
 *    and Riverblade Limited, except where acknowledged otherwise.
 *
 *    Your may freely use this code in your own products, PROVIDED
 *    this notice is not removed or modified.
 *
 *    Please visit http://www.riverblade.co.uk/products/resorg or email 
 *    support@riverblade.co.uk for latest updates and product support 
 *
 ************************************************************************
 *   MODIFICATION HISTORY:
 *
 *           This is a controlled document. See project configuration
 *           control tool for latest version and full version history.
 *
 *    $Archive: /Projects/AddIns/ResOrg/ResOrgNETAddIn/AddInCommandManager.h $
 *   $Revision: 1 $
 *       $Date: 22/10/05 11:08 $
 *     $Author: Anna $
 *
 *    $History: AddInCommandManager.h $
 * 
 * *****************  Version 1  *****************
 * User: Anna         Date: 22/10/05   Time: 11:08
 * Created in $/Projects/AddIns/ResOrg/ResOrgNETAddIn
 * 
 * $Nokeywords: $
 *
 ************************************************************************/

#pragma once


#include "AddInCommandHandler.h"




class CAddInCommandManager
{
	// Construction/Destruction
	public:
				CAddInCommandManager(void);

				~CAddInCommandManager(void);

	// Data members
	protected:
				CComPtr<EnvDTE::_DTE>	m_pDTE;
				CComPtr<EnvDTE::AddIn>	m_pAddInInstance;
				CAddInCommandHandlerMap	m_mapCmdHandlers;
				HWND					m_hwndResOrg;
				EnvDTE::WindowPtr		m_ptrToolWindow;


	// Operations
	public:
				HRESULT					OnConnection(			const CComPtr<EnvDTE::_DTE>& pDTE,
																const CComPtr<EnvDTE::AddIn>& pAddInInstance,
																HWND hwndResOrg = NULL,
																const EnvDTE::WindowPtr& ptrToolWindow = NULL);

				HRESULT					OnDisconnection(void);

				void					CreateCommandHandlers(void);

				bool					CommandsExist(void) const;

				HRESULT					ConfigureCommands(CString* psErrorMsg = NULL);

				HRESULT					RemoveCommands(void);

				HRESULT					RemoveCommand(_bstr_t bsCommandName);


	// Implementation
	protected:
				bool					AddCommandHandler(CAddInCommandHandler* pHandler);

				EnvDTE::CommandPtr		AddCommand(UINT uCmdSpecID, bool bEnabled);

				// Load a newline delimited specification for a command
				bool					LoadCommandSpec(UINT uResourceID,
														CString& rsCmd,
														CString& rsButtonText,
														CString& rsToolTip,
														CString& rsKeyBinding,
														bool& rbHasBitmap) const;


				IDispatchPtr			GetCommandBar(const CString& sTitle) const;

				IDispatchPtr			AddCommandBar(	const CString& sTitle,
														EnvDTE::vsCommandBarType eType,
														const IDispatchPtr & ptrParent,
														long lPosition);

				HRESULT					RemoveCommandBar(const IDispatchPtr& ptrCommandBar);

				HRESULT					AddCommandToCommandBar(
														const IDispatchPtr& ptrCommandBar,
														const EnvDTE::CommandPtr& ptrCommand,
														LONG lPos,
														bool bBeginGroupBefore = false);

				//HRESULT					DoVs2005Beta2CommandBitmapBodge(
				//										const EnvDTE::CommandPtr& ptrCommand,
				//										const Microsoft_VisualStudio_CommandBars::_CommandBarButtonPtr& ptrButton);


	
	//IDTCommandTarget implementation:
	public:
				HRESULT					QueryStatus(BSTR CmdName, EnvDTE::vsCommandStatusTextWanted NeededText, EnvDTE::vsCommandStatus *StatusOption, VARIANT *CommandText);
				HRESULT					Exec(BSTR CmdName, EnvDTE::vsCommandExecOption ExecuteOption, VARIANT *VariantIn, VARIANT *VariantOut, VARIANT_BOOL *Handled);

};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -