// // AUTHOR // Stef Walter // // 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; }