forked from coddec/Classic-Shell
- Notifications
You must be signed in to change notification settings - Fork 452
/
Copy pathStartMenuExt.h
65 lines (48 loc) · 1.49 KB
/
StartMenuExt.h
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
58
59
60
61
62
63
64
65
// StartMenuExt.h : Declaration of the CStartMenuExt
#pragma once
#include"resource.h"// main symbols
#include"StartMenuHelper_h.h"
#include<shlobj.h>
// CStartMenuExt
classATL_NO_VTABLE CStartMenuExt :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CStartMenuExt, &CLSID_StartMenuExt>,
public IShellExtInit,
public IContextMenu
{
public:
CStartMenuExt()
{
m_PinFolder1[0]=m_PinFolder2[0]=m_FileName[0]=0;
m_bInPinFolder1=m_bInPinFolder2=false;
}
static HRESULT WINAPI UpdateRegistry( BOOL bRegister );
DECLARE_NOT_AGGREGATABLE(CStartMenuExt)
BEGIN_COM_MAP(CStartMenuExt)
COM_INTERFACE_ENTRY(IShellExtInit)
COM_INTERFACE_ENTRY(IContextMenu)
END_COM_MAP()
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
m_FilePidl=NULL;
return S_OK;
}
voidFinalRelease()
{
if (m_FilePidl) ILFree(m_FilePidl);
m_FilePidl=NULL;
}
// from IShellExtInit
STDMETHODIMP Initialize( PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pData, HKEY hkey );
// from IContextMenu
STDMETHODIMP QueryContextMenu(HMENU, UINT, UINT, UINT, UINT);
STDMETHODIMP InvokeCommand( CMINVOKECOMMANDINFO *pInfo );
STDMETHODIMP GetCommandString( UINT_PTR idCmd, UINT uFlags, UINT* pwReserved, LPSTR pszName, UINT cchMax );
wchar_t m_PinFolder1[_MAX_PATH]; // ending with \
wchar_t m_PinFolder2[_MAX_PATH]; // ending with \
wchar_t m_FileName[_MAX_PATH];
LPITEMIDLIST m_FilePidl;
bool m_bInPinFolder1, m_bInPinFolder2;
};
OBJECT_ENTRY_AUTO(__uuidof(StartMenuExt), CStartMenuExt)