2 * internal Shell32 Library definitions
4 * Copyright 1998 Marcus Meissner
5 * Copyright 1998 Juergen Schmied (jsch) * <juergen.schmied@metronet.de>
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.
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.
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
22 #ifndef __WINE_SHELL_MAIN_H
23 #define __WINE_SHELL_MAIN_H
29 /*******************************************
30 * global SHELL32.DLL variables
32 extern HMODULE huser32
;
33 extern HINSTANCE shell32_hInstance
;
35 BOOL WINAPI
Shell_GetImageLists(HIMAGELIST
* lpBigList
, HIMAGELIST
* lpSmallList
);
38 #define INVALID_INDEX -1
39 BOOL
SIC_Initialize(void);
40 void SIC_Destroy(void);
41 BOOL
PidlToSicIndex (IShellFolder
* sh
, LPCITEMIDLIST pidl
, BOOL bBigIcon
, UINT uFlags
, int * pIndex
);
42 INT
SIC_GetIconIndex (LPCWSTR sSourceFile
, INT dwSourceIndex
, DWORD dwFlags
);
45 BOOL
HCR_MapTypeToValueW(LPCWSTR szExtension
, LPWSTR szFileType
, LONG len
, BOOL bPrependDot
);
46 BOOL
HCR_GetDefaultVerbW( HKEY hkeyClass
, LPCWSTR szVerb
, LPWSTR szDest
, DWORD len
);
47 BOOL
HCR_GetExecuteCommandW( HKEY hkeyClass
, LPCWSTR szClass
, LPCWSTR szVerb
, LPWSTR szDest
, DWORD len
);
48 BOOL
HCR_GetIconW(LPCWSTR szClass
, LPWSTR szDest
, LPCWSTR szName
, DWORD len
, int* picon_idx
);
49 BOOL
HCR_GetClassNameW(REFIID riid
, LPWSTR szDest
, DWORD len
);
51 /* ANSI versions of above functions, supposed to go away as soon as they are not used anymore */
52 BOOL
HCR_MapTypeToValueA(LPCSTR szExtension
, LPSTR szFileType
, LONG len
, BOOL bPrependDot
);
53 BOOL
HCR_GetIconA(LPCSTR szClass
, LPSTR szDest
, LPCSTR sName
, DWORD len
, int* picon_idx
);
54 BOOL
HCR_GetClassNameA(REFIID riid
, LPSTR szDest
, DWORD len
);
56 BOOL
HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder
, LPDWORD dwAttributes
);
57 DWORD WINAPI
ParseFieldA(LPCSTR src
, DWORD nField
, LPSTR dst
, DWORD len
);
58 DWORD WINAPI
ParseFieldW(LPCWSTR src
, DWORD nField
, LPWSTR dst
, DWORD len
);
60 /****************************************************************************
63 HRESULT
IDataObject_Constructor(HWND hwndOwner
, LPCITEMIDLIST pMyPidl
, LPCITEMIDLIST
* apidl
, UINT cidl
, IDataObject
**dataObject
);
64 HRESULT
IEnumFORMATETC_Constructor(UINT cfmt
, const FORMATETC afmt
[], IEnumFORMATETC
**enumerator
);
66 LPCLASSFACTORY
IClassFactory_Constructor(REFCLSID
);
67 IContextMenu2
* ISvItemCm_Constructor(LPSHELLFOLDER pSFParent
, LPCITEMIDLIST pidl
, const LPCITEMIDLIST
*aPidls
, UINT uItemCount
);
68 HRESULT WINAPI
INewItem_Constructor(IUnknown
* pUnkOuter
, REFIID riif
, LPVOID
*ppv
);
69 IContextMenu2
* ISvStaticItemCm_Constructor(LPSHELLFOLDER pSFParent
, LPCITEMIDLIST pidl
, LPCITEMIDLIST
*apidl
, UINT cidl
, HKEY hKey
);
70 IContextMenu2
* ISvBgCm_Constructor(LPSHELLFOLDER pSFParent
, BOOL bDesktop
);
71 HRESULT WINAPI
IShellView_Constructor(IShellFolder
*pFolder
, IShellView
**newView
);
73 HRESULT WINAPI
IShellLink_ConstructFromFile(IUnknown
* pUnkOuter
, REFIID riid
, LPCITEMIDLIST pidl
, LPVOID
* ppv
);
74 HRESULT WINAPI
IFileSystemBindData_Constructor(const WIN32_FIND_DATAW
*pfd
, LPBC
*ppV
);
75 extern HRESULT
CPanel_GetIconLocationW(LPCITEMIDLIST
, LPWSTR
, UINT
, int*);
76 HRESULT WINAPI
CPanel_ExtractIconA(LPITEMIDLIST pidl
, LPCSTR pszFile
, UINT nIconIndex
, HICON
*phiconLarge
, HICON
*phiconSmall
, UINT nIconSize
);
77 HRESULT WINAPI
CPanel_ExtractIconW(LPITEMIDLIST pidl
, LPCWSTR pszFile
, UINT nIconIndex
, HICON
*phiconLarge
, HICON
*phiconSmall
, UINT nIconSize
);
79 LPEXTRACTICONA
IExtractIconA_Constructor(LPCITEMIDLIST
);
80 LPEXTRACTICONW
IExtractIconW_Constructor(LPCITEMIDLIST
);
82 /* initialisation for FORMATETC */
83 #define InitFormatEtc(fe, cf, med) \
86 (fe).dwAspect=DVASPECT_CONTENT;\
92 #define KeyStateToDropEffect(kst)\
93 ((((kst)&(MK_CONTROL|MK_SHIFT))==(MK_CONTROL|MK_SHIFT)) ? DROPEFFECT_LINK :\
94 (((kst)&(MK_CONTROL)) ? DROPEFFECT_COPY :\
95 (((kst)&(MK_SHIFT)) ? DROPEFFECT_MOVE :\
99 HGLOBAL
RenderHDROP(LPITEMIDLIST pidlRoot
, LPITEMIDLIST
* apidl
, UINT cidl
);
100 HGLOBAL
RenderSHELLIDLIST (LPITEMIDLIST pidlRoot
, LPITEMIDLIST
* apidl
, UINT cidl
);
101 HGLOBAL
RenderFILENAMEA (LPITEMIDLIST pidlRoot
, LPITEMIDLIST
* apidl
, UINT cidl
);
102 HGLOBAL
RenderFILENAMEW (LPITEMIDLIST pidlRoot
, LPITEMIDLIST
* apidl
, UINT cidl
);
104 /* Change Notification */
105 void InitChangeNotifications(void);
106 void FreeChangeNotifications(void);
107 void InitIconOverlays(void);
110 #define ASK_DELETE_FILE 1
111 #define ASK_DELETE_FOLDER 2
112 #define ASK_DELETE_MULTIPLE_ITEM 3
113 #define ASK_CREATE_FOLDER 4
114 #define ASK_OVERWRITE_FILE 5
115 #define ASK_DELETE_SELECTED 6
116 #define ASK_TRASH_FILE 7
117 #define ASK_TRASH_FOLDER 8
118 #define ASK_TRASH_MULTIPLE_ITEM 9
119 #define ASK_CANT_TRASH_ITEM 10
120 #define ASK_OVERWRITE_FOLDER 11
122 BOOL
SHELL_DeleteDirectoryW(HWND hwnd
, LPCWSTR pwszDir
, BOOL bShowUI
);
123 BOOL
SHELL_ConfirmYesNoW(HWND hWnd
, int nKindOfDialog
, LPCWSTR szDir
);
125 void WINAPI
_InsertMenuItemW (HMENU hmenu
, UINT indexMenu
, BOOL fByPosition
,
126 UINT wID
, UINT fType
, LPCWSTR dwTypeData
, UINT fState
);
128 static __inline BOOL
SHELL_OsIsUnicode(void)
130 /* if high-bit of version is 0, we are emulating NT */
131 return !(GetVersion() & 0x80000000);
134 #define __SHFreeAndNil(ptr) \
139 static __inline
void __SHCloneStrA(char **target
, const char *source
)
141 *target
= (char *)SHAlloc(strlen(source
) + 1);
142 strcpy(*target
, source
);
145 static __inline
void __SHCloneStrWtoA(char **target
, const WCHAR
*source
)
147 int len
= WideCharToMultiByte(CP_ACP
, 0, source
, -1, NULL
, 0, NULL
, NULL
);
148 *target
= (char *)SHAlloc(len
);
149 WideCharToMultiByte(CP_ACP
, 0, source
, -1, *target
, len
, NULL
, NULL
);
152 static __inline
void __SHCloneStrW(WCHAR
**target
, const WCHAR
*source
)
154 *target
= (WCHAR
*)SHAlloc((lstrlenW(source
) + 1) * sizeof(WCHAR
) );
155 lstrcpyW(*target
, source
);
158 static __inline LPWSTR
__SHCloneStrAtoW(WCHAR
**target
, const char *source
)
160 int len
= MultiByteToWideChar(CP_ACP
, 0, source
, -1, NULL
, 0);
161 *target
= (WCHAR
*)SHAlloc(len
* sizeof(WCHAR
));
162 MultiByteToWideChar(CP_ACP
, 0, source
, -1, *target
, len
);
166 /* handle conversions */
167 #define HICON_16(h32) (LOWORD(h32))
168 #define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
169 #define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
170 #define HINSTANCE_16(h32) (LOWORD(h32))
172 extern WCHAR swShell32Name
[MAX_PATH
];
174 BOOL
UNIXFS_is_rooted_at_desktop(void);
175 extern const GUID CLSID_UnixFolder
;
176 extern const GUID CLSID_UnixDosFolder
;
178 /* Default shell folder value registration */
179 HRESULT
SHELL_RegisterShellFolders(void);
181 /* Detect Shell Links */
182 BOOL
SHELL_IsShortcut(LPCITEMIDLIST
);
184 INT_PTR CALLBACK
SH_FileGeneralDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
185 INT_PTR CALLBACK
SH_FileVersionDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
186 HPROPSHEETPAGE
SH_CreatePropertySheetPage(WORD wDialogId
, DLGPROC pfnDlgProc
, LPARAM lParam
, LPCWSTR pwszTitle
);
187 BOOL
SH_ShowDriveProperties(WCHAR
*drive
, LPCITEMIDLIST pidlFolder
, LPCITEMIDLIST
*apidl
);
188 BOOL
SH_ShowRecycleBinProperties(WCHAR sDrive
);
189 BOOL
SH_ShowPropertiesDialog(LPCWSTR pwszPath
, LPCITEMIDLIST pidlFolder
, LPCITEMIDLIST
*apidl
);
190 BOOL
SH_ShowFolderProperties(LPWSTR pwszFolder
, LPCITEMIDLIST pidlFolder
, LPCITEMIDLIST
*apidl
);
191 LPWSTR
SH_FormatFileSizeWithBytes(PULARGE_INTEGER lpQwSize
, LPWSTR pszBuf
, UINT cchBuf
);
193 HRESULT WINAPI
DoRegisterServer(void);
194 HRESULT WINAPI
DoUnregisterServer(void);
200 #endif /* __WINE_SHELL_MAIN_H */