9 #define STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn)
10 #define STDMETHOD_(type,xfn) type (CALLBACK *fn##xfn)
16 typedef LPVOID LPBC
; /* *IBindCtx really */
21 DEFINE_SHLGUID(CLSID_ShellDesktop
, 0x00021400L
, 0, 0);
22 DEFINE_SHLGUID(CLSID_ShellLink
, 0x00021401L
, 0, 0);
25 * shell32 Interface ids
27 DEFINE_SHLGUID(IID_IContextMenu
, 0x000214E4L
, 0, 0);
28 DEFINE_SHLGUID(IID_IShellFolder
, 0x000214E6L
, 0, 0);
29 DEFINE_SHLGUID(IID_IShellExtInit
, 0x000214E8L
, 0, 0);
30 DEFINE_SHLGUID(IID_IShellPropSheetExt
, 0x000214E9L
, 0, 0);
31 DEFINE_SHLGUID(IID_IExtractIcon
, 0x000214EBL
, 0, 0);
32 DEFINE_SHLGUID(IID_IShellLink
, 0x000214EEL
, 0, 0);
33 DEFINE_SHLGUID(IID_IShellCopyHook
, 0x000214EFL
, 0, 0);
34 DEFINE_SHLGUID(IID_IFileViewer
, 0x000214F0L
, 0, 0);
35 DEFINE_SHLGUID(IID_IEnumIDList
, 0x000214F2L
, 0, 0);
36 DEFINE_SHLGUID(IID_IFileViewerSite
, 0x000214F3L
, 0, 0);
38 #define STRRET_WSTR 0x0000
39 #define STRRET_OFFSET 0x0001
40 #define STRRET_CSTR 0x0002
42 typedef struct _STRRET
44 UINT32 uType
; /* STRRET_xxx */
47 LPWSTR pOleStr
; /* OLESTR that will be freed */
48 UINT32 uOffset
; /* Offset into SHITEMID (ANSI) */
49 char cStr
[MAX_PATH
]; /* Buffer to fill in */
54 WORD cb
; /* nr of bytes in this item */
55 BYTE abID
[1];/* first byte in this item */
56 } SHITEMID
,*LPSHITEMID
;
59 SHITEMID mkid
; /* first itemid in list */
60 } ITEMIDLIST
,*LPITEMIDLIST
,*LPCITEMIDLIST
;
62 /*****************************************************************************
63 * IEnumIDList interface
65 #define THIS LPENUMIDLIST this
67 typedef struct IEnumIDList IEnumIDList
,*LPENUMIDLIST
;
68 typedef struct IEnumIDList_VTable
{
69 /* *** IUnknown methods *** */
70 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
71 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
72 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
74 /* *** IEnumIDList methods *** */
75 STDMETHOD(Next
) (THIS_ ULONG celt
,
77 ULONG
*pceltFetched
) PURE
;
78 STDMETHOD(Skip
) (THIS_ ULONG celt
) PURE
;
79 STDMETHOD(Reset
) (THIS
) PURE
;
80 STDMETHOD(Clone
) (THIS_ IEnumIDList
**ppenum
) PURE
;
81 } IEnumIDList_VTable
,*LPENUMIDLIST_VTABLE
;
84 LPENUMIDLIST_VTABLE lpvtbl
;
88 /************************************************************************
89 * The IShellFolder interface ... the basic interface for a lot of stuff
92 #define THIS LPSHELLFOLDER this
94 /* IShellFolder::GetDisplayNameOf/SetNameOf uFlags */
97 SHGDN_NORMAL
= 0, /* default (display purpose) */
98 SHGDN_INFOLDER
= 1, /* displayed under a folder (relative)*/
99 SHGDN_FORPARSING
= 0x8000 /* for ParseDisplayName or path */
102 /* IShellFolder::EnumObjects */
103 typedef enum tagSHCONTF
105 SHCONTF_FOLDERS
= 32, /* for shell browser */
106 SHCONTF_NONFOLDERS
= 64, /* for default view */
107 SHCONTF_INCLUDEHIDDEN
= 128 /* for hidden/system objects */
111 #define DROPEFFECT_NONE 0
112 #define DROPEFFECT_COPY 1
113 #define DROPEFFECT_MOVE 2
114 #define DROPEFFECT_LINK 4
115 #define DROPEFFECT_SCROLL 0x80000000
117 /* IShellFolder::GetAttributesOf flags */
118 #define SFGAO_CANCOPY DROPEFFECT_COPY /* Objects can be copied */
119 #define SFGAO_CANMOVE DROPEFFECT_MOVE /* Objects can be moved */
120 #define SFGAO_CANLINK DROPEFFECT_LINK /* Objects can be linked */
121 #define SFGAO_CANRENAME 0x00000010L /* Objects can be renamed */
122 #define SFGAO_CANDELETE 0x00000020L /* Objects can be deleted */
123 #define SFGAO_HASPROPSHEET 0x00000040L /* Objects have property sheets */
124 #define SFGAO_DROPTARGET 0x00000100L /* Objects are drop target */
125 #define SFGAO_CAPABILITYMASK 0x00000177L
126 #define SFGAO_LINK 0x00010000L /* Shortcut (link) */
127 #define SFGAO_SHARE 0x00020000L /* shared */
128 #define SFGAO_READONLY 0x00040000L /* read-only */
129 #define SFGAO_GHOSTED 0x00080000L /* ghosted icon */
130 #define SFGAO_DISPLAYATTRMASK 0x000F0000L
131 #define SFGAO_FILESYSANCESTOR 0x10000000L /* It contains file system folder */
132 #define SFGAO_FOLDER 0x20000000L /* It's a folder. */
133 #define SFGAO_FILESYSTEM 0x40000000L /* is a file system thing (file/folder/root) */
134 #define SFGAO_HASSUBFOLDER 0x80000000L /* Expandable in the map pane */
135 #define SFGAO_CONTENTSMASK 0x80000000L
136 #define SFGAO_VALIDATE 0x01000000L /* invalidate cached information */
137 #define SFGAO_REMOVABLE 0x02000000L /* is this removeable media? */
140 typedef struct tagSHELLFOLDER
*LPSHELLFOLDER
,IShellFolder
;
141 typedef struct IShellFolder_VTable
{
142 /* *** IUnknown methods *** */
143 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
144 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
145 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
147 /* *** IShellFolder methods *** */
148 STDMETHOD(ParseDisplayName
) (THIS_ HWND32 hwndOwner
,
149 LPBC pbcReserved
, LPOLESTR32 lpszDisplayName
,
150 ULONG
* pchEaten
, LPITEMIDLIST
* ppidl
, ULONG
*pdwAttributes
) PURE
;
151 STDMETHOD(EnumObjects
) ( THIS_ HWND32 hwndOwner
, DWORD grfFlags
, LPENUMIDLIST
152 * ppenumIDList
) PURE
;
153 STDMETHOD(BindToObject
) (THIS_ LPCITEMIDLIST pidl
, LPBC pbcReserved
,
154 REFIID riid
, LPVOID
* ppvOut
) PURE
;
155 STDMETHOD(BindToStorage
) (THIS_ LPCITEMIDLIST pidl
, LPBC pbcReserved
,
156 REFIID riid
, LPVOID
* ppvObj
) PURE
;
157 STDMETHOD(CompareIDs
) (THIS_ LPARAM lParam
, LPCITEMIDLIST pidl1
, LPCITEMIDLIST pidl2
) PURE
;
158 STDMETHOD(CreateViewObject
) (THIS_ HWND32 hwndOwner
, REFIID riid
, LPVOID
* ppvOut
) PURE
;
159 STDMETHOD(GetAttributesOf
) (THIS_ UINT32 cidl
, LPCITEMIDLIST
* apidl
,
160 ULONG
* rgfInOut
) PURE
;
161 STDMETHOD(GetUIObjectOf
) (THIS_ HWND32 hwndOwner
, UINT32 cidl
, LPCITEMIDLIST
163 REFIID riid
, UINT32
* prgfInOut
, LPVOID
* ppvOut
) PURE
;
164 STDMETHOD(GetDisplayNameOf
) (THIS_ LPCITEMIDLIST pidl
, DWORD uFlags
, LPSTRRET lpName
) PURE
;
165 STDMETHOD(SetNameOf
) (THIS_ HWND32 hwndOwner
, LPCITEMIDLIST pidl
,
166 LPCOLESTR32 lpszName
, DWORD uFlags
,
167 LPITEMIDLIST
* ppidlOut
) PURE
;
168 } *LPSHELLFOLDER_VTABLE
,IShellFolder_VTable
;
170 struct tagSHELLFOLDER
{
171 LPSHELLFOLDER_VTABLE lpvtbl
;
177 /****************************************************************************
178 * IShellLink interface
181 #define THIS LPSHELLLINK this
182 /* IShellLink::Resolve fFlags */
185 SLR_ANY_MATCH
= 0x0002,
189 /* IShellLink::GetPath fFlags */
191 SLGP_SHORTPATH
= 0x0001,
192 SLGP_UNCPRIORITY
= 0x0002
197 typedef struct IShellLink IShellLink
,*LPSHELLLINK
;
198 typedef struct IShellLink_VTable
200 /* *** IUnknown methods *** */
201 STDMETHOD(QueryInterface
) (THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
202 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
203 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
205 STDMETHOD(GetPath
)(THIS_ LPSTR pszFile
, INT32 cchMaxPath
, WIN32_FIND_DATA32A
*pfd
, DWORD fFlags
) PURE
;
207 STDMETHOD(GetIDList
)(THIS_ LPITEMIDLIST
* ppidl
) PURE
;
208 STDMETHOD(SetIDList
)(THIS_ LPCITEMIDLIST pidl
) PURE
;
210 STDMETHOD(GetDescription
)(THIS_ LPSTR pszName
, int cchMaxName
) PURE
;
211 STDMETHOD(SetDescription
)(THIS_ LPCSTR pszName
) PURE
;
213 STDMETHOD(GetWorkingDirectory
)(THIS_ LPSTR pszDir
, int cchMaxPath
) PURE
;
214 STDMETHOD(SetWorkingDirectory
)(THIS_ LPCSTR pszDir
) PURE
;
216 STDMETHOD(GetArguments
)(THIS_ LPSTR pszArgs
, int cchMaxPath
) PURE
;
217 STDMETHOD(SetArguments
)(THIS_ LPCSTR pszArgs
) PURE
;
219 STDMETHOD(GetHotkey
)(THIS_ WORD
*pwHotkey
) PURE
;
220 STDMETHOD(SetHotkey
)(THIS_ WORD wHotkey
) PURE
;
222 STDMETHOD(GetShowCmd
)(THIS_ INT32
*piShowCmd
) PURE
;
223 STDMETHOD(SetShowCmd
)(THIS_ INT32 iShowCmd
) PURE
;
225 STDMETHOD(GetIconLocation
)(THIS_ LPSTR pszIconPath
, INT32 cchIconPath
, INT32
*piIcon
) PURE
;
226 STDMETHOD(SetIconLocation
)(THIS_ LPCSTR pszIconPath
, INT32 iIcon
) PURE
;
228 STDMETHOD(SetRelativePath
)(THIS_ LPCSTR pszPathRel
, DWORD dwReserved
) PURE
;
230 STDMETHOD(Resolve
)(THIS_ HWND32 hwnd
, DWORD fFlags
) PURE
;
232 STDMETHOD(SetPath
)(THIS_ LPCSTR pszFile
) PURE
;
233 } IShellLink_VTable
,*LPSHELLLINK_VTABLE
;
236 LPSHELLLINK_VTABLE lpvtbl
;
243 extern LPSHELLFOLDER
IShellFolder_Constructor();
244 extern LPSHELLLINK
IShellLink_Constructor();
245 extern LPENUMIDLIST
IEnumIDList_Constructor();
248 DWORD WINAPI
SHELL32_DllGetClassObject(LPCLSID
,REFIID
,LPVOID
*);
251 /****************************************************************************
252 * SHBrowseForFolder API
255 typedef int (CALLBACK
* BFFCALLBACK
)(HWND32 hwnd
, UINT32 uMsg
, LPARAM lParam
, LPARAM lpData
);
257 typedef struct tagBROWSEINFO32A
{
259 LPCITEMIDLIST pidlRoot
;
260 LPSTR pszDisplayName
;
266 } BROWSEINFO32A
, *PBROWSEINFO32A
, *LPBROWSEINFO32A
;
268 typedef struct tagBROWSEINFO32W
{
270 LPCITEMIDLIST pidlRoot
;
271 LPWSTR pszDisplayName
;
277 } BROWSEINFO32W
, *PBROWSEINFO32W
, *LPBROWSEINFO32W
;
279 #define BROWSEINFO WINELIB_NAME_AW(BROWSEINFO)
280 #define PBROWSEINFO WINELIB_NAME_AW(PBROWSEINFO)
281 #define LPBROWSEINFO WINELIB_NAME_AW(LPBROWSEINFO)
283 // Browsing for directory.
284 #define BIF_RETURNONLYFSDIRS 0x0001
285 #define BIF_DONTGOBELOWDOMAIN 0x0002
286 #define BIF_STATUSTEXT 0x0004
287 #define BIF_RETURNFSANCESTORS 0x0008
288 #define BIF_EDITBOX 0x0010
289 #define BIF_VALIDATE 0x0020
291 #define BIF_BROWSEFORCOMPUTER 0x1000
292 #define BIF_BROWSEFORPRINTER 0x2000
293 #define BIF_BROWSEINCLUDEFILES 0x4000
295 // message from browser
296 #define BFFM_INITIALIZED 1
297 #define BFFM_SELCHANGED 2
298 #define BFFM_VALIDATEFAILEDA 3 // lParam:szPath ret:1(cont),0(EndDialog)
299 #define BFFM_VALIDATEFAILEDW 4 // lParam:wzPath ret:1(cont),0(EndDialog)
301 // messages to browser
302 #define BFFM_SETSTATUSTEXTA (WM_USER+100)
303 #define BFFM_ENABLEOK (WM_USER+101)
304 #define BFFM_SETSELECTIONA (WM_USER+102)
305 #define BFFM_SETSELECTIONW (WM_USER+103)
306 #define BFFM_SETSTATUSTEXTW (WM_USER+104)
308 LPITEMIDLIST WINAPI
SHBrowseForFolder32A(LPBROWSEINFO32A lpbi
);
310 LPITEMIDLIST WINAPI SHBrowseForFolder32W(LPBROWSEINFO32W lpbi);
313 #define SHBrowseForFolder SHBrowseForFolderW
314 #define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTW
315 #define BFFM_SETSELECTION BFFM_SETSELECTIONW
317 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW
319 #define SHBrowseForFolder SHBrowseForFolderA
320 #define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTA
321 #define BFFM_SETSELECTION BFFM_SETSELECTIONA
323 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA
334 #endif /*_WINE_SHLOBJ_H*/