Esempio n. 1
0
VCommand* VCommandList::RetainCommand(const VString& inCommandID, bool inGlobalSearch) const
{
	VCommand*	com = _GetCommand(inCommandID, inGlobalSearch);
	if (com != NULL)
		com->Retain();
	else if (inGlobalSearch && fParent != NULL)
		com = fParent->RetainCommand(inCommandID, true);

	if (com == NULL)
		com = VCommand::RetainNullCommand();

	return com;
}
Esempio n. 2
0
STDMETHODIMP CExplorerCommandProvider::GetCommands(IUnknown* punkSite, REFIID riid, LPVOID* ppenumr)
{
   ATLTRACE(L"CExplorerCommandProvider::GetCommands\n");
   typedef CComEnum< IEnumExplorerCommand, &IID_IEnumExplorerCommand, IExplorerCommand*, _CopyInterface<IExplorerCommand> > CEnumCommands;
   HMENU hMenuPopup = ::GetSubMenu(m_hMenu, _T("CommandMenu"));
   CInterfaceArray<IExplorerCommand> aList;
   for( int i = 0; i < ::GetMenuItemCount(hMenuPopup); i++ ) {
      CComPtr<IExplorerCommand> spCommand;
      HR( _GetCommand(hMenuPopup, ::GetMenuItemID(hMenuPopup, i), IID_PPV_ARGS(&spCommand)) );
      aList.Add(spCommand);
   }
   CComObject<CEnumCommands>* pEnumResources;
   HR( CComObject<CEnumCommands>::CreateInstance(&pEnumResources) );
   HR( pEnumResources->Init(&aList.GetData()->p, &aList.GetData()->p + aList.GetCount(), NULL, AtlFlagCopy) );
   return pEnumResources->QueryInterface(riid, ppenumr);
}
Esempio n. 3
0
STDMETHODIMP CExplorerCommandProvider::GetCommand(REFGUID rguidCommandId, REFIID riid, LPVOID* ppRetVal)
{
   ATLTRACE(L"CExplorerCommandProvider::GetCommand\n");
   HMENU hMenuPopup = ::GetSubMenu(m_hMenu, _T("CommandMenu"));
   return _GetCommand(hMenuPopup, CExplorerCommand::GetMenuID(rguidCommandId), riid, ppRetVal);
}
Esempio n. 4
0
void VCommandList::RemoveCommand(const VString& inID)
{
	VCommand*	command = _GetCommand(inID, false);
	if (command != NULL)
		RemoveCommand(command);
}
Esempio n. 5
0
bool VCommandList::HasCommand(const VString& inID, bool inGlobalSearch) const
{
	VCommand*	command = _GetCommand(inID, inGlobalSearch);
	return (command != NULL);
}