ReactOS  0.4.14-dev-293-g2b39b42
shell32_main.h
Go to the documentation of this file.
1 /*
2  * internal Shell32 Library definitions
3  *
4  * Copyright 1998 Marcus Meissner
5  * Copyright 1998 Juergen Schmied (jsch) * <juergen.schmied@metronet.de>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21 
22 #ifndef __WINE_SHELL_MAIN_H
23 #define __WINE_SHELL_MAIN_H
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
30 
31 /*******************************************
32 * global SHELL32.DLL variables
33 */
36 
37 BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
38 
39 /* Iconcache */
40 #define INVALID_INDEX -1
41 BOOL SIC_Initialize(void);
42 void SIC_Destroy(void) DECLSPEC_HIDDEN;
44 INT SIC_GetIconIndex (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags ) DECLSPEC_HIDDEN;
45 
46 /* Classes Root */
47 BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot) DECLSPEC_HIDDEN;
48 BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len ) DECLSPEC_HIDDEN;
49 BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len ) DECLSPEC_HIDDEN;
50 BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx);
52 
53 /* ANSI versions of above functions, supposed to go away as soon as they are not used anymore */
54 BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot) DECLSPEC_HIDDEN;
55 BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR sName, DWORD len, int* picon_idx);
57 
59 
62 
63 /****************************************************************************
64  * Class constructors
65  */
66 HRESULT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST pMyPidl, PCUITEMID_CHILD_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject);
67 HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **enumerator);
68 
69 LPCLASSFACTORY IClassFactory_Constructor(REFCLSID);
70 IContextMenu2 * ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *aPidls, UINT uItemCount);
72 IContextMenu2 * ISvStaticItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *apidl, UINT cidl, HKEY hKey);
73 IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent, BOOL bDesktop);
76 
80 HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) DECLSPEC_HIDDEN;
81 HRESULT WINAPI CPanel_ExtractIconW(LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) DECLSPEC_HIDDEN;
82 
83 HRESULT CRegFolder_CreateInstance(const GUID *pGuid, LPCITEMIDLIST pidlRoot, LPCWSTR lpszPath, LPCWSTR lpszEnumKeyName, REFIID riid, void **ppv);
84 
85 /* initialisation for FORMATETC */
86 #define InitFormatEtc(fe, cf, med) \
87  {\
88  (fe).cfFormat=cf;\
89  (fe).dwAspect=DVASPECT_CONTENT;\
90  (fe).ptd=NULL;\
91  (fe).tymed=med;\
92  (fe).lindex=-1;\
93  };
94 
95 #define KeyStateToDropEffect(kst)\
96  ((((kst)&(MK_CONTROL|MK_SHIFT))==(MK_CONTROL|MK_SHIFT)) ? DROPEFFECT_LINK :\
97  (((kst)&(MK_CONTROL)) ? DROPEFFECT_COPY :\
98  (((kst)&(MK_SHIFT)) ? DROPEFFECT_MOVE :\
99  DROPEFFECT_NONE)))
100 
101 
106 
107 /* Change Notification */
110 
111 /* file operation */
112 #define ASK_DELETE_FILE 1
113 #define ASK_DELETE_FOLDER 2
114 #define ASK_DELETE_MULTIPLE_ITEM 3
115 #define ASK_CREATE_FOLDER 4
116 #define ASK_OVERWRITE_FILE 5
117 #define ASK_DELETE_SELECTED 6
118 #define ASK_TRASH_FILE 7
119 #define ASK_TRASH_FOLDER 8
120 #define ASK_TRASH_MULTIPLE_ITEM 9
121 #define ASK_CANT_TRASH_ITEM 10
122 #define ASK_OVERWRITE_FOLDER 11
123 
124 BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pwszDir, BOOL bShowUI);
125 BOOL SHELL_ConfirmYesNoW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir);
126 
127 void WINAPI _InsertMenuItemW (HMENU hmenu, UINT indexMenu, BOOL fByPosition,
128  UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState);
129 
130 static __inline BOOL SHELL_OsIsUnicode(void)
131 {
132  /* if high-bit of version is 0, we are emulating NT */
133  return !(GetVersion() & 0x80000000);
134 }
135 
136 #define __SHFreeAndNil(ptr) \
137  {\
138  SHFree(*ptr); \
139  *ptr = NULL; \
140  };
141 static __inline void __SHCloneStrA(char **target, const char *source)
142 {
143  *target = (char *)SHAlloc(strlen(source) + 1);
144  strcpy(*target, source);
145 }
146 
147 static __inline void __SHCloneStrWtoA(char **target, const WCHAR *source)
148 {
149  int len = WideCharToMultiByte(CP_ACP, 0, source, -1, NULL, 0, NULL, NULL);
150  *target = (char *)SHAlloc(len);
152 }
153 
154 static __inline void __SHCloneStrW(WCHAR **target, const WCHAR *source)
155 {
156  *target = (WCHAR *)SHAlloc((lstrlenW(source) + 1) * sizeof(WCHAR) );
158 }
159 
160 static __inline LPWSTR __SHCloneStrAtoW(WCHAR **target, const char *source)
161 {
162  int len = MultiByteToWideChar(CP_ACP, 0, source, -1, NULL, 0);
163  *target = (WCHAR *)SHAlloc(len * sizeof(WCHAR));
165  return *target;
166 }
167 
168 /* handle conversions */
169 #define HICON_16(h32) (LOWORD(h32))
170 #define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
171 #define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
172 #define HINSTANCE_16(h32) (LOWORD(h32))
173 
175 
179 
180 /* Default shell folder value registration */
182 
183 /* Detect Shell Links */
185 
188 HPROPSHEETPAGE SH_CreatePropertySheetPage(WORD wDialogId, DLGPROC pfnDlgProc, LPARAM lParam, LPCWSTR pwszTitle);
193 
196 
197 #ifdef __cplusplus
198 } /* extern "C" */
199 #endif
200 
201 #endif /* __WINE_SHELL_MAIN_H */
void FreeChangeNotifications(void) DECLSPEC_HIDDEN
Definition: changenotify.c:190
HRESULT WINAPI DoUnregisterServer(void)
BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR sName, DWORD len, int *picon_idx)
Definition: classes.c:320
const GUID CLSID_UnixDosFolder
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HRESULT WINAPI DoRegisterServer(void)
static __inline void __SHCloneStrA(char **target, const char *source)
Definition: shell32_main.h:141
static HICON
Definition: imagelist.c:84
#define REFIID
Definition: guiddef.h:118
const GUID CLSID_UnixFolder
HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) DECLSPEC_HIDDEN
IContextMenu2 * ISvStaticItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *apidl, UINT cidl, HKEY hKey)
#define WideCharToMultiByte
Definition: compat.h:101
static HMENU hmenu
Definition: win.c:66
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len) DECLSPEC_HIDDEN
Definition: shellord.c:79
IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent, BOOL bDesktop)
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
interface IBindCtx * LPBC
Definition: objfwd.h:18
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
REFIID riid
Definition: precomp.h:44
HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
Definition: clipboard.c:54
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
Definition: iconcache.cpp:706
#define REFCLSID
Definition: guiddef.h:117
#define CP_ACP
Definition: compat.h:99
BOOL PidlToSicIndex(IShellFolder *sh, LPCITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, int *pIndex) DECLSPEC_HIDDEN
Definition: iconcache.cpp:732
void SIC_Destroy(void) DECLSPEC_HIDDEN
Definition: iconcache.cpp:632
HRESULT WINAPI CPanel_ExtractIconW(LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) DECLSPEC_HIDDEN
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:294
#define CALLBACK
Definition: compat.h:27
HWND hWnd
Definition: settings.c:17
REFIID LPVOID * ppv
Definition: atlbase.h:39
BOOL SIC_Initialize(void)
Definition: iconcache.cpp:484
WCHAR swShell32Name[MAX_PATH]
Definition: folders.cpp:22
LPCLASSFACTORY IClassFactory_Constructor(REFCLSID)
UINT_PTR WPARAM
Definition: windef.h:207
BOOL HCR_GetExecuteCommandW(HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len) DECLSPEC_HIDDEN
Definition: classes.c:200
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
UINT uFlags
Definition: api.c:59
int32_t INT_PTR
Definition: typedefs.h:62
char * LPSTR
Definition: xmlstorage.h:182
#define lstrlenW
Definition: compat.h:407
int32_t INT
Definition: typedefs.h:56
WPARAM wParam
Definition: combotst.c:138
DWORD dwAttributes
Definition: vdmdbg.h:34
DWORD WINAPI GetVersion(VOID)
Definition: version.c:22
static __inline void __SHCloneStrW(WCHAR **target, const WCHAR *source)
Definition: shell32_main.h:154
HRESULT SH_ShowDriveProperties(WCHAR *drive, LPCITEMIDLIST pidlFolder, PCUITEMID_CHILD_ARRAY apidl)
Definition: drive.cpp:118
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV)
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
HRESULT WINAPI INewItem_Constructor(IUnknown *pUnkOuter, REFIID riif, LPVOID *ppv)
smooth NULL
Definition: ftsmooth.c:416
HPROPSHEETPAGE SH_CreatePropertySheetPage(WORD wDialogId, DLGPROC pfnDlgProc, LPARAM lParam, LPCWSTR pwszTitle)
Definition: filedefext.cpp:248
HRESULT CRegFolder_CreateInstance(const GUID *pGuid, LPCITEMIDLIST pidlRoot, LPCWSTR lpszPath, LPCWSTR lpszEnumKeyName, REFIID riid, void **ppv)
Definition: CRegFolder.cpp:778
LONG_PTR LPARAM
Definition: windef.h:208
static HMODULE huser32
Definition: profile.c:34
BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD dwAttributes) DECLSPEC_HIDDEN
Definition: classes.c:516
const char * LPCSTR
Definition: xmlstorage.h:183
HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **enumerator)
HRESULT WINAPI IShellLink_ConstructFromFile(IShellFolder *psf, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv)
HGLOBAL RenderFILENAMEA(LPITEMIDLIST pidlRoot, LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
Definition: clipboard.c:188
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
#define WINAPI
Definition: msvc.h:8
BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot) DECLSPEC_HIDDEN
Definition: classes.c:46
unsigned short WORD
Definition: ntddk_ex.h:93
HRESULT WINAPI CDefViewDual_Constructor(REFIID riid, LPVOID *ppvOut)
unsigned long DWORD
Definition: ntddk_ex.h:95
INT SIC_GetIconIndex(LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags) DECLSPEC_HIDDEN
Definition: iconcache.cpp:443
static __inline void __SHCloneStrWtoA(char **target, const WCHAR *source)
Definition: shell32_main.h:147
HGLOBAL RenderFILENAMEW(LPITEMIDLIST pidlRoot, LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
Definition: clipboard.c:220
HRESULT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST pMyPidl, PCUITEMID_CHILD_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject)
DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len) DECLSPEC_HIDDEN
Definition: shellord.c:113
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67
BOOL HCR_GetDefaultVerbW(HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len) DECLSPEC_HIDDEN
Definition: classes.c:134
BOOL SHELL_ConfirmYesNoW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir)
Definition: shlfileop.cpp:336
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len) DECLSPEC_HIDDEN
Definition: classes.c:346
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot) DECLSPEC_HIDDEN
Definition: classes.c:88
BOOL SH_ShowRecycleBinProperties(WCHAR sDrive)
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2870
BOOL SHELL_IsShortcut(LPCITEMIDLIST) DECLSPEC_HIDDEN
Definition: shell32_main.c:378
short sh
Definition: format.c:272
static __inline LPWSTR __SHCloneStrAtoW(WCHAR **target, const char *source)
Definition: shell32_main.h:160
_Out_ PULONG _Out_ PULONG pIndex
Definition: ndis.h:4564
#define lstrcpyW
Definition: compat.h:406
BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len) DECLSPEC_HIDDEN
Definition: classes.c:423
Definition: services.c:325
GLenum GLenum dst
Definition: glext.h:6340
BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pwszDir, BOOL bShowUI)
unsigned int UINT
Definition: ndis.h:50
HRESULT WINAPI CShellDispatch_Constructor(REFIID riid, LPVOID *ppvOut)
BOOL SH_ShowPropertiesDialog(LPCWSTR pwszPath, LPCITEMIDLIST pidlFolder, PCUITEMID_CHILD_ARRAY apidl)
Definition: fprop.cpp:94
#define MultiByteToWideChar
Definition: compat.h:100
static const WCHAR szName[]
Definition: msipriv.h:1194
uint32_t * LPDWORD
Definition: typedefs.h:57
INT_PTR CALLBACK SH_FileGeneralDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
GLenum target
Definition: glext.h:7315
LPWSTR SH_FormatFileSizeWithBytes(PULARGE_INTEGER lpQwSize, LPWSTR pszBuf, UINT cchBuf)
Definition: filedefext.cpp:212
HGLOBAL RenderSHELLIDLIST(LPITEMIDLIST pidlRoot, LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
Definition: clipboard.c:146
BOOL UNIXFS_is_rooted_at_desktop(void) DECLSPEC_HIDDEN
WCHAR * LPWSTR
Definition: xmlstorage.h:184
IContextMenu2 * ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *aPidls, UINT uItemCount)
INT_PTR CALLBACK SH_FileVersionDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
HRESULT WINAPI IShellLink_ConstructFromPath(WCHAR *path, REFIID riid, LPVOID *ppv)
LPARAM lParam
Definition: combotst.c:139
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309
void InitChangeNotifications(void) DECLSPEC_HIDDEN
Definition: changenotify.c:183
HMODULE huser32 DECLSPEC_HIDDEN
Definition: shell32_main.h:35
HRESULT SHELL_RegisterShellFolders(void) DECLSPEC_HIDDEN
Definition: shellpath.c:2538