ReactOS
0.4.16-dev-814-g656a5dc
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
CNewMenu.h
Go to the documentation of this file.
1
/*
2
* provides new shell item service
3
*
4
* Copyright 2007 Johannes Anderwald (johannes.anderwald@reactos.org)
5
* Copyright 2009 Andrew Hill
6
* Copyright 2012 Rafal Harabien
7
*
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2.1 of the License, or (at your option) any later version.
12
*
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
17
*
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21
*/
22
23
#ifndef _SHV_ITEM_NEW_H_
24
#define _SHV_ITEM_NEW_H_
25
26
const
WCHAR
ShellNewKey
[] =
L
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Discardable\\PostSetup\\ShellNew"
;
27
28
class
CNewMenu
:
29
public
CComCoClass<CNewMenu, &CLSID_NewMenu>,
30
public
CComObjectRootEx<CComMultiThreadModelNoCS>,
31
public
IObjectWithSite
,
32
public
IContextMenu3
,
33
public
IShellExtInit
34
{
35
private
:
36
enum
SHELLNEW_TYPE
37
{
38
SHELLNEW_TYPE_INVALID
= -1,
39
SHELLNEW_TYPE_COMMAND
= 1,
40
SHELLNEW_TYPE_DATA
= 2,
41
SHELLNEW_TYPE_FILENAME
= 4,
42
SHELLNEW_TYPE_NULLFILE
= 8
43
};
44
45
struct
SHELLNEW_ITEM
46
{
47
SHELLNEW_TYPE
Type
;
48
LPWSTR
pwszExt
;
49
PBYTE
pData
;
50
ULONG
cbData
;
51
LPWSTR
pwszDesc
;
52
HICON
hIcon
;
53
SHELLNEW_ITEM
*
pNext
;
54
};
55
56
LPITEMIDLIST
m_pidlFolder
;
57
SHELLNEW_ITEM
*
m_pItems
;
58
SHELLNEW_ITEM
*
m_pLinkItem
;
// Points to the link handler item in the m_pItems list.
59
CComPtr<IUnknown>
m_pSite
;
60
HMENU
m_hSubMenu
;
61
UINT
m_idCmdFirst
,
m_idCmdFolder
,
m_idCmdLink
;
62
BOOL
m_bCustomIconFolder
,
m_bCustomIconLink
;
63
HICON
m_hIconFolder
,
m_hIconLink
;
64
65
SHELLNEW_ITEM
*
LoadItem
(
LPCWSTR
pwszExt);
66
void
UnloadItem
(
SHELLNEW_ITEM
*pItem);
67
void
UnloadAllItems
();
68
BOOL
CacheItems
();
69
BOOL
LoadCachedItems
();
70
BOOL
LoadAllItems
();
71
UINT
InsertShellNewItems
(
HMENU
hMenu,
UINT
idFirst,
UINT
idMenu);
72
SHELLNEW_ITEM
*
FindItemFromIdOffset
(
UINT
IdOffset);
73
HRESULT
CreateNewFolder
(
LPCMINVOKECOMMANDINFO
lpici);
74
HRESULT
CreateNewItem
(
SHELLNEW_ITEM
*pItem,
LPCMINVOKECOMMANDINFO
lpcmi);
75
HRESULT
SelectNewItem
(
LONG
wEventId,
UINT
uFlags
,
LPWSTR
pszName,
BOOL
bRename);
76
HRESULT
NewItemByCommand
(
SHELLNEW_ITEM
*pItem,
LPCWSTR
wszPath);
77
HRESULT
NewItemByNonCommand
(
SHELLNEW_ITEM
*pItem,
LPWSTR
wszName,
78
DWORD
cchNameMax,
LPCWSTR
wszPath);
79
80
public
:
81
CNewMenu
();
82
~CNewMenu
();
83
84
// IObjectWithSite
85
STDMETHOD
(
SetSite
)(
IUnknown
*pUnkSite)
override
;
86
STDMETHOD
(
GetSite
)(
REFIID
riid
,
void
**ppvSite)
override
;
87
88
// IContextMenu
89
STDMETHOD
(
QueryContextMenu
)(
HMENU
hMenu,
UINT
indexMenu,
UINT
idCmdFirst,
UINT
idCmdLast,
UINT
uFlags
)
override
;
90
STDMETHOD
(
InvokeCommand
)(
LPCMINVOKECOMMANDINFO
lpcmi)
override
;
91
STDMETHOD
(
GetCommandString
)(
UINT_PTR
idCommand,
UINT
uFlags
,
UINT
*
lpReserved
,
LPSTR
lpszName,
UINT
uMaxNameLen)
override
;
92
93
// IContextMenu3
94
STDMETHOD
(
HandleMenuMsg2
)(
UINT
uMsg,
WPARAM
wParam
,
LPARAM
lParam
,
LRESULT
*plResult)
override
;
95
96
// IContextMenu2
97
STDMETHOD
(
HandleMenuMsg
)(
UINT
uMsg,
WPARAM
wParam
,
LPARAM
lParam
)
override
;
98
99
// IShellExtInit
100
STDMETHOD
(
Initialize
)(
PCIDLIST_ABSOLUTE
pidlFolder,
IDataObject
*pdtobj,
HKEY
hkeyProgID)
override
;
101
102
DECLARE_REGISTRY_RESOURCEID
(
IDR_NEWMENU
)
103
DECLARE_NOT_AGGREGATABLE
(
CNewMenu
)
104
105
DECLARE_PROTECT_FINAL_CONSTRUCT
()
106
107
BEGIN_COM_MAP
(
CNewMenu
)
108
COM_INTERFACE_ENTRY_IID
(
IID_IObjectWithSite
,
IObjectWithSite
)
109
COM_INTERFACE_ENTRY_IID
(IID_IContextMenu3,
IContextMenu3
)
110
COM_INTERFACE_ENTRY_IID
(IID_IContextMenu2,
IContextMenu2
)
111
COM_INTERFACE_ENTRY_IID
(IID_IContextMenu,
IContextMenu
)
112
COM_INTERFACE_ENTRY_IID
(IID_IShellExtInit,
IShellExtInit
)
113
END_COM_MAP
()
114
};
115
116
#endif
/* _SHV_ITEM_NEW_H_ */
ShellNewKey
const WCHAR ShellNewKey[]
Definition:
CNewMenu.h:26
lpReserved
static DWORD const LPVOID const lpReserved
Definition:
appcrt_dllmain.cpp:58
STDMETHOD
#define STDMETHOD(m)
Definition:
basetyps.h:62
CNewMenu
Definition:
CNewMenu.h:34
CNewMenu::SelectNewItem
HRESULT SelectNewItem(LONG wEventId, UINT uFlags, LPWSTR pszName, BOOL bRename)
Definition:
CNewMenu.cpp:413
CNewMenu::GetSite
STDMETHOD() GetSite(REFIID riid, void **ppvSite) override
Definition:
CNewMenu.cpp:623
CNewMenu::QueryContextMenu
STDMETHOD() QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override
Definition:
CNewMenu.cpp:630
CNewMenu::SetSite
STDMETHOD() SetSite(IUnknown *pUnkSite) override
Definition:
CNewMenu.cpp:617
CNewMenu::InsertShellNewItems
UINT InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu)
Definition:
CNewMenu.cpp:323
CNewMenu::GetCommandString
STDMETHOD() GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen) override
Definition:
CNewMenu.cpp:691
CNewMenu::m_hIconFolder
HICON m_hIconFolder
Definition:
CNewMenu.h:63
CNewMenu::NewItemByNonCommand
HRESULT NewItemByNonCommand(SHELLNEW_ITEM *pItem, LPWSTR wszName, DWORD cchNameMax, LPCWSTR wszPath)
Definition:
CNewMenu.cpp:524
CNewMenu::CNewMenu
CNewMenu()
Definition:
CNewMenu.cpp:28
CNewMenu::SHELLNEW_TYPE
SHELLNEW_TYPE
Definition:
CNewMenu.h:37
CNewMenu::SHELLNEW_TYPE_COMMAND
@ SHELLNEW_TYPE_COMMAND
Definition:
CNewMenu.h:39
CNewMenu::SHELLNEW_TYPE_FILENAME
@ SHELLNEW_TYPE_FILENAME
Definition:
CNewMenu.h:41
CNewMenu::SHELLNEW_TYPE_DATA
@ SHELLNEW_TYPE_DATA
Definition:
CNewMenu.h:40
CNewMenu::SHELLNEW_TYPE_NULLFILE
@ SHELLNEW_TYPE_NULLFILE
Definition:
CNewMenu.h:42
CNewMenu::SHELLNEW_TYPE_INVALID
@ SHELLNEW_TYPE_INVALID
Definition:
CNewMenu.h:38
CNewMenu::m_bCustomIconLink
BOOL m_bCustomIconLink
Definition:
CNewMenu.h:62
CNewMenu::m_idCmdLink
UINT m_idCmdLink
Definition:
CNewMenu.h:61
CNewMenu::m_pidlFolder
LPITEMIDLIST m_pidlFolder
Definition:
CNewMenu.h:56
CNewMenu::LoadCachedItems
BOOL LoadCachedItems()
Definition:
CNewMenu.cpp:248
CNewMenu::UnloadItem
void UnloadItem(SHELLNEW_ITEM *pItem)
Definition:
CNewMenu.cpp:55
CNewMenu::LoadAllItems
BOOL LoadAllItems()
Definition:
CNewMenu.cpp:306
CNewMenu::m_pLinkItem
SHELLNEW_ITEM * m_pLinkItem
Definition:
CNewMenu.h:58
CNewMenu::m_bCustomIconFolder
BOOL m_bCustomIconFolder
Definition:
CNewMenu.h:62
CNewMenu::m_hIconLink
HICON m_hIconLink
Definition:
CNewMenu.h:63
CNewMenu::CreateNewItem
HRESULT CreateNewItem(SHELLNEW_ITEM *pItem, LPCMINVOKECOMMANDINFO lpcmi)
Definition:
CNewMenu.cpp:580
CNewMenu::HandleMenuMsg
STDMETHOD() HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam) override
Definition:
CNewMenu.cpp:705
CNewMenu::m_hSubMenu
HMENU m_hSubMenu
Definition:
CNewMenu.h:60
CNewMenu::UnloadAllItems
void UnloadAllItems()
Definition:
CNewMenu.cpp:68
CNewMenu::HandleMenuMsg2
STDMETHOD() HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult) override
Definition:
CNewMenu.cpp:712
CNewMenu::LoadItem
SHELLNEW_ITEM * LoadItem(LPCWSTR pwszExt)
Definition:
CNewMenu.cpp:83
CNewMenu::m_pItems
SHELLNEW_ITEM * m_pItems
Definition:
CNewMenu.h:57
CNewMenu::~CNewMenu
~CNewMenu()
Definition:
CNewMenu.cpp:43
CNewMenu::m_idCmdFirst
UINT m_idCmdFirst
Definition:
CNewMenu.h:61
CNewMenu::m_idCmdFolder
UINT m_idCmdFolder
Definition:
CNewMenu.h:61
CNewMenu::InvokeCommand
STDMETHOD() InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) override
Definition:
CNewMenu.cpp:670
CNewMenu::NewItemByCommand
HRESULT NewItemByCommand(SHELLNEW_ITEM *pItem, LPCWSTR wszPath)
Definition:
CNewMenu.cpp:481
CNewMenu::CreateNewFolder
HRESULT CreateNewFolder(LPCMINVOKECOMMANDINFO lpici)
Definition:
CNewMenu.cpp:452
CNewMenu::FindItemFromIdOffset
SHELLNEW_ITEM * FindItemFromIdOffset(UINT IdOffset)
Definition:
CNewMenu.cpp:391
CNewMenu::CacheItems
BOOL CacheItems()
Definition:
CNewMenu.cpp:176
CNewMenu::m_pSite
CComPtr< IUnknown > m_pSite
Definition:
CNewMenu.h:59
wParam
WPARAM wParam
Definition:
combotst.c:138
lParam
LPARAM lParam
Definition:
combotst.c:139
uFlags
UINT uFlags
Definition:
api.c:59
BOOL
unsigned int BOOL
Definition:
ntddk_ex.h:94
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
riid
REFIID riid
Definition:
atlbase.h:39
HRESULT
Definition:
mshtmhst.idl:286
IContextMenu2
Definition:
shobjidl.idl:1773
IContextMenu3
Definition:
shobjidl.idl:1793
IContextMenu
Definition:
shobjidl.idl:1647
IDataObject
Definition:
objidl.idl:1530
IObjectWithSite
Definition:
ocidl.idl:1153
IShellExtInit
Definition:
shobjidl.idl:1291
IUnknown
Definition:
unknwn.idl:39
void
Definition:
nsiface.idl:2307
BEGIN_COM_MAP
#define BEGIN_COM_MAP(x)
Definition:
atlcom.h:581
COM_INTERFACE_ENTRY_IID
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition:
atlcom.h:601
DECLARE_PROTECT_FINAL_CONSTRUCT
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition:
atlcom.h:679
DECLARE_NOT_AGGREGATABLE
#define DECLARE_NOT_AGGREGATABLE(x)
Definition:
atlcom.h:651
DECLARE_REGISTRY_RESOURCEID
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition:
atlcom.h:645
END_COM_MAP
#define END_COM_MAP()
Definition:
atlcom.h:592
HICON
static HICON
Definition:
imagelist.c:80
IID_IObjectWithSite
const IID IID_IObjectWithSite
HMENU
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition:
ordinal.c:63
UINT_PTR
unsigned __int3264 UINT_PTR
Definition:
mstsclib_h.h:274
UINT
unsigned int UINT
Definition:
ndis.h:50
L
#define L(x)
Definition:
ntvdm.h:50
PBYTE
BYTE * PBYTE
Definition:
pedump.c:66
LONG
long LONG
Definition:
pedump.c:60
REFIID
#define REFIID
Definition:
guiddef.h:118
IDR_NEWMENU
#define IDR_NEWMENU
Definition:
shresdef.h:898
LPITEMIDLIST
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition:
shtypes.idl:41
CNewMenu::SHELLNEW_ITEM
Definition:
CNewMenu.h:46
CNewMenu::SHELLNEW_ITEM::pwszExt
LPWSTR pwszExt
Definition:
CNewMenu.h:48
CNewMenu::SHELLNEW_ITEM::cbData
ULONG cbData
Definition:
CNewMenu.h:50
CNewMenu::SHELLNEW_ITEM::pwszDesc
LPWSTR pwszDesc
Definition:
CNewMenu.h:51
CNewMenu::SHELLNEW_ITEM::pData
PBYTE pData
Definition:
CNewMenu.h:49
CNewMenu::SHELLNEW_ITEM::pNext
SHELLNEW_ITEM * pNext
Definition:
CNewMenu.h:53
CNewMenu::SHELLNEW_ITEM::hIcon
HICON hIcon
Definition:
CNewMenu.h:52
CNewMenu::SHELLNEW_ITEM::Type
SHELLNEW_TYPE Type
Definition:
CNewMenu.h:47
IContextMenu::tagCMINVOKECOMMANDINFO
Definition:
shobjidl.idl:1714
_ITEMIDLIST_ABSOLUTE
Definition:
shtypes.idl:46
ULONG
uint32_t ULONG
Definition:
typedefs.h:59
LPARAM
LONG_PTR LPARAM
Definition:
windef.h:208
LRESULT
LONG_PTR LRESULT
Definition:
windef.h:209
WPARAM
UINT_PTR WPARAM
Definition:
windef.h:207
Initialize
static void Initialize()
Definition:
xlate.c:212
LPSTR
char * LPSTR
Definition:
xmlstorage.h:182
WCHAR
__wchar_t WCHAR
Definition:
xmlstorage.h:180
LPWSTR
WCHAR * LPWSTR
Definition:
xmlstorage.h:184
LPCWSTR
const WCHAR * LPCWSTR
Definition:
xmlstorage.h:185
dll
win32
shell32
CNewMenu.h
Generated on Thu Mar 13 2025 06:04:58 for ReactOS by
1.9.6