2 * internal Shell32 Library definitions
5 #ifndef __WINE_SHELL_MAIN_H
6 #define __WINE_SHELL_MAIN_H
13 #include "wine/obj_shellfolder.h"
14 #include "wine/obj_dataobject.h"
15 #include "wine/obj_contextmenu.h"
16 #include "wine/obj_shellview.h"
17 #include "wine/obj_shelllink.h"
18 #include "wine/obj_extracticon.h"
20 /*******************************************
21 * global SHELL32.DLL variables
23 extern HINSTANCE shell32_hInstance;
24 extern INT shell32_ObjCount;
25 extern HIMAGELIST ShellSmallIconList;
26 extern HIMAGELIST ShellBigIconList;
29 /*******************************************
30 * pointer to functions dynamically loaded
32 extern void (WINAPI* pDLLInitComctl)(LPVOID);
33 extern INT (WINAPI* pImageList_AddIcon) (HIMAGELIST himl, HICON hIcon);
34 extern INT (WINAPI* pImageList_ReplaceIcon) (HIMAGELIST, INT, HICON);
35 extern HIMAGELIST (WINAPI* pImageList_Create) (INT,INT,UINT,INT,INT);
36 extern BOOL (WINAPI* pImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle);
37 extern HICON (WINAPI* pImageList_GetIcon) (HIMAGELIST, INT, UINT);
38 extern INT (WINAPI* pImageList_GetImageCount)(HIMAGELIST);
39 extern COLORREF (WINAPI *pImageList_SetBkColor)(HIMAGELIST, COLORREF);
41 extern LPVOID (WINAPI* pCOMCTL32_Alloc) (INT);
42 extern BOOL (WINAPI* pCOMCTL32_Free) (LPVOID);
44 extern HDPA (WINAPI* pDPA_Create) (INT);
45 extern INT (WINAPI* pDPA_InsertPtr) (const HDPA, INT, LPVOID);
46 extern BOOL (WINAPI* pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM);
47 extern LPVOID (WINAPI* pDPA_GetPtr) (const HDPA, INT);
48 extern BOOL (WINAPI* pDPA_Destroy) (const HDPA);
49 extern INT (WINAPI* pDPA_Search) (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT);
50 extern LPVOID (WINAPI* pDPA_DeletePtr) (const HDPA hdpa, INT i);
51 #define pDPA_GetPtrCount(hdpa) (*(INT*)(hdpa))
53 extern HICON (WINAPI *pLookupIconIdFromDirectoryEx)(LPBYTE dir, BOOL bIcon, INT width, INT height, UINT cFlag);
54 extern HICON (WINAPI *pCreateIconFromResourceEx)(LPBYTE bits,UINT cbSize, BOOL bIcon, DWORD dwVersion, INT width, INT height,UINT cFlag);
57 extern HRESULT (WINAPI* pOleInitialize)(LPVOID reserved);
58 extern void (WINAPI* pOleUninitialize)(void);
59 extern HRESULT (WINAPI* pDoDragDrop)(IDataObject* pDataObject, IDropSource * pDropSource, DWORD dwOKEffect, DWORD * pdwEffect);
60 extern HRESULT (WINAPI* pRegisterDragDrop)(HWND hwnd, IDropTarget* pDropTarget);
61 extern HRESULT (WINAPI* pRevokeDragDrop)(HWND hwnd);
63 BOOL WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
65 HRESULT WINAPI StrRetToStrNA (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl);
66 HRESULT WINAPI StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl);
67 HRESULT WINAPI StrRetToStrN (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl);
70 #define INVALID_INDEX -1
71 BOOL SIC_Initialize(void);
72 void SIC_Destroy(void);
73 BOOL PidlToSicIndex (IShellFolder * sh, LPITEMIDLIST pidl, BOOL bBigIcon, UINT * pIndex);
76 BOOL HCR_MapTypeToValue ( LPCSTR szExtension, LPSTR szFileType, DWORD len, BOOL bPrependDot);
77 BOOL HCR_GetExecuteCommand ( LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD len );
78 BOOL HCR_GetDefaultIcon (LPCSTR szClass, LPSTR szDest, DWORD len, LPDWORD dwNr);
79 BOOL HCR_GetClassName (REFIID riid, LPSTR szDest, DWORD len);
80 BOOL HCR_GetFolderAttributes (REFIID riid, LPDWORD szDest);
82 DWORD WINAPI ParseFieldA(LPCSTR src,DWORD field,LPSTR dst,DWORD len);
84 HGLOBAL WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID);
85 LPVOID WINAPI SHLockShared(HANDLE hmem, DWORD procID);
86 BOOL WINAPI SHUnlockShared(HANDLE pmem);
87 HANDLE WINAPI SHFreeShared(HANDLE hmem, DWORD procID);
89 /****************************************************************************
92 LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPITEMIDLIST myPidl, LPITEMIDLIST * apidl, UINT cidl);
93 LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT, const FORMATETC []);
95 LPCLASSFACTORY IClassFactory_Constructor(REFCLSID);
96 IContextMenu * IContextMenu_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *aPidls, UINT uItemCount);
97 IContextMenu * ISvBgCm_Constructor(void);
98 LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER);
99 LPSHELLLINK IShellLink_Constructor(BOOL);
101 IShellFolder * ISF_Desktop_Constructor(void);
103 /* kind of enumidlist */
105 #define EIDL_MYCOMP 1
108 LPENUMIDLIST IEnumIDList_Constructor(LPCSTR,DWORD,DWORD);
110 LPEXTRACTICONA IExtractIconA_Constructor(LPITEMIDLIST);
111 HRESULT CreateStreamOnFile (LPCSTR pszFilename, IStream ** ppstm);
113 /* fixme: rename the functions when the shell32.dll has it's own exports namespace */
114 HRESULT WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv);
115 HRESULT WINAPI SHELL32_DllCanUnloadNow(void);
116 LRESULT WINAPI SHCoCreateInstance(LPSTR,REFCLSID,LPUNKNOWN,REFIID,LPVOID *);
118 /* fixme: move away */
119 #define ResultFromShort(i) MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i))
122 #define MM_ADDSEPARATOR 0x00000001L
123 #define MM_SUBMENUSHAVEIDS 0x00000002L
124 HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags);
126 /* initialisation for FORMATETC */
127 #define InitFormatEtc(fe, cf, med) \
130 (fe).dwAspect=DVASPECT_CONTENT;\
136 #define KeyStateToDropEffect(kst)\
137 (((kst) & MK_CONTROL) ?\
138 (((kst) & MK_SHIFT) ? DROPEFFECT_LINK : DROPEFFECT_COPY):\
142 BOOL SYSTRAY_Init(void);