-
Notifications
You must be signed in to change notification settings - Fork 194
/
CHashCheck.hpp
57 lines (46 loc) · 1.89 KB
/
CHashCheck.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* HashCheck Shell Extension
* Copyright (C) Kai Liu. All rights reserved.
*
* Please refer to readme.txt for information about this source code.
* Please refer to license.txt for details about distribution and modification.
**/
#ifndef __CHASHCHECK_HPP__
#define __CHASHCHECK_HPP__
#include "globals.h"
class CHashCheck : public IShellExtInit, IContextMenu, IShellPropSheetExt, IDropTarget
{
protected:
CREF m_cRef;
HSIMPLELIST m_hList;
HBITMAP m_hMenuBitmap;
public:
CHashCheck( );
~CHashCheck() { InterlockedDecrement(&g_cRefThisDll); SLRelease(m_hList); if (m_hMenuBitmap) DeleteObject(m_hMenuBitmap); }
// IUnknown members
STDMETHODIMP QueryInterface( REFIID, LPVOID * );
STDMETHODIMP_(ULONG) AddRef( ) { return(InterlockedIncrement(&m_cRef)); }
STDMETHODIMP_(ULONG) Release( )
{
// We need a non-volatile variable, hence the cRef variable
LONG cRef = InterlockedDecrement(&m_cRef);
if (cRef == 0) delete this;
return(cRef);
}
// IShellExtInit members
STDMETHODIMP Initialize( LPCITEMIDLIST, LPDATAOBJECT, HKEY );
// IContextMenu members
STDMETHODIMP QueryContextMenu( HMENU, UINT, UINT, UINT, UINT );
STDMETHODIMP InvokeCommand( LPCMINVOKECOMMANDINFO );
STDMETHODIMP GetCommandString( UINT_PTR, UINT, UINT *, LPSTR, UINT );
// IShellPropSheetExt members
STDMETHODIMP AddPages( LPFNADDPROPSHEETPAGE, LPARAM );
STDMETHODIMP ReplacePage( UINT, LPFNADDPROPSHEETPAGE, LPARAM ) { return(E_NOTIMPL); }
// IDropTarget members
STDMETHODIMP DragEnter( LPDATAOBJECT, DWORD, POINTL, PDWORD ) { return(E_NOTIMPL); }
STDMETHODIMP DragOver( DWORD, POINTL, PDWORD ) { return(E_NOTIMPL); }
STDMETHODIMP DragLeave( ) { return(E_NOTIMPL); }
STDMETHODIMP Drop( LPDATAOBJECT, DWORD, POINTL, PDWORD );
};
typedef CHashCheck *LPCHASHCHECK;
#endif