From 9d08acf67479608735955314015d92ca708a88d2 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 17 Sep 2003 19:39:13 +0000 Subject: Initial Import --- IconOverlayIdentifier.cpp | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 IconOverlayIdentifier.cpp (limited to 'IconOverlayIdentifier.cpp') diff --git a/IconOverlayIdentifier.cpp b/IconOverlayIdentifier.cpp new file mode 100644 index 0000000..fe78492 --- /dev/null +++ b/IconOverlayIdentifier.cpp @@ -0,0 +1,60 @@ +// +// AUTHOR +// S. Nielsen +// +// VERSION +// 0.8 +// +// LICENSE +// This software is in the public domain. +// +// The software is provided "as is", without warranty of any kind, +// express or implied, including but not limited to the warranties +// of merchantability, fitness for a particular purpose, and +// noninfringement. In no event shall the author(s) be liable for any +// claim, damages, or other liability, whether in an action of +// contract, tort, or otherwise, arising from, out of, or in connection +// with the software or the use or other dealings in the software. +// +// SUPPORT +// Send bug reports to: +// + +// IconOverlayIdentifier.cpp : Implementation of CIconOverlayIdentifier + +#include "stdafx.h" +#include "IconOverlayIdentifier.h" + +const CLSID CLSID_IconOverlayIdentifier = { 0x42DFB913,0x6291,0x42C6,{0xB3,0x12,0x90,0x1B,0xA1,0x97,0x3D,0x00} }; + + +///////////////////////////////////////////////////////////////////////////// +// CIconOverlayIdentifier + +STDMETHODIMP CIconOverlayIdentifier::GetOverlayInfo(LPWSTR pwszIconFile, int cchMax, int *pIndex, DWORD *pdwFlags) +{ + // Tell the shell which icon to use + GetModuleFileNameW(_Module.GetModuleInstance(), pwszIconFile, cchMax); + *pIndex = 0; + *pdwFlags = ISIOI_ICONINDEX | ISIOI_ICONFILE; + + return S_OK; +} + +STDMETHODIMP CIconOverlayIdentifier::GetPriority(int* pPriority) +{ + // We go for top priority + *pPriority = 0; + return S_OK; +} + +STDMETHODIMP CIconOverlayIdentifier::IsMemberOf(LPCWSTR pwszPath, DWORD dwAttrib) +{ + // See if the file given is encrypted + DWORD status = 0; + FileEncryptionStatusW(pwszPath, &status); + + ATLTRACE(L"%s%s\n", pwszPath, status == FILE_IS_ENCRYPTED ? L" - encrypted" : L""); + + return status == FILE_IS_ENCRYPTED ? S_OK : S_FALSE; +} -- cgit v1.2.3