|
//
// (C) Copyright by Victor Derks <vba64@xs4all.nl>
//
// See README.TXT for the details of the software licence.
//
#include "stdafx.h"
#include "../include/infotipimpl.h"
#include "../include/strutil.h"
#include "infotipclsid.h"
#include "shellfolderclsid.h"
#include "vvvfile.h"
#include "resource.h"
class ATL_NO_VTABLE CInfoTip :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CInfoTip, &__uuidof(CInfoTip)>,
public IInfoTipImpl<CInfoTip>
{
public:
BEGIN_COM_MAP(CInfoTip)
COM_INTERFACE_ENTRY(IPersistFile)
COM_INTERFACE_ENTRY(IQueryInfo)
END_COM_MAP()
DECLARE_PROTECT_FINAL_CONSTRUCT()
static HRESULT WINAPI UpdateRegistry(BOOL bRegister) throw()
{
return IInfoTipImpl<CInfoTip>::UpdateRegistry(IDR_INFOTIP, bRegister,
L"Sample ShellExtension InfoTip", __uuidof(CShellFolder), wszVVVExtension);
}
// Purpose: called by the shell/MSF when it needs the text for the infotip.
// The string is used for the tooltip and the text in the statusbar.
CString CreateInfoTipText(const TCHAR* szFilename)
{
CVVVFile vvvfile(szFilename);
CString strTip = LoadString(IDS_SHELLEXT_LABEL) + _T(": ") + vvvfile.GetLabel() + _T("\n");
strTip += LoadString(IDS_SHELLEXT_FILECOUNT) + _T(": ") +
MSF::ToString(vvvfile.GetFileCount());
return strTip;
}
};
OBJECT_ENTRY_AUTO(__uuidof(CInfoTip), CInfoTip)
|
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.
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
Victor lives in Nijmegen, the oldest city in The Netherlands.
He studied Applied Physics in Delft and works Hitachi High-Tech Analytical Science.