summaryrefslogtreecommitdiff
path: root/IconOverlayIdentifier.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'IconOverlayIdentifier.cpp')
-rw-r--r--IconOverlayIdentifier.cpp60
1 files changed, 60 insertions, 0 deletions
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: <nielsen@memberwebs.com>
+//
+
+// 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;
+}