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

IE Drop-Down Button

Rate me:
Please Sign up or sign in to vote.
1.85/5 (8 votes)
8 Nov 20073 min read 36.9K   304   16  
similar skype IE toolbar button, with drop-down arraw, support IE6 & IE7(multi-tab)
// ArrowButton.cpp : Implementation of CArrowButton

#include "stdafx.h"
#include "ArrowButton.h"


// CArrowButton

STDMETHODIMP CArrowButton::QueryStatus(const GUID* pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT* pCmdText)
{
	if (cCmds == 0) 
	{
		return E_INVALIDARG;
	}

	if (prgCmds == 0)
	{
		return E_POINTER;
	}

	prgCmds[0].cmdf = OLECMDF_ENABLED;

	return S_OK;
}

STDMETHODIMP CArrowButton::SetSite(IUnknown *pUnkSite)
{
	if (!pUnkSite)
	{
		ATLTRACE(_T("SetSite(): pUnkSite is NULL\n"));
	}
	else
	{
		HRESULT hRes = S_OK;
		CComPtr<IServiceProvider> spSP;
		hRes = pUnkSite->QueryInterface(&spSP);

		if(SUCCEEDED(hRes) && spSP)
		{
			hRes = spSP->QueryService(IID_IWebBrowserApp, &m_pWebBrowser2); 
		}
	}
	return S_OK;
}


STDMETHODIMP CArrowButton::Exec(const GUID*, DWORD nCmdID, DWORD, VARIANTARG*, VARIANTARG*)
{
	MessageBox(NULL, L"Miss Inject", L"Error", MB_OK);
	return S_OK;
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions