diff --git a/dlls/shell32/brsfolder.c b/dlls/shell32/brsfolder.c index 9d3780c7da7..184c1bac8b7 100644 --- a/dlls/shell32/brsfolder.c +++ b/dlls/shell32/brsfolder.c @@ -15,14 +15,13 @@ #include "commctrl.h" #include "spy.h" -#include "shlobj.h" #include "wine/obj_base.h" #include "wine/obj_enumidlist.h" #include "wine/obj_shellfolder.h" + #include "shell.h" #include "pidl.h" #include "shell32_main.h" -#include "shlguid.h" #define IDD_TREEVIEW 99 diff --git a/dlls/shell32/contmenu.c b/dlls/shell32/contmenu.c index 8ebcc11a47a..ef8537f1fc2 100644 --- a/dlls/shell32/contmenu.c +++ b/dlls/shell32/contmenu.c @@ -10,96 +10,191 @@ #include "pidl.h" #include "wine/obj_base.h" -#include "if_macros.h" -#include "shlguid.h" +#include "wine/obj_contextmenu.h" +#include "wine/obj_shellbrowser.h" +#include "wine/obj_shellextinit.h" + #include "shell32_main.h" -#include "shresdef.h" /************************************************************************** * IContextMenu Implementation */ typedef struct -{ ICOM_VTABLE(IContextMenu)* lpvtbl; - DWORD ref; - LPSHELLFOLDER pSFParent; - LPITEMIDLIST *aPidls; - BOOL bAllValues; +{ ICOM_VTABLE(IContextMenu)* lpvtbl; + DWORD ref; + IShellFolder* pSFParent; + LPITEMIDLIST *aPidls; + BOOL bAllValues; } IContextMenuImpl; -static HRESULT WINAPI IContextMenu_fnQueryInterface(IContextMenu *,REFIID , LPVOID *); -static ULONG WINAPI IContextMenu_fnAddRef(IContextMenu *); -static ULONG WINAPI IContextMenu_fnRelease(IContextMenu *); -static HRESULT WINAPI IContextMenu_fnQueryContextMenu(IContextMenu *, HMENU ,UINT ,UINT ,UINT ,UINT); -static HRESULT WINAPI IContextMenu_fnInvokeCommand(IContextMenu *, LPCMINVOKECOMMANDINFO); -static HRESULT WINAPI IContextMenu_fnGetCommandString(IContextMenu *, UINT ,UINT ,LPUINT ,LPSTR ,UINT); -static HRESULT WINAPI IContextMenu_fnHandleMenuMsg(IContextMenu *, UINT, WPARAM, LPARAM); -/* Private Methods */ -BOOL IContextMenu_AllocPidlTable(IContextMenuImpl*, DWORD); -void IContextMenu_FreePidlTable(IContextMenuImpl*); -BOOL IContextMenu_CanRenameItems(IContextMenuImpl*); -BOOL IContextMenu_FillPidlTable(IContextMenuImpl*, LPCITEMIDLIST *, UINT); +static struct ICOM_VTABLE(IContextMenu) cmvt; /************************************************************************** -* IContextMenu VTable -* +* IContextMenu_AllocPidlTable() */ -static struct ICOM_VTABLE(IContextMenu) cmvt = { - IContextMenu_fnQueryInterface, - IContextMenu_fnAddRef, - IContextMenu_fnRelease, - IContextMenu_fnQueryContextMenu, - IContextMenu_fnInvokeCommand, - IContextMenu_fnGetCommandString, - IContextMenu_fnHandleMenuMsg, - (void *) 0xdeadbabe /* just paranoia */ -}; +BOOL IContextMenu_AllocPidlTable(IContextMenuImpl *This, DWORD dwEntries) +{ + TRACE(shell,"(%p)->(entrys=%lu)\n",This, dwEntries); + + /*add one for NULL terminator */ + dwEntries++; + + This->aPidls = (LPITEMIDLIST*)SHAlloc(dwEntries * sizeof(LPITEMIDLIST)); + + if(This->aPidls) + { ZeroMemory(This->aPidls, dwEntries * sizeof(LPITEMIDLIST)); /*set all of the entries to NULL*/ + } + return (This->aPidls != NULL); +} + +/************************************************************************** +* IContextMenu_FreePidlTable() +*/ +void IContextMenu_FreePidlTable(IContextMenuImpl *This) +{ + int i; + + TRACE(shell,"(%p)->()\n",This); + + if(This->aPidls) + { for(i = 0; This->aPidls[i]; i++) + { SHFree(This->aPidls[i]); + } + + SHFree(This->aPidls); + This->aPidls = NULL; + } +} + +/************************************************************************** +* IContextMenu_FillPidlTable() +*/ +BOOL IContextMenu_FillPidlTable(IContextMenuImpl *This, LPCITEMIDLIST *aPidls, UINT uItemCount) +{ + UINT i; + + TRACE(shell,"(%p)->(apidl=%p count=%u)\n",This, aPidls, uItemCount); + + if(This->aPidls) + { for(i = 0; i < uItemCount; i++) + { This->aPidls[i] = ILClone(aPidls[i]); + } + return TRUE; + } + return FALSE; +} + +/************************************************************************** +* IContextMenu_CanRenameItems() +*/ +BOOL IContextMenu_CanRenameItems(IContextMenuImpl *This) +{ UINT i; + DWORD dwAttributes; + + TRACE(shell,"(%p)->()\n",This); + + if(This->aPidls) + { + for(i = 0; This->aPidls[i]; i++){} /*get the number of items assigned to This object*/ + { if(i > 1) /*you can't rename more than one item at a time*/ + { return FALSE; + } + } + dwAttributes = SFGAO_CANRENAME; + IShellFolder_GetAttributesOf(This->pSFParent, i, (LPCITEMIDLIST*)This->aPidls, &dwAttributes); + + return dwAttributes & SFGAO_CANRENAME; + } + return FALSE; +} + +/************************************************************************** +* IContextMenu_Constructor() +*/ +IContextMenu *IContextMenu_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST *aPidls, UINT uItemCount) +{ IContextMenuImpl* cm; + UINT u; + + cm = (IContextMenuImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IContextMenuImpl)); + cm->lpvtbl=&cmvt; + cm->ref = 1; + + cm->pSFParent = pSFParent; + if(pSFParent) + IShellFolder_AddRef(pSFParent); + + cm->aPidls = NULL; + + IContextMenu_AllocPidlTable(cm, uItemCount); + + if(cm->aPidls) + { IContextMenu_FillPidlTable(cm, aPidls, uItemCount); + } + + cm->bAllValues = 1; + for(u = 0; u < uItemCount; u++) + { cm->bAllValues &= (_ILIsValue(aPidls[u]) ? 1 : 0); + } + TRACE(shell,"(%p)->()\n",cm); + shell32_ObjCount++; + return (IContextMenu*)cm; +} /************************************************************************** * IContextMenu_fnQueryInterface */ static HRESULT WINAPI IContextMenu_fnQueryInterface(IContextMenu *iface, REFIID riid, LPVOID *ppvObj) -{ ICOM_THIS(IContextMenuImpl, iface); +{ + ICOM_THIS(IContextMenuImpl, iface); + char xriid[50]; - WINE_StringFromCLSID((LPCLSID)riid,xriid); - TRACE(shell,"(%p)->(\n\tIID:\t%s,%p)\n",This,xriid,ppvObj); + WINE_StringFromCLSID((LPCLSID)riid,xriid); - *ppvObj = NULL; + TRACE(shell,"(%p)->(\n\tIID:\t%s,%p)\n",This,xriid,ppvObj); - if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ - { *ppvObj = This; - } - else if(IsEqualIID(riid, &IID_IContextMenu)) /*IContextMenu*/ - { *ppvObj = This; - } - else if(IsEqualIID(riid, &IID_IShellExtInit)) /*IShellExtInit*/ - { FIXME (shell,"-- LPSHELLEXTINIT pointer requested\n"); - } + *ppvObj = NULL; - if(*ppvObj) - { - (*(IContextMenuImpl**)ppvObj)->lpvtbl->fnAddRef(iface); - TRACE(shell,"-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); - return S_OK; - } - TRACE(shell,"-- Interface: E_NOINTERFACE\n"); - return E_NOINTERFACE; -} + if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ + { *ppvObj = This; + } + else if(IsEqualIID(riid, &IID_IContextMenu)) /*IContextMenu*/ + { *ppvObj = This; + } + else if(IsEqualIID(riid, &IID_IShellExtInit)) /*IShellExtInit*/ + { FIXME (shell,"-- LPSHELLEXTINIT pointer requested\n"); + } + + if(*ppvObj) + { + IContextMenu_AddRef((IContextMenu*)*ppvObj); + TRACE(shell,"-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); + return S_OK; + } + TRACE(shell,"-- Interface: E_NOINTERFACE\n"); + return E_NOINTERFACE; +} /************************************************************************** * IContextMenu_fnAddRef */ static ULONG WINAPI IContextMenu_fnAddRef(IContextMenu *iface) -{ ICOM_THIS(IContextMenuImpl, iface); +{ + ICOM_THIS(IContextMenuImpl, iface); + TRACE(shell,"(%p)->(count=%lu)\n",This,(This->ref)+1); + shell32_ObjCount++; return ++(This->ref); } + /************************************************************************** * IContextMenu_fnRelease */ static ULONG WINAPI IContextMenu_fnRelease(IContextMenu *iface) -{ ICOM_THIS(IContextMenuImpl, iface); +{ + ICOM_THIS(IContextMenuImpl, iface); + TRACE(shell,"(%p)->()\n",This); shell32_ObjCount--; @@ -108,7 +203,7 @@ static ULONG WINAPI IContextMenu_fnRelease(IContextMenu *iface) { TRACE(shell," destroying IContextMenu(%p)\n",This); if(This->pSFParent) - This->pSFParent->lpvtbl->fnRelease(This->pSFParent); + IShellFolder_Release(This->pSFParent); /*make sure the pidl is freed*/ if(This->aPidls) @@ -121,43 +216,19 @@ static ULONG WINAPI IContextMenu_fnRelease(IContextMenu *iface) return This->ref; } -/************************************************************************** -* IContextMenu_Constructor() -*/ -IContextMenu *IContextMenu_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST *aPidls, UINT uItemCount) -{ IContextMenuImpl* cm; - UINT u; - FIXME(shell, "HELLO age\n") ; - cm = (IContextMenuImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IContextMenuImpl)); - cm->lpvtbl=&cmvt; - cm->ref = 1; - - cm->pSFParent = pSFParent; - if(cm->pSFParent) - cm->pSFParent->lpvtbl->fnAddRef(cm->pSFParent); - - cm->aPidls = NULL; - - IContextMenu_AllocPidlTable(cm, uItemCount); - - if(cm->aPidls) - { IContextMenu_FillPidlTable(cm, aPidls, uItemCount); - } - - cm->bAllValues = 1; - for(u = 0; u < uItemCount; u++) - { cm->bAllValues &= (_ILIsValue(aPidls[u]) ? 1 : 0); - } - TRACE(shell,"(%p)->()\n",cm); - shell32_ObjCount++; - return (IContextMenu*)cm; -} /************************************************************************** * ICM_InsertItem() */ -void WINAPI _InsertMenuItem (HMENU hmenu, UINT indexMenu, BOOL fByPosition, - UINT wID, UINT fType, LPSTR dwTypeData, UINT fState) -{ MENUITEMINFOA mii; +void WINAPI _InsertMenuItem ( + HMENU hmenu, + UINT indexMenu, + BOOL fByPosition, + UINT wID, + UINT fType, + LPSTR dwTypeData, + UINT fState) +{ + MENUITEMINFOA mii; ZeroMemory(&mii, sizeof(mii)); mii.cbSize = sizeof(mii); @@ -177,9 +248,16 @@ void WINAPI _InsertMenuItem (HMENU hmenu, UINT indexMenu, BOOL fByPosition, * IContextMenu_fnQueryContextMenu() */ -static HRESULT WINAPI IContextMenu_fnQueryContextMenu(IContextMenu *iface, HMENU hmenu, UINT indexMenu, - UINT idCmdFirst,UINT idCmdLast,UINT uFlags) -{ ICOM_THIS(IContextMenuImpl, iface); +static HRESULT WINAPI IContextMenu_fnQueryContextMenu( + IContextMenu *iface, + HMENU hmenu, + UINT indexMenu, + UINT idCmdFirst, + UINT idCmdLast, + UINT uFlags) +{ + ICOM_THIS(IContextMenuImpl, iface); + BOOL fExplore ; TRACE(shell,"(%p)->(hmenu=%x indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n",This, hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags); @@ -193,19 +271,19 @@ static HRESULT WINAPI IContextMenu_fnQueryContextMenu(IContextMenu *iface, HMENU _InsertMenuItem(hmenu, indexMenu++, TRUE, idCmdFirst+IDM_OPEN, MFT_STRING, "&Open", MFS_ENABLED); } else - { _InsertMenuItem(hmenu, indexMenu++, TRUE, idCmdFirst+IDM_OPEN, MFT_STRING, "&Open", MFS_ENABLED|MFS_DEFAULT); + { _InsertMenuItem(hmenu, indexMenu++, TRUE, idCmdFirst+IDM_OPEN, MFT_STRING, "&Open", MFS_ENABLED|MFS_DEFAULT); _InsertMenuItem(hmenu, indexMenu++, TRUE, idCmdFirst+IDM_EXPLORE, MFT_STRING, "&Explore", MFS_ENABLED); - } + } - if(uFlags & CMF_CANRENAME) - { _InsertMenuItem(hmenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); + if(uFlags & CMF_CANRENAME) + { _InsertMenuItem(hmenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); _InsertMenuItem(hmenu, indexMenu++, TRUE, idCmdFirst+IDM_RENAME, MFT_STRING, "&Rename", (IContextMenu_CanRenameItems(This) ? MFS_ENABLED : MFS_DISABLED)); } } else /* file menu */ { _InsertMenuItem(hmenu, indexMenu++, TRUE, idCmdFirst+IDM_OPEN, MFT_STRING, "&Open", MFS_ENABLED|MFS_DEFAULT); - if(uFlags & CMF_CANRENAME) - { _InsertMenuItem(hmenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); + if(uFlags & CMF_CANRENAME) + { _InsertMenuItem(hmenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); _InsertMenuItem(hmenu, indexMenu++, TRUE, idCmdFirst+IDM_RENAME, MFT_STRING, "&Rename", (IContextMenu_CanRenameItems(This) ? MFS_ENABLED : MFS_DISABLED)); } } @@ -217,8 +295,12 @@ static HRESULT WINAPI IContextMenu_fnQueryContextMenu(IContextMenu *iface, HMENU /************************************************************************** * IContextMenu_fnInvokeCommand() */ -static HRESULT WINAPI IContextMenu_fnInvokeCommand(IContextMenu *iface, LPCMINVOKECOMMANDINFO lpcmi) -{ ICOM_THIS(IContextMenuImpl, iface); +static HRESULT WINAPI IContextMenu_fnInvokeCommand( + IContextMenu *iface, + LPCMINVOKECOMMANDINFO lpcmi) +{ + ICOM_THIS(IContextMenuImpl, iface); + LPITEMIDLIST pidlTemp,pidlFQ; LPSHELLBROWSER lpSB; LPSHELLVIEW lpSV; @@ -226,13 +308,13 @@ static HRESULT WINAPI IContextMenu_fnInvokeCommand(IContextMenu *iface, LPCMINVO SHELLEXECUTEINFOA sei; int i; - TRACE(shell,"(%p)->(invcom=%p verb=%p wnd=%x)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd); + TRACE(shell,"(%p)->(invcom=%p verb=%p wnd=%x)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd); if(HIWORD(lpcmi->lpVerb)) { /* get the active IShellView */ lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER,0,0); IShellBrowser_QueryActiveShellView(lpSB, &lpSV); /* does AddRef() on lpSV */ - lpSV->lpvtbl->fnGetWindow(lpSV, &hWndSV); + IShellView_GetWindow(lpSV, &hWndSV); /* these verbs are used by the filedialogs*/ TRACE(shell,"%s\n",lpcmi->lpVerb); @@ -248,7 +330,7 @@ static HRESULT WINAPI IContextMenu_fnInvokeCommand(IContextMenu *iface, LPCMINVO else { FIXME(shell,"please report: unknown verb %s\n",lpcmi->lpVerb); } - lpSV->lpvtbl->fnRelease(lpSV); + IShellView_Release(lpSV); return NOERROR; } @@ -258,18 +340,18 @@ static HRESULT WINAPI IContextMenu_fnInvokeCommand(IContextMenu *iface, LPCMINVO switch(LOWORD(lpcmi->lpVerb)) { case IDM_EXPLORE: case IDM_OPEN: - /* Find the first item in the list that is not a value. These commands - should never be invoked if there isn't at least one folder item in the list.*/ + /* Find the first item in the list that is not a value. These commands + should never be invoked if there isn't at least one folder item in the list.*/ for(i = 0; This->aPidls[i]; i++) { if(!_ILIsValue(This->aPidls[i])) - break; + break; } - + pidlTemp = ILCombine(((IGenericSFImpl*)(This->pSFParent))->mpidl, This->aPidls[i]); pidlFQ = ILCombine(((IGenericSFImpl*)(This->pSFParent))->pMyPidl, pidlTemp); SHFree(pidlTemp); - + ZeroMemory(&sei, sizeof(sei)); sei.cbSize = sizeof(sei); sei.fMask = SEE_MASK_IDLIST | SEE_MASK_CLASSNAME; @@ -277,7 +359,7 @@ static HRESULT WINAPI IContextMenu_fnInvokeCommand(IContextMenu *iface, LPCMINVO sei.lpClass = "folder"; sei.hwnd = lpcmi->hwnd; sei.nShow = SW_SHOWNORMAL; - + if(LOWORD(lpcmi->lpVerb) == IDM_EXPLORE) { sei.lpVerb = "explore"; } @@ -299,9 +381,16 @@ static HRESULT WINAPI IContextMenu_fnInvokeCommand(IContextMenu *iface, LPCMINVO /************************************************************************** * IContextMenu_fnGetCommandString() */ -static HRESULT WINAPI IContextMenu_fnGetCommandString(IContextMenu *iface, UINT idCommand, - UINT uFlags,LPUINT lpReserved,LPSTR lpszName,UINT uMaxNameLen) -{ ICOM_THIS(IContextMenuImpl, iface); +static HRESULT WINAPI IContextMenu_fnGetCommandString( + IContextMenu *iface, + UINT idCommand, + UINT uFlags, + LPUINT lpReserved, + LPSTR lpszName, + UINT uMaxNameLen) +{ + ICOM_THIS(IContextMenuImpl, iface); + HRESULT hr = E_INVALIDARG; TRACE(shell,"(%p)->(idcom=%x flags=%x %p name=%p len=%x)\n",This, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen); @@ -310,7 +399,7 @@ static HRESULT WINAPI IContextMenu_fnGetCommandString(IContextMenu *iface, UINT { case GCS_HELPTEXT: hr = E_NOTIMPL; break; - + case GCS_VERBA: switch(idCommand) { case IDM_RENAME: @@ -345,84 +434,32 @@ static HRESULT WINAPI IContextMenu_fnGetCommandString(IContextMenu *iface, UINT * should be only in IContextMenu2 and IContextMenu3 * is nevertheless called from word95 */ -static HRESULT WINAPI IContextMenu_fnHandleMenuMsg(IContextMenu *iface, UINT uMsg,WPARAM wParam,LPARAM lParam) -{ ICOM_THIS(IContextMenuImpl, iface); +static HRESULT WINAPI IContextMenu_fnHandleMenuMsg( + IContextMenu *iface, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + ICOM_THIS(IContextMenuImpl, iface); + TRACE(shell,"(%p)->(msg=%x wp=%x lp=%lx)\n",This, uMsg, wParam, lParam); + return E_NOTIMPL; } - - /************************************************************************** -* IContextMenu_AllocPidlTable() +* IContextMenu VTable +* */ -BOOL IContextMenu_AllocPidlTable(IContextMenuImpl *This, DWORD dwEntries) -{ TRACE(shell,"(%p)->(entrys=%lu)\n",This, dwEntries); - - /*add one for NULL terminator */ - dwEntries++; - - This->aPidls = (LPITEMIDLIST*)SHAlloc(dwEntries * sizeof(LPITEMIDLIST)); - - if(This->aPidls) - { ZeroMemory(This->aPidls, dwEntries * sizeof(LPITEMIDLIST)); /*set all of the entries to NULL*/ - } - return (This->aPidls != NULL); -} - -/************************************************************************** -* IContextMenu_FreePidlTable() -*/ -void IContextMenu_FreePidlTable(IContextMenuImpl *This) -{ int i; - - TRACE(shell,"(%p)->()\n",This); - - if(This->aPidls) - { for(i = 0; This->aPidls[i]; i++) - { SHFree(This->aPidls[i]); - } - - SHFree(This->aPidls); - This->aPidls = NULL; - } -} - -/************************************************************************** -* IContextMenu_FillPidlTable() -*/ -BOOL IContextMenu_FillPidlTable(IContextMenuImpl *This, LPCITEMIDLIST *aPidls, UINT uItemCount) -{ UINT i; - TRACE(shell,"(%p)->(apidl=%p count=%u)\n",This, aPidls, uItemCount); - if(This->aPidls) - { for(i = 0; i < uItemCount; i++) - { This->aPidls[i] = ILClone(aPidls[i]); - } - return TRUE; - } - return FALSE; -} - -/************************************************************************** -* IContextMenu_CanRenameItems() -*/ -BOOL IContextMenu_CanRenameItems(IContextMenuImpl *This) -{ UINT i; - DWORD dwAttributes; - - TRACE(shell,"(%p)->()\n",This); - - if(This->aPidls) - { for(i = 0; This->aPidls[i]; i++){} /*get the number of items assigned to This object*/ - if(i > 1) /*you can't rename more than one item at a time*/ - { return FALSE; - } - dwAttributes = SFGAO_CANRENAME; - This->pSFParent->lpvtbl->fnGetAttributesOf(This->pSFParent, i, - (LPCITEMIDLIST*)This->aPidls, &dwAttributes); - - return dwAttributes & SFGAO_CANRENAME; - } - return FALSE; -} +static struct ICOM_VTABLE(IContextMenu) cmvt = +{ + IContextMenu_fnQueryInterface, + IContextMenu_fnAddRef, + IContextMenu_fnRelease, + IContextMenu_fnQueryContextMenu, + IContextMenu_fnInvokeCommand, + IContextMenu_fnGetCommandString, + IContextMenu_fnHandleMenuMsg, + (void *) 0xdeadbabe /* just paranoia */ +}; diff --git a/dlls/shell32/folders.c b/dlls/shell32/folders.c index 4b0e4df454e..2f6c6eccf96 100644 --- a/dlls/shell32/folders.c +++ b/dlls/shell32/folders.c @@ -6,113 +6,119 @@ #include #include -#include "debug.h" + #include "wine/obj_base.h" +#include "wine/obj_extracticon.h" + +#include "debug.h" #include "winerror.h" + #include "pidl.h" #include "shell32_main.h" -#include "shlguid.h" - - -/****************************************************************************** -* foreward declaration -*/ - -/* IExtractIcon implementation*/ -static HRESULT WINAPI IExtractIcon_QueryInterface(LPEXTRACTICON, REFIID, LPVOID *); -static ULONG WINAPI IExtractIcon_AddRef(LPEXTRACTICON); -static ULONG WINAPI IExtractIcon_AddRef(LPEXTRACTICON); -static ULONG WINAPI IExtractIcon_Release(LPEXTRACTICON); -static HRESULT WINAPI IExtractIcon_GetIconLocation(LPEXTRACTICON, UINT, LPSTR, UINT, int *, UINT *); -static HRESULT WINAPI IExtractIcon_Extract(LPEXTRACTICON, LPCSTR, UINT, HICON *, HICON *, UINT); /*********************************************************************** -* IExtractIcon implementation +* IExtractIconA implementation */ -static struct IExtractIcon_VTable eivt = -{ IExtractIcon_QueryInterface, - IExtractIcon_AddRef, - IExtractIcon_Release, - IExtractIcon_GetIconLocation, - IExtractIcon_Extract -}; + +typedef struct +{ ICOM_VTABLE(IExtractIconA)* lpvtbl; + DWORD ref; + LPITEMIDLIST pidl; +} IExtractIconAImpl; + +static struct ICOM_VTABLE(IExtractIconA) eivt; + + /************************************************************************** -* IExtractIcon_Constructor +* IExtractIconA_Constructor */ -LPEXTRACTICON IExtractIcon_Constructor(LPCITEMIDLIST pidl) -{ LPEXTRACTICON ei; +IExtractIconA* IExtractIconA_Constructor(LPCITEMIDLIST pidl) +{ + IExtractIconAImpl* ei; - ei=(LPEXTRACTICON)HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIcon)); - ei->ref=1; - ei->lpvtbl=&eivt; - ei->pidl=ILClone(pidl); + ei=(IExtractIconAImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIconAImpl)); + ei->ref=1; + ei->lpvtbl=&eivt; + ei->pidl=ILClone(pidl); - pdump(pidl); + pdump(pidl); TRACE(shell,"(%p)\n",ei); shell32_ObjCount++; - return ei; + return (IExtractIconA *)ei; } /************************************************************************** - * IExtractIcon_QueryInterface + * IExtractIconA_QueryInterface */ -static HRESULT WINAPI IExtractIcon_QueryInterface( LPEXTRACTICON this, REFIID riid, LPVOID *ppvObj) -{ char xriid[50]; - WINE_StringFromCLSID((LPCLSID)riid,xriid); - TRACE(shell,"(%p)->(\n\tIID:\t%s,%p)\n",this,xriid,ppvObj); +static HRESULT WINAPI IExtractIconA_fnQueryInterface( IExtractIconA * iface, REFIID riid, LPVOID *ppvObj) +{ + ICOM_THIS(IExtractIconAImpl,iface); - *ppvObj = NULL; + char xriid[50]; + WINE_StringFromCLSID((LPCLSID)riid,xriid); + TRACE(shell,"(%p)->(\n\tIID:\t%s,%p)\n",This,xriid,ppvObj); - if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ - { *ppvObj = this; - } - else if(IsEqualIID(riid, &IID_IExtractIcon)) /*IExtractIcon*/ - { *ppvObj = (IExtractIcon*)this; - } + *ppvObj = NULL; - if(*ppvObj) - { (*(LPEXTRACTICON*)ppvObj)->lpvtbl->fnAddRef(this); - TRACE(shell,"-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); - return S_OK; - } + if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ + { *ppvObj = This; + } + else if(IsEqualIID(riid, &IID_IExtractIconA)) /*IExtractIcon*/ + { *ppvObj = (IExtractIconA*)This; + } + + if(*ppvObj) + { IExtractIconA_AddRef((IExtractIconA*) *ppvObj); + TRACE(shell,"-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); + return S_OK; + } TRACE(shell,"-- Interface: E_NOINTERFACE\n"); return E_NOINTERFACE; -} +} /************************************************************************** -* IExtractIcon_AddRef +* IExtractIconA_AddRef */ -static ULONG WINAPI IExtractIcon_AddRef(LPEXTRACTICON this) -{ TRACE(shell,"(%p)->(count=%lu)\n",this,(this->ref)+1); +static ULONG WINAPI IExtractIconA_fnAddRef(IExtractIconA * iface) +{ + ICOM_THIS(IExtractIconAImpl,iface); + + TRACE(shell,"(%p)->(count=%lu)\n",This,(This->ref)+1); shell32_ObjCount++; - return ++(this->ref); + return ++(This->ref); } /************************************************************************** -* IExtractIcon_Release +* IExtractIconA_Release */ -static ULONG WINAPI IExtractIcon_Release(LPEXTRACTICON this) -{ TRACE(shell,"(%p)->()\n",this); +static ULONG WINAPI IExtractIconA_fnRelease(IExtractIconA * iface) +{ + ICOM_THIS(IExtractIconAImpl,iface); + + TRACE(shell,"(%p)->()\n",This); shell32_ObjCount--; - if (!--(this->ref)) - { TRACE(shell," destroying IExtractIcon(%p)\n",this); - SHFree(this->pidl); - HeapFree(GetProcessHeap(),0,this); - return 0; - } - return this->ref; + if (!--(This->ref)) + { TRACE(shell," destroying IExtractIcon(%p)\n",This); + SHFree(This->pidl); + HeapFree(GetProcessHeap(),0,This); + return 0; + } + return This->ref; } /************************************************************************** -* IExtractIcon_GetIconLocation +* IExtractIconA_GetIconLocation */ -static HRESULT WINAPI IExtractIcon_GetIconLocation(LPEXTRACTICON this, UINT uFlags, LPSTR szIconFile, UINT cchMax, int * piIndex, UINT * pwFlags) -{ WARN (shell,"(%p) (flags=%u file=%s max=%u %p %p) semi-stub\n", this, uFlags, szIconFile, cchMax, piIndex, pwFlags); +static HRESULT WINAPI IExtractIconA_fnGetIconLocation(IExtractIconA * iface, UINT uFlags, LPSTR szIconFile, UINT cchMax, int * piIndex, UINT * pwFlags) +{ + ICOM_THIS(IExtractIconAImpl,iface); - *piIndex = (int) SHMapPIDLToSystemImageListIndex(0, this->pidl,0); + WARN (shell,"(%p) (flags=%u file=%s max=%u %p %p) semi-stub\n", This, uFlags, szIconFile, cchMax, piIndex, pwFlags); + + *piIndex = (int) SHMapPIDLToSystemImageListIndex(0, This->pidl,0); *pwFlags = GIL_NOTFILENAME; WARN (shell,"-- %x\n",*piIndex); @@ -120,12 +126,23 @@ static HRESULT WINAPI IExtractIcon_GetIconLocation(LPEXTRACTICON this, UINT uFla return NOERROR; } /************************************************************************** -* IExtractIcon_Extract +* IExtractIconA_Extract */ -static HRESULT WINAPI IExtractIcon_Extract(LPEXTRACTICON this, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) -{ FIXME (shell,"(%p) (file=%s index=%u %p %p size=%u) semi-stub\n", this, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize); - *phiconLarge = pImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT); - *phiconSmall = pImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT); - return S_OK; +static HRESULT WINAPI IExtractIconA_fnExtract(IExtractIconA * iface, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) +{ + ICOM_THIS(IExtractIconAImpl,iface); + + FIXME (shell,"(%p) (file=%s index=%u %p %p size=%u) semi-stub\n", This, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize); + + *phiconLarge = pImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT); + *phiconSmall = pImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT); + return S_OK; } +static struct ICOM_VTABLE(IExtractIconA) eivt = +{ IExtractIconA_fnQueryInterface, + IExtractIconA_fnAddRef, + IExtractIconA_fnRelease, + IExtractIconA_fnGetIconLocation, + IExtractIconA_fnExtract +}; diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c index 948d6b26ad8..9eecb03e074 100644 --- a/dlls/shell32/shell32_main.c +++ b/dlls/shell32/shell32_main.c @@ -1089,9 +1089,9 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) { pdesktopfolder->lpvtbl->fnRelease(pdesktopfolder); } - /* this one is here ot check if AddRef/Release is balanced */ + /* this one is here to check if AddRef/Release is balanced */ if (shell32_ObjCount) - { FIXME(shell,"%u objects left\n", shell32_ObjCount); + { WARN(shell,"leaving with %u objects left (memory leak)\n", shell32_ObjCount); } } TRACE(shell, "refcount=%u objcount=%u \n", shell32_RefCount, shell32_ObjCount); diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index f49a26fe763..e9b319f53a7 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -86,7 +86,11 @@ extern LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER, LPCITEMIDLIST); extern LPSHELLLINK IShellLink_Constructor(void); extern LPSHELLLINKW IShellLinkW_Constructor(void); extern LPENUMIDLIST IEnumIDList_Constructor(LPCSTR,DWORD); -extern LPEXTRACTICON IExtractIcon_Constructor(LPITEMIDLIST); +extern LPEXTRACTICONA IExtractIconA_Constructor(LPITEMIDLIST); + +/* fixme: rename the functions when the shell32.dll has it's own exports namespace */ +HRESULT WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv); +HRESULT WINAPI SHELL32_DllCanUnloadNow(void); /* elements of this structure are accessed directly from within shell32 */ typedef struct diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index f34435d3a36..7825fa55025 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -8,17 +8,23 @@ #include #include -#include "winreg.h" -#include "winerror.h" + #include "wine/obj_base.h" -#include "winversion.h" +#include "wine/obj_shelllink.h" +#include "wine/obj_shellfolder.h" +#include "wine/obj_shellbrowser.h" +#include "wine/obj_contextmenu.h" +#include "wine/obj_shellextinit.h" +#include "wine/obj_extracticon.h" #include "shlguid.h" -#include "shlobj.h" -#include "shell32_main.h" - +#include "winversion.h" +#include "winreg.h" +#include "winerror.h" #include "debug.h" +#include "shell32_main.h" + /************************************************************************* * */ @@ -149,12 +155,9 @@ LRESULT WINAPI SHCoCreateInstance(LPSTR aclsid,CLSID *clsid,LPUNKNOWN unknownout * With this pointer it's possible to call the IClassFactory_CreateInstance * method to get a instance of the requested Class. * This function does NOT instantiate the Class!!! - * - * RETURNS - * HRESULT * */ -DWORD WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid,REFIID iid,LPVOID *ppv) +HRESULT WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid,REFIID iid,LPVOID *ppv) { HRESULT hres = E_OUTOFMEMORY; LPCLASSFACTORY lpclf; @@ -317,16 +320,16 @@ static HRESULT WINAPI IClassFactory_fnCreateInstance( } else if (IsEqualIID(riid, &IID_IShellView)) { pObj = (IUnknown *)IShellView_Constructor(NULL,NULL); - } - else if (IsEqualIID(riid, &IID_IExtractIcon)) - { pObj = (IUnknown *)IExtractIcon_Constructor(NULL); + } + else if (IsEqualIID(riid, &IID_IExtractIconA)) + { pObj = (IUnknown *)IExtractIconA_Constructor(NULL); } else if (IsEqualIID(riid, &IID_IContextMenu)) { pObj = (IUnknown *)IContextMenu_Constructor(NULL, NULL, 0); - } + } else if (IsEqualIID(riid, &IID_IDataObject)) { pObj = (IUnknown *)IDataObject_Constructor(0,NULL,NULL,0); - } + } else { ERR(shell,"unknown IID requested\n\tIID:\t%s\n",xriid); return(E_NOINTERFACE); diff --git a/dlls/shell32/shlfolder.c b/dlls/shell32/shlfolder.c index ada3c799603..250366d13b1 100644 --- a/dlls/shell32/shlfolder.c +++ b/dlls/shell32/shlfolder.c @@ -752,13 +752,13 @@ static HRESULT WINAPI IShellFolder_fnGetUIObjectOf( pObj = (LPUNKNOWN)IDataObject_Constructor (hwndOwner, (IShellFolder *)This, apidl, cidl); } - else if(IsEqualIID(riid, &IID_IExtractIcon)) + else if(IsEqualIID(riid, &IID_IExtractIconA)) { if (cidl != 1) return(E_INVALIDARG); pidl = ILCombine(This->pMyPidl,apidl[0]); - pObj = (LPUNKNOWN)IExtractIcon_Constructor( pidl ); + pObj = (LPUNKNOWN)IExtractIconA_Constructor( pidl ); SHFree(pidl); } else if (IsEqualIID(riid, &IID_IDropTarget)) diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c index 8d1f6d4aa59..5fad2b47856 100644 --- a/dlls/shell32/shlview.c +++ b/dlls/shell32/shlview.c @@ -11,30 +11,57 @@ #include #include +#include "servprov.h" +#include "wine/obj_base.h" +#include "wine/obj_shellfolder.h" +#include "wine/obj_shellview.h" +#include "wine/obj_commdlgbrowser.h" +#include "wine/obj_shellbrowser.h" +#include "wine/obj_dockingwindowframe.h" +#include "wine/obj_extracticon.h" + +#include "shresdef.h" +#include "spy.h" +#include "debug.h" #include "winerror.h" #include "pidl.h" -#include "shlguid.h" -#include "shlobj.h" -#include "servprov.h" -#include "wine/obj_base.h" -#include "if_macros.h" #include "shell32_main.h" -#include "shresdef.h" -#include "spy.h" -#include "debug.h" +typedef struct +{ ICOM_VTABLE(IShellView)* lpvtbl; + DWORD ref; + LPITEMIDLIST mpidl; + IShellFolder* pSFParent; + IShellBrowser* pShellBrowser; + ICommDlgBrowser* pCommDlgBrowser; + HWND hWnd; + HWND hWndList; + HWND hWndParent; + FOLDERSETTINGS FolderSettings; + HMENU hMenu; + UINT uState; + UINT uSelected; + LPITEMIDLIST *aSelectedItems; +} IShellViewImpl; + +static struct ICOM_VTABLE(IShellView) svvt; /*********************************************************************** * IShellView implementation */ +/* static HRESULT WINAPI IShellView_QueryInterface(LPSHELLVIEW,REFIID, LPVOID *); static ULONG WINAPI IShellView_AddRef(LPSHELLVIEW) ; static ULONG WINAPI IShellView_Release(LPSHELLVIEW); +*/ /* IOleWindow methods */ +/* static HRESULT WINAPI IShellView_GetWindow(LPSHELLVIEW,HWND * lphwnd); static HRESULT WINAPI IShellView_ContextSensitiveHelp(LPSHELLVIEW,BOOL fEnterMode); +*/ /* IShellView methods */ +/* static HRESULT WINAPI IShellView_TranslateAccelerator(LPSHELLVIEW,LPMSG lpmsg); static HRESULT WINAPI IShellView_EnableModeless(LPSHELLVIEW,BOOL fEnable); static HRESULT WINAPI IShellView_UIActivate(LPSHELLVIEW,UINT uState); @@ -48,26 +75,7 @@ static HRESULT WINAPI IShellView_SelectItem(LPSHELLVIEW, LPCITEMIDLIST pidlItem, static HRESULT WINAPI IShellView_GetItemObject(LPSHELLVIEW, UINT uItem, REFIID riid,LPVOID *ppv); static BOOL ShellView_CanDoIDockingWindow(LPSHELLVIEW); - -static struct IShellView_VTable svvt = -{ IShellView_QueryInterface, - IShellView_AddRef, - IShellView_Release, - IShellView_GetWindow, - IShellView_ContextSensitiveHelp, - IShellView_TranslateAccelerator, - IShellView_EnableModeless, - IShellView_UIActivate, - IShellView_Refresh, - IShellView_CreateViewWindow, - IShellView_DestroyViewWindow, - IShellView_GetCurrentInfo, - IShellView_AddPropertySheetPages, - IShellView_SaveViewState, - IShellView_SelectItem, - IShellView_GetItemObject -}; - +*/ /*menu items */ #define IDM_VIEW_FILES (FCIDM_SHVIEWFIRST + 0x500) #define IDM_VIEW_IDW (FCIDM_SHVIEWFIRST + 0x501) @@ -113,79 +121,84 @@ typedef void (CALLBACK *PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMa /************************************************************************** * IShellView_Constructor */ -LPSHELLVIEW IShellView_Constructor( LPSHELLFOLDER pFolder, LPCITEMIDLIST pidl) -{ LPSHELLVIEW sv; - sv=(LPSHELLVIEW)HeapAlloc(GetProcessHeap(),0,sizeof(IShellView)); +IShellView * IShellView_Constructor( IShellFolder * pFolder, LPCITEMIDLIST pidl) +{ IShellViewImpl * sv; + sv=(IShellViewImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IShellViewImpl)); sv->ref=1; sv->lpvtbl=&svvt; - + sv->mpidl = ILClone(pidl); sv->hMenu = 0; sv->pSFParent = pFolder; sv->uSelected = 0; sv->aSelectedItems = NULL; - if(sv->pSFParent) - sv->pSFParent->lpvtbl->fnAddRef(sv->pSFParent); + if(pFolder) + IShellFolder_AddRef(pFolder); TRACE(shell,"(%p)->(%p pidl=%p)\n",sv, pFolder, pidl); shell32_ObjCount++; - return sv; + return (IShellView *) sv; } /************************************************************************** * helperfunctions for communication with ICommDlgBrowser * */ -static BOOL IsInCommDlg(LPSHELLVIEW this) -{ return(this->pCommDlgBrowser != NULL); +static BOOL IsInCommDlg(IShellViewImpl * This) +{ return(This->pCommDlgBrowser != NULL); } -static HRESULT IncludeObject(LPSHELLVIEW this, LPCITEMIDLIST pidl) -{ if ( IsInCommDlg(this) ) +static HRESULT IncludeObject(IShellViewImpl * This, LPCITEMIDLIST pidl) +{ + if ( IsInCommDlg(This) ) { TRACE(shell,"ICommDlgBrowser::IncludeObject pidl=%p\n", pidl); - return (this->pCommDlgBrowser->lpvtbl->fnIncludeObject(this->pCommDlgBrowser, this, pidl)); + return (ICommDlgBrowser_IncludeObject(This->pCommDlgBrowser, (IShellView*)This, pidl)); } return S_OK; } -static HRESULT OnDefaultCommand(LPSHELLVIEW this) -{ if (IsInCommDlg(this)) + +static HRESULT OnDefaultCommand(IShellViewImpl * This) +{ + if (IsInCommDlg(This)) { TRACE(shell,"ICommDlgBrowser::OnDefaultCommand\n"); - return (this->pCommDlgBrowser->lpvtbl->fnOnDefaultCommand(this->pCommDlgBrowser, this)); + return (ICommDlgBrowser_OnDefaultCommand(This->pCommDlgBrowser, (IShellView*)This)); } return S_FALSE; } -static HRESULT OnStateChange(LPSHELLVIEW this, UINT uFlags) -{ if (IsInCommDlg(this)) + +static HRESULT OnStateChange(IShellViewImpl * This, UINT uFlags) +{ + if (IsInCommDlg(This)) { TRACE(shell,"ICommDlgBrowser::OnStateChange flags=%x\n", uFlags); - return (this->pCommDlgBrowser->lpvtbl->fnOnStateChange(this->pCommDlgBrowser, this, uFlags)); + return (ICommDlgBrowser_OnStateChange(This->pCommDlgBrowser, (IShellView*)This, uFlags)); } return S_FALSE; } -static void SetStyle(LPSHELLVIEW this, DWORD dwAdd, DWORD dwRemove) +static void SetStyle(IShellViewImpl * This, DWORD dwAdd, DWORD dwRemove) { DWORD tmpstyle; - TRACE(shell,"(%p)\n", this); + TRACE(shell,"(%p)\n", This); - tmpstyle = GetWindowLongA(this->hWndList, GWL_STYLE); - SetWindowLongA(this->hWndList, GWL_STYLE, dwAdd | (tmpstyle & ~dwRemove)); + tmpstyle = GetWindowLongA(This->hWndList, GWL_STYLE); + SetWindowLongA(This->hWndList, GWL_STYLE, dwAdd | (tmpstyle & ~dwRemove)); } -static void CheckToolbar(LPSHELLVIEW this) +static void CheckToolbar(IShellViewImpl * This) { LRESULT result; TRACE(shell,"\n"); - IShellBrowser_SendControlMsg(this->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON, - FCIDM_TB_SMALLICON, (this->FolderSettings.ViewMode==FVM_LIST)? TRUE : FALSE, &result); - IShellBrowser_SendControlMsg(this->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON, - FCIDM_TB_REPORTVIEW, (this->FolderSettings.ViewMode==FVM_DETAILS)? TRUE : FALSE, &result); - IShellBrowser_SendControlMsg(this->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON, + IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON, + FCIDM_TB_SMALLICON, (This->FolderSettings.ViewMode==FVM_LIST)? TRUE : FALSE, &result); + IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON, + FCIDM_TB_REPORTVIEW, (This->FolderSettings.ViewMode==FVM_DETAILS)? TRUE : FALSE, &result); + IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON, FCIDM_TB_SMALLICON, TRUE, &result); - IShellBrowser_SendControlMsg(this->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON, + IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON, FCIDM_TB_REPORTVIEW, TRUE, &result); TRACE(shell,"--\n"); } -static void MergeToolBar(LPSHELLVIEW this) +static void MergeToolBar(IShellViewImpl * This) { LRESULT iStdBMOffset; LRESULT iViewBMOffset; TBADDBITMAP ab; @@ -208,13 +221,13 @@ static void MergeToolBar(LPSHELLVIEW this) ab.hInst = HINST_COMMCTRL; /* hinstCommctrl */ ab.nID = IDB_STD_SMALL_COLOR; /* std bitmaps */ - IShellBrowser_SendControlMsg(this->pShellBrowser,FCW_TOOLBAR, + IShellBrowser_SendControlMsg(This->pShellBrowser,FCW_TOOLBAR, TB_ADDBITMAP, 8, (LPARAM)&ab, &iStdBMOffset); TRACE(shell,"TB_ADDBITMAP returns %lx\n", iStdBMOffset); ab.nID = IDB_VIEW_SMALL_COLOR; /* std view bitmaps */ - IShellBrowser_SendControlMsg(this->pShellBrowser,FCW_TOOLBAR, + IShellBrowser_SendControlMsg(This->pShellBrowser,FCW_TOOLBAR, TB_ADDBITMAP, 8, (LPARAM)&ab, &iViewBMOffset); TRACE(shell,"TB_ADDBITMAP returns %lx\n", iViewBMOffset); @@ -231,9 +244,9 @@ static void MergeToolBar(LPSHELLVIEW this) } } - IShellBrowser_SetToolbarItems(this->pShellBrowser,tbActual, 6, FCT_MERGE); + IShellBrowser_SetToolbarItems(This->pShellBrowser,tbActual, 6, FCT_MERGE); - CheckToolbar(this); + CheckToolbar(This); TRACE(shell,"--\n"); } @@ -243,35 +256,35 @@ static void MergeToolBar(LPSHELLVIEW this) * */ -BOOL ShellView_CreateList (LPSHELLVIEW this) +BOOL ShellView_CreateList (IShellViewImpl * This) { DWORD dwStyle; - TRACE(shell,"%p\n",this); + TRACE(shell,"%p\n",This); dwStyle = WS_TABSTOP | WS_VISIBLE | WS_CHILD | WS_BORDER | LVS_SHAREIMAGELISTS | LVS_EDITLABELS | LVS_ALIGNLEFT; - switch (this->FolderSettings.ViewMode) + switch (This->FolderSettings.ViewMode) { case FVM_ICON: dwStyle |= LVS_ICON; break; case FVM_DETAILS: dwStyle |= LVS_REPORT; break; case FVM_SMALLICON: dwStyle |= LVS_SMALLICON; break; case FVM_LIST: dwStyle |= LVS_LIST; break; default: dwStyle |= LVS_LIST; break; } - if (this->FolderSettings.fFlags && FWF_AUTOARRANGE) dwStyle |= LVS_AUTOARRANGE; - /*if (this->FolderSettings.fFlags && FWF_DESKTOP); used from explorer*/ - if (this->FolderSettings.fFlags && FWF_SINGLESEL) dwStyle |= LVS_SINGLESEL; + if (This->FolderSettings.fFlags && FWF_AUTOARRANGE) dwStyle |= LVS_AUTOARRANGE; + /*if (This->FolderSettings.fFlags && FWF_DESKTOP); used from explorer*/ + if (This->FolderSettings.fFlags && FWF_SINGLESEL) dwStyle |= LVS_SINGLESEL; - this->hWndList=CreateWindowExA( WS_EX_CLIENTEDGE, + This->hWndList=CreateWindowExA( WS_EX_CLIENTEDGE, WC_LISTVIEWA, NULL, dwStyle, 0,0,0,0, - this->hWnd, + This->hWnd, (HMENU)ID_LISTVIEW, shell32_hInstance, NULL); - if(!this->hWndList) + if(!This->hWndList) return FALSE; /* UpdateShellSettings(); */ @@ -288,13 +301,13 @@ int nColumn2=80; int nColumn3=170; int nColumn4=60; -BOOL ShellView_InitList(LPSHELLVIEW this) +BOOL ShellView_InitList(IShellViewImpl * This) { LVCOLUMNA lvColumn; CHAR szString[50]; - TRACE(shell,"%p\n",this); + TRACE(shell,"%p\n",This); - ListView_DeleteAllItems(this->hWndList); + ListView_DeleteAllItems(This->hWndList); /*initialize the columns */ lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; /* | LVCF_SUBITEM;*/ @@ -304,22 +317,22 @@ BOOL ShellView_InitList(LPSHELLVIEW this) lvColumn.cx = nColumn1; strcpy(szString,"File"); /*LoadStringA(shell32_hInstance, IDS_COLUMN1, szString, sizeof(szString));*/ - ListView_InsertColumnA(this->hWndList, 0, &lvColumn); + ListView_InsertColumnA(This->hWndList, 0, &lvColumn); lvColumn.cx = nColumn2; strcpy(szString,"Size"); - ListView_InsertColumnA(this->hWndList, 1, &lvColumn); + ListView_InsertColumnA(This->hWndList, 1, &lvColumn); lvColumn.cx = nColumn3; strcpy(szString,"Type"); - ListView_InsertColumnA(this->hWndList, 2, &lvColumn); + ListView_InsertColumnA(This->hWndList, 2, &lvColumn); lvColumn.cx = nColumn4; strcpy(szString,"Modified"); - ListView_InsertColumnA(this->hWndList, 3, &lvColumn); + ListView_InsertColumnA(This->hWndList, 3, &lvColumn); - ListView_SetImageList(this->hWndList, ShellSmallIconList, LVSIL_SMALL); - ListView_SetImageList(this->hWndList, ShellBigIconList, LVSIL_NORMAL); + ListView_SetImageList(This->hWndList, ShellSmallIconList, LVSIL_SMALL); + ListView_SetImageList(This->hWndList, ShellBigIconList, LVSIL_NORMAL); return TRUE; } @@ -348,7 +361,7 @@ INT CALLBACK ShellView_CompareItems(LPVOID lParam1, LPVOID lParam2, LPARAM lpDat * internal */ -static HRESULT ShellView_FillList(LPSHELLVIEW this) +static HRESULT ShellView_FillList(IShellViewImpl * This) { LPENUMIDLIST pEnumIDList; LPITEMIDLIST pidl; DWORD dwFetched; @@ -357,56 +370,56 @@ static HRESULT ShellView_FillList(LPSHELLVIEW this) HRESULT hRes; HDPA hdpa; - TRACE(shell,"%p\n",this); + TRACE(shell,"%p\n",This); /* get the itemlist from the shfolder*/ - hRes = this->pSFParent->lpvtbl->fnEnumObjects(this->pSFParent,this->hWnd, SHCONTF_NONFOLDERS | SHCONTF_FOLDERS, &pEnumIDList); - if (hRes != S_OK) - { if (hRes==S_FALSE) + hRes = IShellFolder_EnumObjects(This->pSFParent,This->hWnd, SHCONTF_NONFOLDERS | SHCONTF_FOLDERS, &pEnumIDList); + if (hRes != S_OK) + { if (hRes==S_FALSE) return(NOERROR); return(hRes); - } + } /* create a pointer array */ - hdpa = pDPA_Create(16); + hdpa = pDPA_Create(16); if (!hdpa) { return(E_OUTOFMEMORY); } /* copy the items into the array*/ - while((S_OK == pEnumIDList->lpvtbl->fnNext(pEnumIDList,1, &pidl, &dwFetched)) && dwFetched) + while((S_OK == IEnumIDList_Next(pEnumIDList,1, &pidl, &dwFetched)) && dwFetched) { if (pDPA_InsertPtr(hdpa, 0x7fff, pidl) == -1) { SHFree(pidl); - } + } } /*sort the array*/ - pDPA_Sort(hdpa, ShellView_CompareItems, (LPARAM)this->pSFParent); + pDPA_Sort(hdpa, ShellView_CompareItems, (LPARAM)This->pSFParent); /*turn the listview's redrawing off*/ - SendMessageA(this->hWndList, WM_SETREDRAW, FALSE, 0); + SendMessageA(This->hWndList, WM_SETREDRAW, FALSE, 0); - for (i=0; i < DPA_GetPtrCount(hdpa); ++i) /* DPA_GetPtrCount is a macro*/ - { pidl = (LPITEMIDLIST)DPA_GetPtr(hdpa, i); - if (IncludeObject(this, pidl) == S_OK) /* in a commdlg this works as a filemask*/ + for (i=0; i < DPA_GetPtrCount(hdpa); ++i) /* DPA_GetPtrCount is a macro*/ + { pidl = (LPITEMIDLIST)DPA_GetPtr(hdpa, i); + if (IncludeObject(This, pidl) == S_OK) /* in a commdlg This works as a filemask*/ { ZeroMemory(&lvItem, sizeof(lvItem)); /* create the listviewitem*/ lvItem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; /*set the mask*/ - lvItem.iItem = ListView_GetItemCount(this->hWndList); /*add the item to the end of the list*/ + lvItem.iItem = ListView_GetItemCount(This->hWndList); /*add the item to the end of the list*/ lvItem.lParam = (LPARAM) pidl; /*set the item's data*/ lvItem.pszText = LPSTR_TEXTCALLBACKA; /*get text on a callback basis*/ lvItem.iImage = I_IMAGECALLBACK; /*get the image on a callback basis*/ - ListView_InsertItemA(this->hWndList, &lvItem); + ListView_InsertItemA(This->hWndList, &lvItem); } else SHFree(pidl); /* the listview has the COPY*/ - } + } /*turn the listview's redrawing back on and force it to draw*/ - SendMessageA(this->hWndList, WM_SETREDRAW, TRUE, 0); - InvalidateRect(this->hWndList, NULL, TRUE); - UpdateWindow(this->hWndList); + SendMessageA(This->hWndList, WM_SETREDRAW, TRUE, 0); + InvalidateRect(This->hWndList, NULL, TRUE); + UpdateWindow(This->hWndList); - pEnumIDList->lpvtbl->fnRelease(pEnumIDList); /* destroy the list*/ + IEnumIDList_Release(pEnumIDList); /* destroy the list*/ pDPA_Destroy(hdpa); return S_OK; @@ -418,12 +431,12 @@ static HRESULT ShellView_FillList(LPSHELLVIEW this) * NOTES * internal */ -LRESULT ShellView_OnCreate(LPSHELLVIEW this) -{ TRACE(shell,"%p\n",this); +LRESULT ShellView_OnCreate(IShellViewImpl * This) +{ TRACE(shell,"%p\n",This); - if(ShellView_CreateList(this)) - { if(ShellView_InitList(this)) - { ShellView_FillList(this); + if(ShellView_CreateList(This)) + { if(ShellView_InitList(This)) + { ShellView_FillList(This); } } @@ -432,12 +445,12 @@ LRESULT ShellView_OnCreate(LPSHELLVIEW this) /************************************************************************** * ShellView_OnSize() */ -LRESULT ShellView_OnSize(LPSHELLVIEW this, WORD wWidth, WORD wHeight) -{ TRACE(shell,"%p width=%u height=%u\n",this, wWidth,wHeight); +LRESULT ShellView_OnSize(IShellViewImpl * This, WORD wWidth, WORD wHeight) +{ TRACE(shell,"%p width=%u height=%u\n",This, wWidth,wHeight); /*resize the ListView to fit our window*/ - if(this->hWndList) - { MoveWindow(this->hWndList, 0, 0, wWidth, wHeight, TRUE); + if(This->hWndList) + { MoveWindow(This->hWndList, 0, 0, wWidth, wHeight, TRUE); } return S_OK; @@ -445,13 +458,13 @@ LRESULT ShellView_OnSize(LPSHELLVIEW this, WORD wWidth, WORD wHeight) /************************************************************************** * ShellView_BuildFileMenu() */ -HMENU ShellView_BuildFileMenu(LPSHELLVIEW this) +HMENU ShellView_BuildFileMenu(IShellViewImpl * This) { CHAR szText[MAX_PATH]; MENUITEMINFOA mii; int nTools,i; HMENU hSubMenu; - TRACE(shell,"(%p) semi-stub\n",this); + TRACE(shell,"(%p) semi-stub\n",This); hSubMenu = CreatePopupMenu(); if(hSubMenu) @@ -475,7 +488,7 @@ HMENU ShellView_BuildFileMenu(LPSHELLVIEW this) else { mii.fType = MFT_SEPARATOR; } - /* tack this item onto the end of the menu */ + /* tack This item onto the end of the menu */ InsertMenuItemA(hSubMenu, (UINT)-1, TRUE, &mii); } } @@ -485,11 +498,11 @@ HMENU ShellView_BuildFileMenu(LPSHELLVIEW this) /************************************************************************** * ShellView_MergeFileMenu() */ -void ShellView_MergeFileMenu(LPSHELLVIEW this, HMENU hSubMenu) -{ TRACE(shell,"(%p)->(submenu=0x%08x) stub\n",this,hSubMenu); +void ShellView_MergeFileMenu(IShellViewImpl * This, HMENU hSubMenu) +{ TRACE(shell,"(%p)->(submenu=0x%08x) stub\n",This,hSubMenu); if(hSubMenu) - { /*insert this item at the beginning of the menu */ + { /*insert This item at the beginning of the menu */ _InsertMenuItem(hSubMenu, 0, TRUE, 0, MFT_SEPARATOR, NULL, MFS_ENABLED); _InsertMenuItem(hSubMenu, 0, TRUE, IDM_MYFILEITEM, MFT_STRING, "dummy45", MFS_ENABLED); @@ -501,10 +514,10 @@ void ShellView_MergeFileMenu(LPSHELLVIEW this, HMENU hSubMenu) * ShellView_MergeViewMenu() */ -void ShellView_MergeViewMenu(LPSHELLVIEW this, HMENU hSubMenu) +void ShellView_MergeViewMenu(IShellViewImpl * This, HMENU hSubMenu) { MENUITEMINFOA mii; - TRACE(shell,"(%p)->(submenu=0x%08x)\n",this,hSubMenu); + TRACE(shell,"(%p)->(submenu=0x%08x)\n",This,hSubMenu); if(hSubMenu) { /*add a separator at the correct position in the menu*/ @@ -513,20 +526,45 @@ void ShellView_MergeViewMenu(LPSHELLVIEW this, HMENU hSubMenu) ZeroMemory(&mii, sizeof(mii)); mii.cbSize = sizeof(mii); mii.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_DATA;; - mii.fType = MFT_STRING; - mii.dwTypeData = "View"; + mii.fType = MFT_STRING; + mii.dwTypeData = "View"; mii.hSubMenu = LoadMenuIndirectA(&_Resource_Men_MENU_001_0_data); InsertMenuItemA(hSubMenu, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE, &mii); } } + +/************************************************************************** +* ShellView_CanDoIDockingWindow() +*/ +BOOL ShellView_CanDoIDockingWindow(IShellViewImpl * This) +{ BOOL bReturn = FALSE; + HRESULT hr; + LPSERVICEPROVIDER pSP; + LPDOCKINGWINDOWFRAME pFrame; + + FIXME(shell,"(%p) stub\n",This); + + /*get the browser's IServiceProvider*/ + hr = IShellBrowser_QueryInterface(This->pShellBrowser, (REFIID)&IID_IServiceProvider, (LPVOID*)&pSP); + if(hr==S_OK) + { hr = IServiceProvider_QueryService(pSP, (REFGUID)&SID_SShellBrowser, (REFIID)&IID_IDockingWindowFrame, (LPVOID*)&pFrame); + if(SUCCEEDED(hr)) + { bReturn = TRUE; + pFrame->lpvtbl->fnRelease(pFrame); + } + IServiceProvider_Release(pSP); + } + return bReturn; +} + /************************************************************************** * ShellView_UpdateMenu() */ -LRESULT ShellView_UpdateMenu(LPSHELLVIEW this, HMENU hMenu) -{ TRACE(shell,"(%p)->(menu=0x%08x)\n",this,hMenu); +LRESULT ShellView_UpdateMenu(IShellViewImpl * This, HMENU hMenu) +{ TRACE(shell,"(%p)->(menu=0x%08x)\n",This,hMenu); CheckMenuItem(hMenu, IDM_VIEW_FILES, MF_BYCOMMAND | (g_bViewKeys ? MF_CHECKED: MF_UNCHECKED)); - if(ShellView_CanDoIDockingWindow(this)) + if(ShellView_CanDoIDockingWindow(This)) { EnableMenuItem(hMenu, IDM_VIEW_IDW, MF_BYCOMMAND | MF_ENABLED); CheckMenuItem(hMenu, IDM_VIEW_IDW, MF_BYCOMMAND | (g_bShowIDW ? MF_CHECKED: MF_UNCHECKED)); } @@ -543,44 +581,44 @@ LRESULT ShellView_UpdateMenu(LPSHELLVIEW this, HMENU hMenu) * NOTES * internal */ -void ShellView_OnDeactivate(LPSHELLVIEW this) -{ TRACE(shell,"%p\n",this); - if(this->uState != SVUIA_DEACTIVATE) - { if(this->hMenu) - { IShellBrowser_SetMenuSB(this->pShellBrowser,0, 0, 0); - IShellBrowser_RemoveMenusSB(this->pShellBrowser,this->hMenu); - DestroyMenu(this->hMenu); - this->hMenu = 0; +void ShellView_OnDeactivate(IShellViewImpl * This) +{ TRACE(shell,"%p\n",This); + if(This->uState != SVUIA_DEACTIVATE) + { if(This->hMenu) + { IShellBrowser_SetMenuSB(This->pShellBrowser,0, 0, 0); + IShellBrowser_RemoveMenusSB(This->pShellBrowser,This->hMenu); + DestroyMenu(This->hMenu); + This->hMenu = 0; } - this->uState = SVUIA_DEACTIVATE; + This->uState = SVUIA_DEACTIVATE; } } /************************************************************************** * ShellView_OnActivate() */ -LRESULT ShellView_OnActivate(LPSHELLVIEW this, UINT uState) +LRESULT ShellView_OnActivate(IShellViewImpl * This, UINT uState) { OLEMENUGROUPWIDTHS omw = { {0, 0, 0, 0, 0, 0} }; MENUITEMINFOA mii; CHAR szText[MAX_PATH]; - TRACE(shell,"%p uState=%x\n",this,uState); + TRACE(shell,"%p uState=%x\n",This,uState); /*don't do anything if the state isn't really changing */ - if(this->uState == uState) + if(This->uState == uState) { return S_OK; } - ShellView_OnDeactivate(this); + ShellView_OnDeactivate(This); - /*only do this if we are active */ + /*only do This if we are active */ if(uState != SVUIA_DEACTIVATE) { /*merge the menus */ - this->hMenu = CreateMenu(); + This->hMenu = CreateMenu(); - if(this->hMenu) - { IShellBrowser_InsertMenusSB(this->pShellBrowser, this->hMenu, &omw); + if(This->hMenu) + { IShellBrowser_InsertMenusSB(This->pShellBrowser, This->hMenu, &omw); TRACE(shell,"-- after fnInsertMenusSB\n"); /*build the top level menu get the menu item's text*/ strcpy(szText,"dummy 31"); @@ -591,11 +629,11 @@ LRESULT ShellView_OnActivate(LPSHELLVIEW this, UINT uState) mii.fType = MFT_STRING; mii.fState = MFS_ENABLED; mii.dwTypeData = szText; - mii.hSubMenu = ShellView_BuildFileMenu(this); + mii.hSubMenu = ShellView_BuildFileMenu(This); /*insert our menu into the menu bar*/ if(mii.hSubMenu) - { InsertMenuItemA(this->hMenu, FCIDM_MENU_HELP, FALSE, &mii); + { InsertMenuItemA(This->hMenu, FCIDM_MENU_HELP, FALSE, &mii); } /*get the view menu so we can merge with it*/ @@ -603,8 +641,8 @@ LRESULT ShellView_OnActivate(LPSHELLVIEW this, UINT uState) mii.cbSize = sizeof(mii); mii.fMask = MIIM_SUBMENU; - if(GetMenuItemInfoA(this->hMenu, FCIDM_MENU_VIEW, FALSE, &mii)) - { ShellView_MergeViewMenu(this, mii.hSubMenu); + if(GetMenuItemInfoA(This->hMenu, FCIDM_MENU_VIEW, FALSE, &mii)) + { ShellView_MergeViewMenu(This, mii.hSubMenu); } /*add the items that should only be added if we have the focus*/ @@ -614,15 +652,15 @@ LRESULT ShellView_OnActivate(LPSHELLVIEW this, UINT uState) mii.cbSize = sizeof(mii); mii.fMask = MIIM_SUBMENU; - if(GetMenuItemInfoA(this->hMenu, FCIDM_MENU_FILE, FALSE, &mii)) - { ShellView_MergeFileMenu(this, mii.hSubMenu); + if(GetMenuItemInfoA(This->hMenu, FCIDM_MENU_FILE, FALSE, &mii)) + { ShellView_MergeFileMenu(This, mii.hSubMenu); } } TRACE(shell,"-- before fnSetMenuSB\n"); - IShellBrowser_SetMenuSB(this->pShellBrowser, this->hMenu, 0, this->hWnd); + IShellBrowser_SetMenuSB(This->pShellBrowser, This->hMenu, 0, This->hWnd); } } - this->uState = uState; + This->uState = uState; TRACE(shell,"--\n"); return S_OK; } @@ -633,13 +671,13 @@ LRESULT ShellView_OnActivate(LPSHELLVIEW this, UINT uState) * NOTES * internal */ -LRESULT ShellView_OnSetFocus(LPSHELLVIEW this) -{ TRACE(shell,"%p\n",this); +LRESULT ShellView_OnSetFocus(IShellViewImpl * This) +{ TRACE(shell,"%p\n",This); /* Tell the browser one of our windows has received the focus. This should always be done before merging menus (OnActivate merges the menus) if one of our windows has the focus.*/ - IShellBrowser_OnViewWindowActive(this->pShellBrowser,this); - ShellView_OnActivate(this, SVUIA_ACTIVATE_FOCUS); + IShellBrowser_OnViewWindowActive(This->pShellBrowser,(IShellView*) This); + ShellView_OnActivate(This, SVUIA_ACTIVATE_FOCUS); return 0; } @@ -647,25 +685,25 @@ LRESULT ShellView_OnSetFocus(LPSHELLVIEW this) /************************************************************************** * ShellView_OnKillFocus() */ -LRESULT ShellView_OnKillFocus(LPSHELLVIEW this) -{ TRACE(shell,"(%p) stub\n",this); - ShellView_OnActivate(this, SVUIA_ACTIVATE_NOFOCUS); +LRESULT ShellView_OnKillFocus(IShellViewImpl * This) +{ TRACE(shell,"(%p) stub\n",This); + ShellView_OnActivate(This, SVUIA_ACTIVATE_NOFOCUS); return 0; } /************************************************************************** * ShellView_AddRemoveDockingWindow() */ -BOOL ShellView_AddRemoveDockingWindow(LPSHELLVIEW this, BOOL bAdd) +BOOL ShellView_AddRemoveDockingWindow(IShellViewImpl * This, BOOL bAdd) { BOOL bReturn = FALSE; HRESULT hr; LPSERVICEPROVIDER pSP; LPDOCKINGWINDOWFRAME pFrame; - WARN(shell,"(%p)->(badd=0x%08x) semi-stub\n",this,bAdd); + WARN(shell,"(%p)->(badd=0x%08x) semi-stub\n",This,bAdd); /* get the browser's IServiceProvider */ - hr = IShellBrowser_QueryInterface(this->pShellBrowser, (REFIID)&IID_IServiceProvider, (LPVOID*)&pSP); + hr = IShellBrowser_QueryInterface(This->pShellBrowser, (REFIID)&IID_IServiceProvider, (LPVOID*)&pSP); if(SUCCEEDED(hr)) { /*get the IDockingWindowFrame pointer*/ hr = IServiceProvider_QueryService(pSP, (REFGUID)&SID_SShellBrowser, (REFIID)&IID_IDockingWindowFrame, (LPVOID*)&pFrame); @@ -674,14 +712,14 @@ BOOL ShellView_AddRemoveDockingWindow(LPSHELLVIEW this, BOOL bAdd) { hr = S_OK; FIXME(shell,"no docking implemented\n"); #if 0 - if(!this->pDockingWindow) + if(!This->pDockingWindow) { /* create the toolbar object */ - this->pDockingWindow = DockingWindow_Constructor(this, this->hWnd); + This->pDockingWindow = DockingWindow_Constructor(This, This->hWnd); } - if(this->pDockingWindow) + if(This->pDockingWindow) { /*add the toolbar object */ - hr = pFrame->lpvtbl->fnAddToolbar(pFrame, (IDockingWindow*)this->pDockingWindow, TOOLBAR_ID, 0); + hr = pFrame->lpvtbl->fnAddToolbar(pFrame, (IDockingWindow*)This->pDockingWindow, TOOLBAR_ID, 0); if(SUCCEEDED(hr)) { bReturn = TRUE; @@ -692,15 +730,15 @@ BOOL ShellView_AddRemoveDockingWindow(LPSHELLVIEW this, BOOL bAdd) else { FIXME(shell,"no docking implemented\n"); #if 0 - if(this->pDockingWindow) - { hr = pFrame->lpvtbl->fnRemoveToolbar(pFrame, (IDockingWindow*)this->pDockingWindow, DWFRF_NORMAL); + if(This->pDockingWindow) + { hr = pFrame->lpvtbl->fnRemoveToolbar(pFrame, (IDockingWindow*)This->pDockingWindow, DWFRF_NORMAL); if(SUCCEEDED(hr)) { /* RemoveToolbar should release the toolbar object which will cause */ /*it to destroy itself. Our toolbar object is no longer valid at */ - /*this point. */ + /*This point. */ - this->pDockingWindow = NULL; + This->pDockingWindow = NULL; bReturn = TRUE; } } @@ -713,35 +751,11 @@ BOOL ShellView_AddRemoveDockingWindow(LPSHELLVIEW this, BOOL bAdd) return bReturn; } -/************************************************************************** -* ShellView_CanDoIDockingWindow() -*/ -BOOL ShellView_CanDoIDockingWindow(LPSHELLVIEW this) -{ BOOL bReturn = FALSE; - HRESULT hr; - LPSERVICEPROVIDER pSP; - LPDOCKINGWINDOWFRAME pFrame; - - FIXME(shell,"(%p) stub\n",this); - - /*get the browser's IServiceProvider*/ - hr = IShellBrowser_QueryInterface(this->pShellBrowser, (REFIID)&IID_IServiceProvider, (LPVOID*)&pSP); - if(hr==S_OK) - { hr = IServiceProvider_QueryService(pSP, (REFGUID)&SID_SShellBrowser, (REFIID)&IID_IDockingWindowFrame, (LPVOID*)&pFrame); - if(SUCCEEDED(hr)) - { bReturn = TRUE; - pFrame->lpvtbl->fnRelease(pFrame); - } - IServiceProvider_Release(pSP); - } - return bReturn; -} - /************************************************************************** * ShellView_UpdateShellSettings() */ -void ShellView_UpdateShellSettings(LPSHELLVIEW this) -{ FIXME(shell,"(%p) stub\n",this); +void ShellView_UpdateShellSettings(IShellViewImpl * This) +{ FIXME(shell,"(%p) stub\n",This); return ; /* SHELLFLAGSTATE sfs; @@ -774,17 +788,17 @@ void ShellView_UpdateShellSettings(LPSHELLVIEW this) if(!sfs.fWin95Classic && !sfs.fDoubleClickInWebView) dwExStyles |= LVS_EX_ONECLICKACTIVATE | LVS_EX_TRACKSELECT | LVS_EX_UNDERLINEHOT; - ListView_SetExtendedListViewStyle(this->hWndList, dwExStyles); + ListView_SetExtendedListViewStyle(This->hWndList, dwExStyles); */ } /************************************************************************** * ShellView_OnSettingChange() */ -LRESULT ShellView_OnSettingChange(LPSHELLVIEW this, LPCSTR lpszSection) -{ TRACE(shell,"(%p) stub\n",this); +LRESULT ShellView_OnSettingChange(IShellViewImpl * This, LPCSTR lpszSection) +{ TRACE(shell,"(%p) stub\n",This); /*if(0 == lstrcmpi(lpszSection, "ShellState"))*/ - { ShellView_UpdateShellSettings(this); + { ShellView_UpdateShellSettings(This); return 0; } return 0; @@ -792,17 +806,17 @@ LRESULT ShellView_OnSettingChange(LPSHELLVIEW this, LPCSTR lpszSection) /************************************************************************** * ShellView_OnCommand() */ -LRESULT ShellView_OnCommand(LPSHELLVIEW this,DWORD dwCmdID, DWORD dwCmd, HWND hwndCmd) -{ TRACE(shell,"(%p)->(0x%08lx 0x%08lx 0x%08x) stub\n",this, dwCmdID, dwCmd, hwndCmd); +LRESULT ShellView_OnCommand(IShellViewImpl * This,DWORD dwCmdID, DWORD dwCmd, HWND hwndCmd) +{ TRACE(shell,"(%p)->(0x%08lx 0x%08lx 0x%08x) stub\n",This, dwCmdID, dwCmd, hwndCmd); switch(dwCmdID) { case IDM_VIEW_FILES: g_bViewKeys = ! g_bViewKeys; - IShellView_Refresh(this); + IShellView_Refresh((IShellView*) This); break; case IDM_VIEW_IDW: g_bShowIDW = ! g_bShowIDW; - ShellView_AddRemoveDockingWindow(this, g_bShowIDW); + ShellView_AddRemoveDockingWindow(This, g_bShowIDW); break; case IDM_MYFILEITEM: @@ -810,23 +824,23 @@ LRESULT ShellView_OnCommand(LPSHELLVIEW this,DWORD dwCmdID, DWORD dwCmd, HWND hw break; case FCIDM_SHVIEW_SMALLICON: - this->FolderSettings.ViewMode = FVM_SMALLICON; - SetStyle (this, LVS_SMALLICON, LVS_TYPEMASK); + This->FolderSettings.ViewMode = FVM_SMALLICON; + SetStyle (This, LVS_SMALLICON, LVS_TYPEMASK); break; case FCIDM_SHVIEW_BIGICON: - this->FolderSettings.ViewMode = FVM_ICON; - SetStyle (this, LVS_ICON, LVS_TYPEMASK); + This->FolderSettings.ViewMode = FVM_ICON; + SetStyle (This, LVS_ICON, LVS_TYPEMASK); break; case FCIDM_SHVIEW_LISTVIEW: - this->FolderSettings.ViewMode = FVM_LIST; - SetStyle (this, LVS_LIST, LVS_TYPEMASK); + This->FolderSettings.ViewMode = FVM_LIST; + SetStyle (This, LVS_LIST, LVS_TYPEMASK); break; case FCIDM_SHVIEW_REPORTVIEW: - this->FolderSettings.ViewMode = FVM_DETAILS; - SetStyle (this, LVS_REPORT, LVS_TYPEMASK); + This->FolderSettings.ViewMode = FVM_DETAILS; + SetStyle (This, LVS_REPORT, LVS_TYPEMASK); break; default: @@ -841,22 +855,22 @@ LRESULT ShellView_OnCommand(LPSHELLVIEW this,DWORD dwCmdID, DWORD dwCmd, HWND hw * RETURNS * number of selected items */ -UINT ShellView_GetSelections(LPSHELLVIEW this) +UINT ShellView_GetSelections(IShellViewImpl * This) { LVITEMA lvItem; UINT i; - if (this->aSelectedItems) - { SHFree(this->aSelectedItems); + if (This->aSelectedItems) + { SHFree(This->aSelectedItems); } - this->uSelected = ListView_GetSelectedCount(this->hWndList); - this->aSelectedItems = (LPITEMIDLIST*)SHAlloc(this->uSelected * sizeof(LPITEMIDLIST)); + This->uSelected = ListView_GetSelectedCount(This->hWndList); + This->aSelectedItems = (LPITEMIDLIST*)SHAlloc(This->uSelected * sizeof(LPITEMIDLIST)); - TRACE(shell,"selected=%i\n", this->uSelected); + TRACE(shell,"selected=%i\n", This->uSelected); - if(this->aSelectedItems) - { TRACE(shell,"-- Items selected =%u\n", this->uSelected); + if(This->aSelectedItems) + { TRACE(shell,"-- Items selected =%u\n", This->uSelected); ZeroMemory(&lvItem, sizeof(lvItem)); lvItem.mask = LVIF_STATE | LVIF_PARAM; lvItem.stateMask = LVIS_SELECTED; @@ -864,22 +878,22 @@ UINT ShellView_GetSelections(LPSHELLVIEW this) i = 0; - while(ListView_GetItemA(this->hWndList, &lvItem) && (i < this->uSelected)) + while(ListView_GetItemA(This->hWndList, &lvItem) && (i < This->uSelected)) { if(lvItem.state & LVIS_SELECTED) - { this->aSelectedItems[i] = (LPITEMIDLIST)lvItem.lParam; + { This->aSelectedItems[i] = (LPITEMIDLIST)lvItem.lParam; i++; TRACE(shell,"-- selected Item found\n"); } lvItem.iItem++; } } - return this->uSelected; + return This->uSelected; } /************************************************************************** * ShellView_DoContextMenu() */ -void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL fDefault) +void ShellView_DoContextMenu(IShellViewImpl * This, WORD x, WORD y, BOOL fDefault) { UINT uCommand; DWORD wFlags; HMENU hMenu; @@ -890,12 +904,12 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL fDefault) LPCONTEXTMENU pContextMenu = NULL; CMINVOKECOMMANDINFO cmi; - TRACE(shell,"(%p)->(0x%08x 0x%08x 0x%08x) stub\n",this, x, y, fDefault); + TRACE(shell,"(%p)->(0x%08x 0x%08x 0x%08x) stub\n",This, x, y, fDefault); /* look, what's selected and create a context menu object of it*/ - if(ShellView_GetSelections(this)) - { this->pSFParent->lpvtbl->fnGetUIObjectOf( this->pSFParent, this->hWndParent, this->uSelected, - this->aSelectedItems, (REFIID)&IID_IContextMenu, + if(ShellView_GetSelections(This)) + { This->pSFParent->lpvtbl->fnGetUIObjectOf( This->pSFParent, This->hWndParent, This->uSelected, + This->aSelectedItems, (REFIID)&IID_IContextMenu, NULL, (LPVOID *)&pContextMenu); if(pContextMenu) @@ -906,12 +920,12 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL fDefault) { /* See if we are in Explore or Open mode. If the browser's tree is present, then we are in Explore mode.*/ - if(SUCCEEDED(IShellBrowser_GetControlWindow(this->pShellBrowser,FCW_TREE, &hwndTree)) && hwndTree) + if(SUCCEEDED(IShellBrowser_GetControlWindow(This->pShellBrowser,FCW_TREE, &hwndTree)) && hwndTree) { TRACE(shell,"-- explore mode\n"); fExplore = TRUE; } - wFlags = CMF_NORMAL | (this->uSelected != 1 ? 0 : CMF_CANRENAME) | (fExplore ? CMF_EXPLORE : 0); + wFlags = CMF_NORMAL | (This->uSelected != 1 ? 0 : CMF_CANRENAME) | (fExplore ? CMF_EXPLORE : 0); if (SUCCEEDED(pContextMenu->lpvtbl->fnQueryContextMenu( pContextMenu, hMenu, 0, MENU_OFFSET, MENU_MAX, wFlags ))) { if( fDefault ) @@ -932,20 +946,20 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL fDefault) } else { TRACE(shell,"-- track popup\n"); - uCommand = TrackPopupMenu( hMenu,TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,this->hWnd,NULL); + uCommand = TrackPopupMenu( hMenu,TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,This->hWnd,NULL); } if(uCommand > 0) { TRACE(shell,"-- uCommand=%u\n", uCommand); - if (IsInCommDlg(this) && (((uCommand-MENU_OFFSET)==IDM_EXPLORE) || ((uCommand-MENU_OFFSET)==IDM_OPEN))) + if (IsInCommDlg(This) && (((uCommand-MENU_OFFSET)==IDM_EXPLORE) || ((uCommand-MENU_OFFSET)==IDM_OPEN))) { TRACE(shell,"-- dlg: OnDefaultCommand\n"); - OnDefaultCommand(this); + OnDefaultCommand(This); } else { TRACE(shell,"-- explore -- invoke command\n"); ZeroMemory(&cmi, sizeof(cmi)); cmi.cbSize = sizeof(cmi); - cmi.hwnd = this->hWndParent; + cmi.hwnd = This->hWndParent; cmi.lpVerb = (LPCSTR)MAKEINTRESOURCEA(uCommand - MENU_OFFSET); pContextMenu->lpvtbl->fnInvokeCommand(pContextMenu, &cmi); } @@ -959,8 +973,8 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL fDefault) } else /* background context menu */ { hMenu = LoadMenuIndirectA(&_Resource_Men_MENU_002_0_data); - uCommand = TrackPopupMenu( GetSubMenu(hMenu,0),TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,this->hWnd,NULL); - ShellView_OnCommand(this, uCommand, 0,0); + uCommand = TrackPopupMenu( GetSubMenu(hMenu,0),TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,This->hWnd,NULL); + ShellView_OnCommand(This, uCommand, 0,0); DestroyMenu(hMenu); } } @@ -969,7 +983,7 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL fDefault) * ShellView_OnNotify() */ -LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT CtlID, LPNMHDR lpnmh) +LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpnmh) { NM_LISTVIEW *lpnmlv = (NM_LISTVIEW*)lpnmh; NMLVDISPINFOA *lpdi = (NMLVDISPINFOA *)lpnmh; LPITEMIDLIST pidl; @@ -978,50 +992,50 @@ LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT CtlID, LPNMHDR lpnmh) UINT uFlags; IExtractIcon *pei; - TRACE(shell,"%p CtlID=%u lpnmh->code=%x\n",this,CtlID,lpnmh->code); + TRACE(shell,"%p CtlID=%u lpnmh->code=%x\n",This,CtlID,lpnmh->code); switch(lpnmh->code) { case NM_SETFOCUS: - TRACE(shell,"-- NM_SETFOCUS %p\n",this); - ShellView_OnSetFocus(this); + TRACE(shell,"-- NM_SETFOCUS %p\n",This); + ShellView_OnSetFocus(This); break; case NM_KILLFOCUS: - TRACE(shell,"-- NM_KILLFOCUS %p\n",this); - ShellView_OnDeactivate(this); + TRACE(shell,"-- NM_KILLFOCUS %p\n",This); + ShellView_OnDeactivate(This); break; case HDN_ENDTRACKA: - TRACE(shell,"-- HDN_ENDTRACKA %p\n",this); - /*nColumn1 = ListView_GetColumnWidth(this->hWndList, 0); - nColumn2 = ListView_GetColumnWidth(this->hWndList, 1);*/ + TRACE(shell,"-- HDN_ENDTRACKA %p\n",This); + /*nColumn1 = ListView_GetColumnWidth(This->hWndList, 0); + nColumn2 = ListView_GetColumnWidth(This->hWndList, 1);*/ break; case LVN_DELETEITEM: - TRACE(shell,"-- LVN_DELETEITEM %p\n",this); + TRACE(shell,"-- LVN_DELETEITEM %p\n",This); SHFree((LPITEMIDLIST)lpnmlv->lParam); /*delete the pidl because we made a copy of it*/ break; case LVN_ITEMACTIVATE: - TRACE(shell,"-- LVN_ITEMACTIVATE %p\n",this); - OnStateChange(this, CDBOSC_SELCHANGE); /* the browser will get the IDataObject now */ - ShellView_DoContextMenu(this, 0, 0, TRUE); + TRACE(shell,"-- LVN_ITEMACTIVATE %p\n",This); + OnStateChange(This, CDBOSC_SELCHANGE); /* the browser will get the IDataObject now */ + ShellView_DoContextMenu(This, 0, 0, TRUE); break; case NM_RCLICK: - TRACE(shell,"-- NM_RCLICK %p\n",this); + TRACE(shell,"-- NM_RCLICK %p\n",This); dwCursor = GetMessagePos(); - ShellView_DoContextMenu(this, LOWORD(dwCursor), HIWORD(dwCursor), FALSE); + ShellView_DoContextMenu(This, LOWORD(dwCursor), HIWORD(dwCursor), FALSE); break; case LVN_GETDISPINFOA: - TRACE(shell,"-- LVN_GETDISPINFOA %p\n",this); + TRACE(shell,"-- LVN_GETDISPINFOA %p\n",This); pidl = (LPITEMIDLIST)lpdi->item.lParam; if(lpdi->item.iSubItem) /*is the sub-item information being requested?*/ { if(lpdi->item.mask & LVIF_TEXT) /*is the text being requested?*/ - { if(_ILIsValue(pidl)) /*is this a value or a folder?*/ + { if(_ILIsValue(pidl)) /*is This a value or a folder?*/ { switch (lpdi->item.iSubItem) { case 1: /* size */ _ILGetFileSize (pidl, lpdi->item.pszText, lpdi->item.cchTextMax); @@ -1063,7 +1077,7 @@ LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT CtlID, LPNMHDR lpnmh) } else /*the item text is being requested*/ { if(lpdi->item.mask & LVIF_TEXT) /*is the text being requested?*/ - { if(SUCCEEDED(this->pSFParent->lpvtbl->fnGetDisplayNameOf(this->pSFParent,pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &str))) + { if(SUCCEEDED(IShellFolder_GetDisplayNameOf(This->pSFParent,pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &str))) { if(STRRET_WSTR == str.uType) { WideCharToLocal(lpdi->item.pszText, str.u.pOleStr, lpdi->item.cchTextMax); SHFree(str.u.pOleStr); @@ -1079,10 +1093,10 @@ LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT CtlID, LPNMHDR lpnmh) } if(lpdi->item.mask & LVIF_IMAGE) /*is the image being requested?*/ - { if(SUCCEEDED(this->pSFParent->lpvtbl->fnGetUIObjectOf(this->pSFParent,this->hWnd,1, - (LPCITEMIDLIST*)&pidl, (REFIID)&IID_IExtractIcon, NULL, (LPVOID*)&pei))) - { pei->lpvtbl->fnGetIconLocation(pei, GIL_FORSHELL, NULL, 0, &lpdi->item.iImage, &uFlags); - pei->lpvtbl->fnRelease(pei); + { if(SUCCEEDED(IShellFolder_GetUIObjectOf(This->pSFParent,This->hWnd,1, + (LPCITEMIDLIST*)&pidl, (REFIID)&IID_IExtractIconA, NULL, (LPVOID*)&pei))) + { IExtractIconA_GetIconLocation(pei, GIL_FORSHELL, NULL, 0, &lpdi->item.iImage, &uFlags); + IExtractIconA_Release(pei); TRACE(shell,"-- image=%x\n",lpdi->item.iImage); } } @@ -1090,13 +1104,13 @@ LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT CtlID, LPNMHDR lpnmh) break; case LVN_ITEMCHANGED: - TRACE(shell,"-- LVN_ITEMCHANGED %p\n",this); - ShellView_GetSelections(this); - OnStateChange(this, CDBOSC_SELCHANGE); /* the browser will get the IDataObject now */ + TRACE(shell,"-- LVN_ITEMCHANGED %p\n",This); + ShellView_GetSelections(This); + OnStateChange(This, CDBOSC_SELCHANGE); /* the browser will get the IDataObject now */ break; default: - TRACE (shell,"-- %p WM_COMMAND %s unhandled\n", this, SPY_GetMsgName(lpnmh->code)); + TRACE (shell,"-- %p WM_COMMAND %s unhandled\n", This, SPY_GetMsgName(lpnmh->code)); break;; } return 0; @@ -1107,7 +1121,7 @@ LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT CtlID, LPNMHDR lpnmh) */ LRESULT CALLBACK ShellView_WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam) -{ LPSHELLVIEW pThis = (LPSHELLVIEW)GetWindowLongA(hWnd, GWL_USERDATA); +{ IShellViewImpl * pThis = (IShellViewImpl*)GetWindowLongA(hWnd, GWL_USERDATA); LPCREATESTRUCTA lpcs; DWORD dwCursor; @@ -1117,7 +1131,7 @@ LRESULT CALLBACK ShellView_WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPAR { case WM_NCCREATE: { TRACE(shell,"-- WM_NCCREATE\n"); lpcs = (LPCREATESTRUCTA)lParam; - pThis = (LPSHELLVIEW)(lpcs->lpCreateParams); + pThis = (IShellViewImpl*)(lpcs->lpCreateParams); SetWindowLongA(hWnd, GWL_USERDATA, (LONG)pThis); pThis->hWnd = hWnd; /*set the window handle*/ } @@ -1190,73 +1204,92 @@ LRESULT CALLBACK ShellView_WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPAR *************************************************************************** * IShellView_QueryInterface */ -static HRESULT WINAPI IShellView_QueryInterface(LPSHELLVIEW this,REFIID riid, LPVOID *ppvObj) -{ char xriid[50]; - WINE_StringFromCLSID((LPCLSID)riid,xriid); - TRACE(shell,"(%p)->(\n\tIID:\t%s,%p)\n",this,xriid,ppvObj); +static HRESULT WINAPI IShellView_fnQueryInterface(IShellView * iface,REFIID riid, LPVOID *ppvObj) +{ + ICOM_THIS(IShellViewImpl, iface); - *ppvObj = NULL; + char xriid[50]; + WINE_StringFromCLSID((LPCLSID)riid,xriid); + TRACE(shell,"(%p)->(\n\tIID:\t%s,%p)\n",This,xriid,ppvObj); - if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ - { *ppvObj = this; - } - else if(IsEqualIID(riid, &IID_IShellView)) /*IShellView*/ - { *ppvObj = (IShellView*)this; - } + *ppvObj = NULL; + + if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ + { *ppvObj = This; + } + else if(IsEqualIID(riid, &IID_IShellView)) /*IShellView*/ + { *ppvObj = (IShellView*)This; + } + + if(*ppvObj) + { IShellView_AddRef( (IShellView*) *ppvObj); + TRACE(shell,"-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); + return S_OK; + } + TRACE(shell,"-- Interface: E_NOINTERFACE\n"); + return E_NOINTERFACE; +} - if(*ppvObj) - { (*(LPSHELLVIEW*)ppvObj)->lpvtbl->fnAddRef(this); - TRACE(shell,"-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); - return S_OK; - } - TRACE(shell,"-- Interface: E_NOINTERFACE\n"); - return E_NOINTERFACE; -} /************************************************************************** * IShellView::AddRef */ -static ULONG WINAPI IShellView_AddRef(LPSHELLVIEW this) -{ TRACE(shell,"(%p)->(count=%lu)\n",this,(this->ref)+1); +static ULONG WINAPI IShellView_fnAddRef(IShellView * iface) +{ + ICOM_THIS(IShellViewImpl, iface); + + TRACE(shell,"(%p)->(count=%lu)\n",This,(This->ref)+1); shell32_ObjCount++; - return ++(this->ref); + return ++(This->ref); } /************************************************************************** * IShellView_Release */ -static ULONG WINAPI IShellView_Release(LPSHELLVIEW this) -{ TRACE(shell,"(%p)->()\n",this); +static ULONG WINAPI IShellView_fnRelease(IShellView * iface) +{ + ICOM_THIS(IShellViewImpl, iface); + + TRACE(shell,"(%p)->()\n",This); shell32_ObjCount--; - if (!--(this->ref)) - { TRACE(shell," destroying IShellView(%p)\n",this); + if (!--(This->ref)) + { TRACE(shell," destroying IShellView(%p)\n",This); - if(this->pSFParent) - this->pSFParent->lpvtbl->fnRelease(this->pSFParent); + if(This->pSFParent) + IShellFolder_Release(This->pSFParent); - if (this->aSelectedItems) - SHFree(this->aSelectedItems); + if (This->aSelectedItems) + SHFree(This->aSelectedItems); - if (this->pCommDlgBrowser) - this->pCommDlgBrowser->lpvtbl->fnRelease(this->pCommDlgBrowser); + if (This->pCommDlgBrowser) + ICommDlgBrowser_Release(This->pCommDlgBrowser); - HeapFree(GetProcessHeap(),0,this); + HeapFree(GetProcessHeap(),0,This); return 0; } - return this->ref; + return This->ref; } /************************************************************************** * ShellView_GetWindow */ -static HRESULT WINAPI IShellView_GetWindow(LPSHELLVIEW this,HWND * phWnd) -{ TRACE(shell,"(%p)\n",this); - *phWnd = this->hWnd; +static HRESULT WINAPI IShellView_fnGetWindow(IShellView * iface,HWND * phWnd) +{ + ICOM_THIS(IShellViewImpl, iface); + + TRACE(shell,"(%p)\n",This); + + *phWnd = This->hWnd; return S_OK; } -static HRESULT WINAPI IShellView_ContextSensitiveHelp(LPSHELLVIEW this,BOOL fEnterMode) -{ FIXME(shell,"(%p) stub\n",this); - return E_NOTIMPL; + +static HRESULT WINAPI IShellView_fnContextSensitiveHelp(IShellView * iface,BOOL fEnterMode) +{ + ICOM_THIS(IShellViewImpl, iface); + + FIXME(shell,"(%p) stub\n",This); + + return E_NOTIMPL; } /************************************************************************** * IShellView_TranslateAccelerator @@ -1264,8 +1297,11 @@ static HRESULT WINAPI IShellView_ContextSensitiveHelp(LPSHELLVIEW this,BOOL fEnt * FIXME: * use the accel functions */ -static HRESULT WINAPI IShellView_TranslateAccelerator(LPSHELLVIEW this,LPMSG lpmsg) -{ FIXME(shell,"(%p)->(%p: hwnd=%x msg=%x lp=%lx wp=%x) stub\n",this,lpmsg, lpmsg->hwnd, lpmsg->message, lpmsg->lParam, lpmsg->wParam); +static HRESULT WINAPI IShellView_fnTranslateAccelerator(IShellView * iface,LPMSG lpmsg) +{ + ICOM_THIS(IShellViewImpl, iface); + + FIXME(shell,"(%p)->(%p: hwnd=%x msg=%x lp=%lx wp=%x) stub\n",This,lpmsg, lpmsg->hwnd, lpmsg->message, lpmsg->lParam, lpmsg->wParam); switch (lpmsg->message) @@ -1273,83 +1309,95 @@ static HRESULT WINAPI IShellView_TranslateAccelerator(LPSHELLVIEW this,LPMSG lpm } return S_FALSE; } -static HRESULT WINAPI IShellView_EnableModeless(LPSHELLVIEW this,BOOL fEnable) -{ FIXME(shell,"(%p) stub\n",this); - return E_NOTIMPL; + +static HRESULT WINAPI IShellView_fnEnableModeless(IShellView * iface,BOOL fEnable) +{ + ICOM_THIS(IShellViewImpl, iface); + + FIXME(shell,"(%p) stub\n",This); + + return E_NOTIMPL; } -static HRESULT WINAPI IShellView_UIActivate(LPSHELLVIEW this,UINT uState) -{ CHAR szName[MAX_PATH]; + +static HRESULT WINAPI IShellView_fnUIActivate(IShellView * iface,UINT uState) +{ + ICOM_THIS(IShellViewImpl, iface); + + CHAR szName[MAX_PATH]; LRESULT lResult; int nPartArray[1] = {-1}; - TRACE(shell,"(%p)->(state=%x) stub\n",this, uState); + TRACE(shell,"(%p)->(state=%x) stub\n",This, uState); /*don't do anything if the state isn't really changing*/ - if(this->uState == uState) + if(This->uState == uState) { return S_OK; } /*OnActivate handles the menu merging and internal state*/ - ShellView_OnActivate(this, uState); + ShellView_OnActivate(This, uState); /*remove the docking window*/ if(g_bShowIDW) - { ShellView_AddRemoveDockingWindow(this, FALSE); + { ShellView_AddRemoveDockingWindow(This, FALSE); } - /*only do this if we are active*/ + /*only do This if we are active*/ if(uState != SVUIA_DEACTIVATE) { /*update the status bar */ strcpy(szName, "dummy32"); - - this->pSFParent->lpvtbl->fnGetFolderPath( this->pSFParent, - szName + strlen(szName), - sizeof(szName) - strlen(szName)); + + IShellFolder_GetFolderPath( This->pSFParent, szName + strlen(szName), sizeof(szName) - strlen(szName)); /* set the number of parts */ - IShellBrowser_SendControlMsg(this->pShellBrowser, FCW_STATUS, SB_SETPARTS, 1, + IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_STATUS, SB_SETPARTS, 1, (LPARAM)nPartArray, &lResult); /* set the text for the parts */ - IShellBrowser_SendControlMsg(this->pShellBrowser, FCW_STATUS, SB_SETTEXTA, + IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_STATUS, SB_SETTEXTA, 0, (LPARAM)szName, &lResult); /*add the docking window if necessary */ if(g_bShowIDW) - { ShellView_AddRemoveDockingWindow(this, TRUE); + { ShellView_AddRemoveDockingWindow(This, TRUE); } } return S_OK; } -static HRESULT WINAPI IShellView_Refresh(LPSHELLVIEW this) -{ TRACE(shell,"(%p)\n",this); +static HRESULT WINAPI IShellView_fnRefresh(IShellView * iface) +{ + ICOM_THIS(IShellViewImpl, iface); - ListView_DeleteAllItems(this->hWndList); - ShellView_FillList(this); + TRACE(shell,"(%p)\n",This); + + ListView_DeleteAllItems(This->hWndList); + ShellView_FillList(This); return S_OK; } -static HRESULT WINAPI IShellView_CreateViewWindow(LPSHELLVIEW this, IShellView *lpPrevView, +static HRESULT WINAPI IShellView_fnCreateViewWindow(IShellView * iface, IShellView *lpPrevView, LPCFOLDERSETTINGS lpfs, IShellBrowser * psb, RECT * prcView, HWND *phWnd) -{ WNDCLASSA wc; -/* LRESULT dwResult;*/ +{ + ICOM_THIS(IShellViewImpl, iface); + + WNDCLASSA wc; *phWnd = 0; - TRACE(shell,"(%p)->(shlview=%p set=%p shlbrs=%p rec=%p hwnd=%p) incomplete\n",this, lpPrevView,lpfs, psb, prcView, phWnd); + TRACE(shell,"(%p)->(shlview=%p set=%p shlbrs=%p rec=%p hwnd=%p) incomplete\n",This, lpPrevView,lpfs, psb, prcView, phWnd); TRACE(shell,"-- vmode=%x flags=%x left=%i top=%i right=%i bottom=%i\n",lpfs->ViewMode, lpfs->fFlags ,prcView->left,prcView->top, prcView->right, prcView->bottom); /*set up the member variables*/ - this->pShellBrowser = psb; - this->FolderSettings = *lpfs; + This->pShellBrowser = psb; + This->FolderSettings = *lpfs; /*get our parent window*/ - IShellBrowser_AddRef(this->pShellBrowser); - IShellBrowser_GetWindow(this->pShellBrowser, &(this->hWndParent)); + IShellBrowser_AddRef(This->pShellBrowser); + IShellBrowser_GetWindow(This->pShellBrowser, &(This->hWndParent)); /* try to get the ICommDlgBrowserInterface, adds a reference !!! */ - this->pCommDlgBrowser=NULL; - if ( SUCCEEDED (IShellBrowser_QueryInterface( this->pShellBrowser, - (REFIID)&IID_ICommDlgBrowser, (LPVOID*) &this->pCommDlgBrowser))) + This->pCommDlgBrowser=NULL; + if ( SUCCEEDED (IShellBrowser_QueryInterface( This->pShellBrowser, + (REFIID)&IID_ICommDlgBrowser, (LPVOID*) &This->pCommDlgBrowser))) { TRACE(shell,"-- CommDlgBrowser\n"); } @@ -1366,16 +1414,16 @@ static HRESULT WINAPI IShellView_CreateViewWindow(LPSHELLVIEW this, IShellView * wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1); wc.lpszMenuName = NULL; wc.lpszClassName = SV_CLASS_NAME; - + if(!RegisterClassA(&wc)) return E_FAIL; } *phWnd = CreateWindowExA(0, SV_CLASS_NAME, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, - prcView->left, prcView->top, prcView->right - prcView->left, prcView->bottom - prcView->top, - this->hWndParent, 0, shell32_hInstance, (LPVOID)this); - - MergeToolBar(this); + prcView->left, prcView->top, prcView->right - prcView->left, prcView->bottom - prcView->top, + This->hWndParent, 0, shell32_hInstance, (LPVOID)This); + + MergeToolBar(This); if(!*phWnd) return E_FAIL; @@ -1383,62 +1431,107 @@ static HRESULT WINAPI IShellView_CreateViewWindow(LPSHELLVIEW this, IShellView * return S_OK; } -static HRESULT WINAPI IShellView_DestroyViewWindow(LPSHELLVIEW this) -{ TRACE(shell,"(%p)\n",this); +static HRESULT WINAPI IShellView_fnDestroyViewWindow(IShellView * iface) +{ + ICOM_THIS(IShellViewImpl, iface); + + TRACE(shell,"(%p)\n",This); /*Make absolutely sure all our UI is cleaned up.*/ - IShellView_UIActivate(this, SVUIA_DEACTIVATE); - if(this->hMenu) - { DestroyMenu(this->hMenu); + IShellView_UIActivate((IShellView*)This, SVUIA_DEACTIVATE); + if(This->hMenu) + { DestroyMenu(This->hMenu); } - DestroyWindow(this->hWnd); - IShellBrowser_Release(this->pShellBrowser); + DestroyWindow(This->hWnd); + IShellBrowser_Release(This->pShellBrowser); return S_OK; } -static HRESULT WINAPI IShellView_GetCurrentInfo(LPSHELLVIEW this, LPFOLDERSETTINGS lpfs) -{ TRACE(shell,"(%p)->(%p) vmode=%x flags=%x\n",this, lpfs, - this->FolderSettings.ViewMode, this->FolderSettings.fFlags); - + +static HRESULT WINAPI IShellView_fnGetCurrentInfo(IShellView * iface, LPFOLDERSETTINGS lpfs) +{ + ICOM_THIS(IShellViewImpl, iface); + + TRACE(shell,"(%p)->(%p) vmode=%x flags=%x\n",This, lpfs, + This->FolderSettings.ViewMode, This->FolderSettings.fFlags); + if (lpfs) - { *lpfs = this->FolderSettings; + { *lpfs = This->FolderSettings; return NOERROR; } else return E_INVALIDARG; } -static HRESULT WINAPI IShellView_AddPropertySheetPages(LPSHELLVIEW this, DWORD dwReserved,LPFNADDPROPSHEETPAGE lpfn, LPARAM lparam) -{ FIXME(shell,"(%p) stub\n",this); - return E_NOTIMPL; + +static HRESULT WINAPI IShellView_fnAddPropertySheetPages(IShellView * iface, DWORD dwReserved,LPFNADDPROPSHEETPAGE lpfn, LPARAM lparam) +{ + ICOM_THIS(IShellViewImpl, iface); + + FIXME(shell,"(%p) stub\n",This); + + return E_NOTIMPL; } -static HRESULT WINAPI IShellView_SaveViewState(LPSHELLVIEW this) -{ FIXME(shell,"(%p) stub\n",this); - return S_OK; + +static HRESULT WINAPI IShellView_fnSaveViewState(IShellView * iface) +{ + ICOM_THIS(IShellViewImpl, iface); + + FIXME(shell,"(%p) stub\n",This); + + return S_OK; } -static HRESULT WINAPI IShellView_SelectItem(LPSHELLVIEW this, LPCITEMIDLIST pidlItem, UINT uFlags) -{ FIXME(shell,"(%p)->(pidl=%p, 0x%08x) stub\n",this, pidlItem, uFlags); - return E_NOTIMPL; + +static HRESULT WINAPI IShellView_fnSelectItem(IShellView * iface, LPCITEMIDLIST pidlItem, UINT uFlags) +{ ICOM_THIS(IShellViewImpl, iface); + + FIXME(shell,"(%p)->(pidl=%p, 0x%08x) stub\n",This, pidlItem, uFlags); + + return E_NOTIMPL; } -static HRESULT WINAPI IShellView_GetItemObject(LPSHELLVIEW this, UINT uItem, REFIID riid, LPVOID *ppvOut) -{ LPUNKNOWN pObj = NULL; + +static HRESULT WINAPI IShellView_fnGetItemObject(IShellView * iface, UINT uItem, REFIID riid, LPVOID *ppvOut) +{ + ICOM_THIS(IShellViewImpl, iface); + + LPUNKNOWN pObj = NULL; char xriid[50]; WINE_StringFromCLSID((LPCLSID)riid,xriid); - TRACE(shell,"(%p)->(uItem=0x%08x,\n\tIID=%s, ppv=%p)\n",this, uItem, xriid, ppvOut); + TRACE(shell,"(%p)->(uItem=0x%08x,\n\tIID=%s, ppv=%p)\n",This, uItem, xriid, ppvOut); *ppvOut = NULL; if(IsEqualIID(riid, &IID_IContextMenu)) - { ShellView_GetSelections(this); - pObj =(LPUNKNOWN)IContextMenu_Constructor(this->pSFParent,this->aSelectedItems,this->uSelected); + { ShellView_GetSelections(This); + pObj =(LPUNKNOWN)IContextMenu_Constructor(This->pSFParent,This->aSelectedItems,This->uSelected); } else if (IsEqualIID(riid, &IID_IDataObject)) - { ShellView_GetSelections(this); - pObj =(LPUNKNOWN)IDataObject_Constructor(this->hWndParent, this->pSFParent,this->aSelectedItems,this->uSelected); + { ShellView_GetSelections(This); + pObj =(LPUNKNOWN)IDataObject_Constructor(This->hWndParent, This->pSFParent,This->aSelectedItems,This->uSelected); } - TRACE(shell,"-- (%p)->(interface=%p)\n",this, ppvOut); + TRACE(shell,"-- (%p)->(interface=%p)\n",This, ppvOut); if(!pObj) return E_OUTOFMEMORY; *ppvOut = pObj; return S_OK; } + +static struct ICOM_VTABLE(IShellView) svvt = +{ IShellView_fnQueryInterface, + IShellView_fnAddRef, + IShellView_fnRelease, + IShellView_fnGetWindow, + IShellView_fnContextSensitiveHelp, + IShellView_fnTranslateAccelerator, + IShellView_fnEnableModeless, + IShellView_fnUIActivate, + IShellView_fnRefresh, + IShellView_fnCreateViewWindow, + IShellView_fnDestroyViewWindow, + IShellView_fnGetCurrentInfo, + IShellView_fnAddPropertySheetPages, + IShellView_fnSaveViewState, + IShellView_fnSelectItem, + IShellView_fnGetItemObject +}; + diff --git a/include/shlguid.h b/include/shlguid.h index dc50593ec07..48627e0835b 100644 --- a/include/shlguid.h +++ b/include/shlguid.h @@ -15,30 +15,20 @@ DEFINE_SHLGUID(CGID_ShellDocView, 0x000214D1L, 0, 0); /* shell32interface ids */ DEFINE_SHLGUID(IID_INewShortcutHookA, 0x000214E1L, 0, 0); -DEFINE_SHLGUID(IID_IShellBrowser, 0x000214E2L, 0, 0); -#define SID_SShellBrowser IID_IShellBrowser -DEFINE_SHLGUID(IID_IShellView, 0x000214E3L, 0, 0); -DEFINE_SHLGUID(IID_IContextMenu, 0x000214E4L, 0, 0); DEFINE_SHLGUID(IID_IShellIcon, 0x000214E5L, 0, 0); -DEFINE_SHLGUID(IID_IShellExtInit, 0x000214E8L, 0, 0); DEFINE_SHLGUID(IID_IShellPropSheetExt, 0x000214E9L, 0, 0); -DEFINE_SHLGUID(IID_IExtractIcon, 0x000214EBL, 0, 0); DEFINE_SHLGUID(IID_IShellCopyHook, 0x000214EFL, 0, 0); DEFINE_SHLGUID(IID_IFileViewer, 0x000214F0L, 0, 0); -DEFINE_SHLGUID(IID_ICommDlgBrowser, 0x000214F1L, 0, 0); DEFINE_SHLGUID(IID_IFileViewerSite, 0x000214F3L, 0, 0); -DEFINE_SHLGUID(IID_IContextMenu2, 0x000214F4L, 0, 0); DEFINE_SHLGUID(IID_IShellExecuteHookA, 0x000214F5L, 0, 0); DEFINE_SHLGUID(IID_IPropSheetPage, 0x000214F6L, 0, 0); DEFINE_SHLGUID(IID_INewShortcutHookW, 0x000214F7L, 0, 0); DEFINE_SHLGUID(IID_IFileViewerW, 0x000214F8L, 0, 0); -DEFINE_SHLGUID(IID_IExtractIconW, 0x000214FAL, 0, 0); DEFINE_SHLGUID(IID_IShellExecuteHookW, 0x000214FBL, 0, 0); DEFINE_SHLGUID(IID_IShellCopyHookW, 0x000214FCL, 0, 0); DEFINE_GUID (IID_IDockingWindow, 0x012dd920L, 0x7B26, 0x11D0, 0x8C, 0xA9, 0x00, 0xA0, 0xC9, 0x2D, 0xBF, 0xE8); DEFINE_GUID (IID_IDockingWindowSite, 0x2A342FC2L, 0x7B26, 0x11D0, 0x8C, 0xA9, 0x00, 0xA0, 0xC9, 0x2D, 0xBF, 0xE8); -DEFINE_GUID (IID_IDockingWindowFrame, 0x47D2657AL, 0x7B27, 0x11D0, 0x8C, 0xA9, 0x00, 0xA0, 0xC9, 0x2D, 0xBF, 0xE8); /**************************************************************************** * the following should be moved to the right place diff --git a/include/shlobj.h b/include/shlobj.h index 217d2780b69..5871c90df83 100644 --- a/include/shlobj.h +++ b/include/shlobj.h @@ -1,11 +1,18 @@ #ifndef __WINE_SHLOBJ_H #define __WINE_SHLOBJ_H -#include "windef.h" -#include "winbase.h" /* WIN32_FIND_* */ #include "wine/obj_base.h" #include "wine/obj_shelllink.h" #include "wine/obj_shellfolder.h" +#include "wine/obj_shellbrowser.h" +#include "wine/obj_contextmenu.h" +#include "wine/obj_shellextinit.h" +#include "wine/obj_extracticon.h" +#include "wine/obj_commdlgbrowser.h" +#include "wine/obj_dockingwindowframe.h" + +#include "windef.h" +#include "winbase.h" /* WIN32_FIND_* */ #include "ole2.h" #include "shell.h" #include "commctrl.h" @@ -17,142 +24,14 @@ #define FAR #define THIS_ THIS, -/**************************************************************************** -* DllGetClassObject -*/ -DWORD WINAPI SHELL32_DllGetClassObject(REFCLSID,REFIID,LPVOID*); - - - /* foreward declaration of the objects*/ -typedef struct IContextMenu IContextMenu, *LPCONTEXTMENU; -typedef struct tagSHELLEXTINIT *LPSHELLEXTINIT,IShellExtInit; -typedef struct tagSHELLVIEW *LPSHELLVIEW, IShellView; -typedef struct tagSHELLBROWSER *LPSHELLBROWSER,IShellBrowser; typedef struct tagSHELLICON *LPSHELLICON, IShellIcon; -typedef struct tagDOCKINGWINDOWFRAME *LPDOCKINGWINDOWFRAME, IDockingWindowFrame; -typedef struct tagCOMMDLGBROWSER *LPCOMMDLGBROWSER, ICommDlgBrowser; - + /***************************************************************************** * IContextMenu interface */ -#define THIS LPCONTEXTMENU me -/* default menu items*/ -#define IDM_EXPLORE 0 -#define IDM_OPEN 1 -#define IDM_RENAME 2 -#define IDM_LAST IDM_RENAME - -/* QueryContextMenu uFlags */ -#define CMF_NORMAL 0x00000000 -#define CMF_DEFAULTONLY 0x00000001 -#define CMF_VERBSONLY 0x00000002 -#define CMF_EXPLORE 0x00000004 -#define CMF_NOVERBS 0x00000008 -#define CMF_CANRENAME 0x00000010 -#define CMF_NODEFAULT 0x00000020 -#define CMF_INCLUDESTATIC 0x00000040 -#define CMF_RESERVED 0xffff0000 /* View specific */ - -/* GetCommandString uFlags */ -#define GCS_VERBA 0x00000000 /* canonical verb */ -#define GCS_HELPTEXTA 0x00000001 /* help text (for status bar) */ -#define GCS_VALIDATEA 0x00000002 /* validate command exists */ -#define GCS_VERBW 0x00000004 /* canonical verb (unicode) */ -#define GCS_HELPTEXTW 0x00000005 /* help text (unicode version) */ -#define GCS_VALIDATEW 0x00000006 /* validate command exists (unicode) */ -#define GCS_UNICODE 0x00000004 /* for bit testing - Unicode string */ - -#define GCS_VERB GCS_VERBA -#define GCS_HELPTEXT GCS_HELPTEXTA -#define GCS_VALIDATE GCS_VALIDATEA - -#define CMDSTR_NEWFOLDERA "NewFolder" -#define CMDSTR_VIEWLISTA "ViewList" -#define CMDSTR_VIEWDETAILSA "ViewDetails" -#define CMDSTR_NEWFOLDERW L"NewFolder" -#define CMDSTR_VIEWLISTW L"ViewList" -#define CMDSTR_VIEWDETAILSW L"ViewDetails" - -#define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERA -#define CMDSTR_VIEWLIST CMDSTR_VIEWLISTA -#define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSA - -#define CMIC_MASK_HOTKEY SEE_MASK_HOTKEY -#define CMIC_MASK_ICON SEE_MASK_ICON -#define CMIC_MASK_FLAG_NO_UI SEE_MASK_FLAG_NO_UI -#define CMIC_MASK_UNICODE SEE_MASK_UNICODE -#define CMIC_MASK_NO_CONSOLE SEE_MASK_NO_CONSOLE -#define CMIC_MASK_HASLINKNAME SEE_MASK_HASLINKNAME -#define CMIC_MASK_FLAG_SEP_VDM SEE_MASK_FLAG_SEPVDM -#define CMIC_MASK_HASTITLE SEE_MASK_HASTITLE -#define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK - -#define CMIC_MASK_PTINVOKE 0x20000000 - -/*NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor */ -typedef struct tagCMINVOKECOMMANDINFO -{ DWORD cbSize; /* sizeof(CMINVOKECOMMANDINFO) */ - DWORD fMask; /* any combination of CMIC_MASK_* */ - HWND hwnd; /* might be NULL (indicating no owner window) */ - LPCSTR lpVerb; /* either a string or MAKEINTRESOURCE(idOffset) */ - LPCSTR lpParameters; /* might be NULL (indicating no parameter) */ - LPCSTR lpDirectory; /* might be NULL (indicating no specific directory) */ - INT nShow; /* one of SW_ values for ShowWindow() API */ - - DWORD dwHotKey; - HANDLE hIcon; -} CMINVOKECOMMANDINFO, *LPCMINVOKECOMMANDINFO; - -typedef struct tagCMInvokeCommandInfoEx -{ DWORD cbSize; /* must be sizeof(CMINVOKECOMMANDINFOEX) */ - DWORD fMask; /* any combination of CMIC_MASK_* */ - HWND hwnd; /* might be NULL (indicating no owner window) */ - LPCSTR lpVerb; /* either a string or MAKEINTRESOURCE(idOffset) */ - LPCSTR lpParameters; /* might be NULL (indicating no parameter) */ - LPCSTR lpDirectory; /* might be NULL (indicating no specific directory) */ - INT nShow; /* one of SW_ values for ShowWindow() API */ - - DWORD dwHotKey; - - HANDLE hIcon; - LPCSTR lpTitle; /* For CreateProcess-StartupInfo.lpTitle */ - LPCWSTR lpVerbW; /* Unicode verb (for those who can use it) */ - LPCWSTR lpParametersW; /* Unicode parameters (for those who can use it) */ - LPCWSTR lpDirectoryW; /* Unicode directory (for those who can use it) */ - LPCWSTR lpTitleW; /* Unicode title (for those who can use it) */ - POINT ptInvoke; /* Point where it's invoked */ - -} CMINVOKECOMMANDINFOEX, *LPCMINVOKECOMMANDINFOEX; -#undef THIS - - -#define ICOM_INTERFACE IContextMenu -#define IContextMenu_METHODS \ - ICOM_METHOD5(HRESULT,QueryContextMenu, HMENU,hmenu, UINT,indexMenu, UINT,idCmdFirst, UINT,idCmdLast, UINT,uFlags) \ - ICOM_METHOD1(HRESULT,InvokeCommand, LPCMINVOKECOMMANDINFO,lpici) \ - ICOM_METHOD5(HRESULT,GetCommandString, UINT,idCmd, UINT,uType, UINT*,pwReserved, LPSTR,pszName, UINT,cchMax) \ - ICOM_METHOD3(HRESULT,HandleMenuMsg, UINT,uMsg,WPARAM,wParam,LPARAM,lParam) \ - void * guard; /*possibly another nasty entry from ContextMenu3 ?*/ -#define IContextMenu_IMETHODS \ - IUnknown_IMETHODS \ - IContextMenu_METHODS -ICOM_DEFINE(IContextMenu, IUnknown) -#undef ICOM_INTERFACE - -#ifdef ICOM_CINTERFACE -// *** IUnknown methods *** // -#define IContextMenu_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IContextMenu_AddRef(p) ICOM_CALL (AddRef,p) -#define IContextMenu_Release(p) ICOM_CALL (Release,p) -// *** IContextMenu methods *** // -#define IContextMenu_QueryContextMenu(p,a,b,c,d,e) ICOM_CALL5(QueryContextMenu,p,a,b,c,d,e) -#define IContextMenu_InvokeCommand(p,a) ICOM_CALL1(InvokeCommand,p,a) -#define IContextMenu_GetCommandString(p,a,b,c,d,e) ICOM_CALL5(GetCommandString,p,a,b,c,d,e) -#define IContextMenu_HandleMenuMsg(p,a,b,c) ICOM_CALL3(HandleMenuMsg,p,a,b,c) -#endif /* DATAOBJECT_InitShellIDList*/ #define CFSTR_SHELLIDLIST "Shell IDList Array" /* CF_IDLIST */ @@ -225,357 +104,15 @@ extern void IDLList_Destructor(LPIDLLIST me); #undef THIS -/***************************************************************************** - * IShellExtInit interface - */ -#define THIS LPSHELLEXTINIT me - -typedef struct IShellExtInit_VTable -{ /* *** IUnknown methods *** */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* *** IShellExtInit methods *** */ - STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY hkeyProgID) PURE; -} IShellExtInit_VTable,*LPSHELLEXTINIT_VTABLE; - -struct tagSHELLEXTINIT -{ LPSHELLEXTINIT_VTABLE lpvtbl; - DWORD ref; -}; - -#undef THIS - -/*-------------------------------------------------------------------------- */ -/* */ -/* FOLDERSETTINGS */ -/* */ -/* FOLDERSETTINGS is a data structure that explorer passes from one folder */ -/* view to another, when the user is browsing. It calls ISV::GetCurrentInfo */ -/* member to get the current settings and pass it to ISV::CreateViewWindow */ -/* to allow the next folder view "inherit" it. These settings assumes a */ -/* particular UI (which the shell's folder view has), and shell extensions */ -/* may or may not use those settings. */ -/* */ -/*-------------------------------------------------------------------------- */ - -typedef LPBYTE LPVIEWSETTINGS; - -/* NB Bitfields. */ -/* FWF_DESKTOP implies FWF_TRANSPARENT/NOCLIENTEDGE/NOSCROLL */ -typedef enum -{ FWF_AUTOARRANGE = 0x0001, - FWF_ABBREVIATEDNAMES = 0x0002, - FWF_SNAPTOGRID = 0x0004, - FWF_OWNERDATA = 0x0008, - FWF_BESTFITWINDOW = 0x0010, - FWF_DESKTOP = 0x0020, - FWF_SINGLESEL = 0x0040, - FWF_NOSUBFOLDERS = 0x0080, - FWF_TRANSPARENT = 0x0100, - FWF_NOCLIENTEDGE = 0x0200, - FWF_NOSCROLL = 0x0400, - FWF_ALIGNLEFT = 0x0800, - FWF_SINGLECLICKACTIVATE=0x8000 /* TEMPORARY -- NO UI FOR THIS */ -} FOLDERFLAGS; - -typedef enum -{ FVM_ICON = 1, - FVM_SMALLICON = 2, - FVM_LIST = 3, - FVM_DETAILS = 4 -} FOLDERVIEWMODE; - -typedef struct -{ UINT ViewMode; /* View mode (FOLDERVIEWMODE values) */ - UINT fFlags; /* View options (FOLDERFLAGS bits) */ -} FOLDERSETTINGS, *LPFOLDERSETTINGS; - -typedef const FOLDERSETTINGS * LPCFOLDERSETTINGS; - - -/************************************************************************ -* IShellBrowser interface -*/ -#define THIS LPSHELLBROWSER me -/* targets for GetWindow/SendControlMsg */ -#define FCW_STATUS 0x0001 -#define FCW_TOOLBAR 0x0002 -#define FCW_TREE 0x0003 -#define FCW_INTERNETBAR 0x0006 -#define FCW_PROGRESS 0x0008 - -/* wFlags for BrowseObject*/ -#define SBSP_DEFBROWSER 0x0000 -#define SBSP_SAMEBROWSER 0x0001 -#define SBSP_NEWBROWSER 0x0002 - -#define SBSP_DEFMODE 0x0000 -#define SBSP_OPENMODE 0x0010 -#define SBSP_EXPLOREMODE 0x0020 - -#define SBSP_ABSOLUTE 0x0000 -#define SBSP_RELATIVE 0x1000 -#define SBSP_PARENT 0x2000 -#define SBSP_NAVIGATEBACK 0x4000 -#define SBSP_NAVIGATEFORWARD 0x8000 - -#define SBSP_ALLOW_AUTONAVIGATE 0x10000 - -#define SBSP_INITIATEDBYHLINKFRAME 0x80000000 -#define SBSP_REDIRECT 0x40000000 -#define SBSP_WRITENOHISTORY 0x08000000 - -/* uFlage for SetToolbarItems */ -#define FCT_MERGE 0x0001 -#define FCT_CONFIGABLE 0x0002 -#define FCT_ADDTOEND 0x0004 - -/* undocumented, found in the web posted by Chris Becke */ -#define CWM_SETPATH (WM_USER+2) -#define CWM_WANTIDLE (WM_USER+3) -#define CWM_GETSETCURRENTINFO (WM_USER+4) -#define CWM_SELECTITEM (WM_USER+5) -#define CWM_STOPWAITING (WM_USER+6) -#define CWM_GETISHELLBROWSER (WM_USER+7) - -typedef struct IShellBrowser_VTable -{ /* *** IUnknown methods *** */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* *** IOleWindow methods *** */ - STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE; - STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE; - - /* *** IShellBrowser methods *** (same as IOleInPlaceFrame) */ - STDMETHOD(InsertMenusSB) (THIS_ HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) PURE; - STDMETHOD(SetMenuSB) (THIS_ HMENU hmenuShared, HOLEMENU holemenuReserved, HWND hwndActiveObject) PURE; - STDMETHOD(RemoveMenusSB) (THIS_ HMENU hmenuShared) PURE; - STDMETHOD(SetStatusTextSB) (THIS_ LPCOLESTR lpszStatusText) PURE; - STDMETHOD(EnableModelessSB) (THIS_ BOOL fEnable) PURE; - STDMETHOD(TranslateAcceleratorSB) (THIS_ LPMSG lpmsg, WORD wID) PURE; - - /* *** IShellBrowser methods *** */ - STDMETHOD(BrowseObject)(THIS_ LPCITEMIDLIST pidl, UINT wFlags) PURE; - STDMETHOD(GetViewStateStream)(THIS_ DWORD grfMode, LPSTREAM *ppStrm) PURE; - STDMETHOD(GetControlWindow)(THIS_ UINT id, HWND * lphwnd) PURE; - STDMETHOD(SendControlMsg)(THIS_ UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT * pret) PURE; - STDMETHOD(QueryActiveShellView)(THIS_ IShellView ** ppshv) PURE; - STDMETHOD(OnViewWindowActive)(THIS_ IShellView * ppshv) PURE; - STDMETHOD(SetToolbarItems)(THIS_ LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags) PURE; -} *LPSHELLBROWSER_VTABLE,IShellBrowser_VTable; - -struct tagSHELLBROWSER -{ LPSHELLBROWSER_VTABLE lpvtbl; - DWORD ref; -}; - -#undef THIS - /************************************************************************ * IShellView interface */ -#define THIS LPSHELLVIEW me - -/* shellview select item flags*/ -#define SVSI_DESELECT 0x0000 -#define SVSI_SELECT 0x0001 -#define SVSI_EDIT 0x0003 /* includes select */ -#define SVSI_DESELECTOTHERS 0x0004 -#define SVSI_ENSUREVISIBLE 0x0008 -#define SVSI_FOCUSED 0x0010 - -/* shellview get item object flags */ -#define SVGIO_BACKGROUND 0x00000000 -#define SVGIO_SELECTION 0x00000001 -#define SVGIO_ALLVIEW 0x00000002 - -/* The explorer dispatches WM_COMMAND messages based on the range of - command/menuitem IDs. All the IDs of menuitems that the view (right - pane) inserts must be in FCIDM_SHVIEWFIRST/LAST (otherwise, the explorer - won't dispatch them). The view should not deal with any menuitems - in FCIDM_BROWSERFIRST/LAST (otherwise, it won't work with the future - version of the shell). - - FCIDM_SHVIEWFIRST/LAST for the right pane (IShellView) - FCIDM_BROWSERFIRST/LAST for the explorer frame (IShellBrowser) - FCIDM_GLOBAL/LAST for the explorer's submenu IDs -*/ -#define FCIDM_SHVIEWFIRST 0x0000 -/* undocumented */ -#define FCIDM_SHVIEW_ARRANGE 0x7001 -#define FCIDM_SHVIEW_DELETE 0x7011 -#define FCIDM_SHVIEW_PROPERTIES 0x7013 -#define FCIDM_SHVIEW_CUT 0x7018 -#define FCIDM_SHVIEW_COPY 0x7019 -#define FCIDM_SHVIEW_INSERT 0x701A -#define FCIDM_SHVIEW_UNDO 0x701B -#define FCIDM_SHVIEW_INSERTLINK 0x701C -#define FCIDM_SHVIEW_SELECTALL 0x7021 -#define FCIDM_SHVIEW_INVERTSELECTION 0x7022 -#define FCIDM_SHVIEW_BIGICON 0x7029 -#define FCIDM_SHVIEW_SMALLICON 0x702A -#define FCIDM_SHVIEW_LISTVIEW 0x702B -#define FCIDM_SHVIEW_REPORTVIEW 0x702C -#define FCIDM_SHVIEW_AUTOARRANGE 0x7031 -#define FCIDM_SHVIEW_SNAPTOGRID 0x7032 -#define FCIDM_SHVIEW_HELP 0x7041 - -#define FCIDM_SHVIEWLAST 0x7fff -#define FCIDM_BROWSERFIRST 0xA000 -/* undocumented toolbar items from stddlg's*/ -#define FCIDM_TB_SMALLICON 0xA003 -#define FCIDM_TB_REPORTVIEW 0xA004 - -#define FCIDM_BROWSERLAST 0xbf00 -#define FCIDM_GLOBALFIRST 0x8000 -#define FCIDM_GLOBALLAST 0x9fff - -/* -* Global submenu IDs and separator IDs -*/ -#define FCIDM_MENU_FILE (FCIDM_GLOBALFIRST+0x0000) -#define FCIDM_MENU_EDIT (FCIDM_GLOBALFIRST+0x0040) -#define FCIDM_MENU_VIEW (FCIDM_GLOBALFIRST+0x0080) -#define FCIDM_MENU_VIEW_SEP_OPTIONS (FCIDM_GLOBALFIRST+0x0081) -#define FCIDM_MENU_TOOLS (FCIDM_GLOBALFIRST+0x00c0) -#define FCIDM_MENU_TOOLS_SEP_GOTO (FCIDM_GLOBALFIRST+0x00c1) -#define FCIDM_MENU_HELP (FCIDM_GLOBALFIRST+0x0100) -#define FCIDM_MENU_FIND (FCIDM_GLOBALFIRST+0x0140) -#define FCIDM_MENU_EXPLORE (FCIDM_GLOBALFIRST+0x0150) -#define FCIDM_MENU_FAVORITES (FCIDM_GLOBALFIRST+0x0170) - -/* control IDs known to the view */ -#define FCIDM_TOOLBAR (FCIDM_BROWSERFIRST + 0) -#define FCIDM_STATUS (FCIDM_BROWSERFIRST + 1) - -/* uState values for IShellView::UIActivate */ -typedef enum -{ SVUIA_DEACTIVATE = 0, - SVUIA_ACTIVATE_NOFOCUS = 1, - SVUIA_ACTIVATE_FOCUS = 2, - SVUIA_INPLACEACTIVATE = 3 /* new flag for IShellView2 */ -} SVUIA_STATUS; -typedef struct IShellView_VTable -{ /* *** IUnknown methods *** */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* *** IOleWindow methods *** */ - STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE; - STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE; - - /* *** IShellView methods *** */ - STDMETHOD(TranslateAccelerator) (THIS_ LPMSG lpmsg) PURE; - STDMETHOD(EnableModeless) (THIS_ BOOL fEnable) PURE; - STDMETHOD(UIActivate) (THIS_ UINT uState) PURE; - STDMETHOD(Refresh) (THIS) PURE; - STDMETHOD(CreateViewWindow)(THIS_ IShellView *lpPrevView,LPCFOLDERSETTINGS lpfs, IShellBrowser * psb,RECT * prcView, HWND *phWnd) PURE; - STDMETHOD(DestroyViewWindow)(THIS) PURE; - STDMETHOD(GetCurrentInfo)(THIS_ LPFOLDERSETTINGS lpfs) PURE; - STDMETHOD(AddPropertySheetPages)(THIS_ DWORD dwReserved,LPFNADDPROPSHEETPAGE lpfn, LPARAM lparam) PURE; - STDMETHOD(SaveViewState)(THIS) PURE; - STDMETHOD(SelectItem)(THIS_ LPCITEMIDLIST pidlItem, UINT uFlags) PURE; - STDMETHOD(GetItemObject)(THIS_ UINT uItem, REFIID riid,LPVOID *ppv) PURE; -} IShellView_VTable,*LPSHELLVIEW_VTABLE; - -struct tagSHELLVIEW -{ LPSHELLVIEW_VTABLE lpvtbl; - DWORD ref; - LPITEMIDLIST mpidl; - LPSHELLFOLDER pSFParent; - LPSHELLBROWSER pShellBrowser; - LPCOMMDLGBROWSER pCommDlgBrowser; - HWND hWnd; - HWND hWndList; - HWND hWndParent; - FOLDERSETTINGS FolderSettings; - HMENU hMenu; - UINT uState; - UINT uSelected; - LPITEMIDLIST *aSelectedItems; -}; - typedef GUID SHELLVIEWID; #define SV_CLASS_NAME ("SHELLDLL_DefView") -#undef THIS -/**************************************************************************** - * ICommDlgBrowser interface - */ -#define THIS LPCOMMDLGBROWSER me - -/* for OnStateChange*/ -#define CDBOSC_SETFOCUS 0x00000000 -#define CDBOSC_KILLFOCUS 0x00000001 -#define CDBOSC_SELCHANGE 0x00000002 -#define CDBOSC_RENAME 0x00000003 - -typedef struct ICommDlgBrowser_VTable -{ /* IUnknown methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* ICommDlgBrowser methods */ - STDMETHOD(OnDefaultCommand) (THIS_ LPSHELLVIEW ppshv) PURE; - STDMETHOD(OnStateChange) (THIS_ LPSHELLVIEW ppshv, ULONG uChange) PURE; - STDMETHOD(IncludeObject) (THIS_ LPSHELLVIEW ppshv, LPCITEMIDLIST pidl) PURE; -} ICommDlgBrowser_VTable,*LPCOMMDLGBROWSER_VTABLE; - -struct tagCOMMDLGBROWSER -{ LPCOMMDLGBROWSER_VTABLE lpvtbl; - DWORD ref; -}; -#undef THIS - -/**************************************************************************** - * IExtractIconinterface - * - * FIXME - * Is the ExtractIconA interface - */ -#define THIS LPEXTRACTICON me - -/* GetIconLocation() input flags*/ -#define GIL_OPENICON 0x0001 /* allows containers to specify an "open" look */ -#define GIL_FORSHELL 0x0002 /* icon is to be displayed in a ShellFolder */ -#define GIL_ASYNC 0x0020 /* this is an async extract, return E_ASYNC */ - -/* GetIconLocation() return flags */ -#define GIL_SIMULATEDOC 0x0001 /* simulate this document icon for this */ -#define GIL_PERINSTANCE 0x0002 /* icons from this class are per instance (each file has its own) */ -#define GIL_PERCLASS 0x0004 /* icons from this class per class (shared for all files of this type) */ -#define GIL_NOTFILENAME 0x0008 /* location is not a filename, must call ::ExtractIcon */ -#define GIL_DONTCACHE 0x0010 /* this icon should not be cached */ - -typedef struct IExtractIcon IExtractIcon,*LPEXTRACTICON; -typedef struct IExtractIcon_VTable -{ /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /*** IExtractIcon methods ***/ - STDMETHOD(GetIconLocation)(THIS_ UINT uFlags, LPSTR szIconFile, UINT cchMax,INT * piIndex, UINT * pwFlags) PURE; - STDMETHOD(Extract)(THIS_ LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) PURE; -}IExtractIcon_VTable,*LPEXTRACTICON_VTABLE; - -struct IExtractIcon -{ LPEXTRACTICON_VTABLE lpvtbl; - DWORD ref; - LPITEMIDLIST pidl; -}; - -#undef THIS - DWORD WINAPI SHMapPIDLToSystemImageListIndex(LPSHELLFOLDER sh,LPITEMIDLIST pidl,DWORD z); /**************************************************************************** @@ -599,36 +136,7 @@ struct tagSHELLICON DWORD ref; }; #undef THIS -/**************************************************************************** - * IDockingWindowFrame interface - */ -#define THIS LPDOCKINGWINDOWFRAME me -#define DWFRF_NORMAL 0x0000 /* femove toolbar flags*/ -#define DWFRF_DELETECONFIGDATA 0x0001 -#define DWFAF_HIDDEN 0x0001 /* add tolbar*/ - -typedef struct IDockingWindowFrame_VTable -{ STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /*** IOleWindow methods ***/ - STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE; - STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE; - - /*** IDockingWindowFrame methods ***/ - STDMETHOD(AddToolbar) (THIS_ IUnknown* punkSrc, LPCWSTR pwszItem, DWORD dwAddFlags) PURE; - STDMETHOD(RemoveToolbar) (THIS_ IUnknown* punkSrc, DWORD dwRemoveFlags) PURE; - STDMETHOD(FindToolbar) (THIS_ LPCWSTR pwszItem, REFIID riid, LPVOID* ppvObj) PURE; -} IDockingWindowFrame_VTable, *LPDOCKINGWINDOWFRAME_VTABLE; - -struct tagDOCKINGWINDOWFRAME -{ LPDOCKINGWINDOWFRAME_VTABLE lpvtbl; - DWORD ref; -}; - -#undef THIS /**************************************************************************** * Shell Execute API */ diff --git a/include/wine/obj_base.h b/include/wine/obj_base.h index 914c7cf8bc7..48a05ab0c37 100644 --- a/include/wine/obj_base.h +++ b/include/wine/obj_base.h @@ -853,6 +853,12 @@ HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid,LPUNKNOWN pUnk,DWORD dwClsC HRESULT WINAPI CoRevokeClassObject(DWORD dwRegister); +/***************************************************************************** + * COM Server dll - exports + */ +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv); +HRESULT WINAPI DllCanUnloadNow(void); + /***************************************************************************** * Internal WINE API */ diff --git a/include/wine/obj_commdlgbrowser.h b/include/wine/obj_commdlgbrowser.h new file mode 100644 index 00000000000..4e2a264b22f --- /dev/null +++ b/include/wine/obj_commdlgbrowser.h @@ -0,0 +1,44 @@ +/************************************************************ + * ICommDlgBrowser + */ + +#ifndef __WINE_WINE_OBJ_ICOMMDLGBROWSER_H +#define __WINE_WINE_OBJ_ICOMMDLGBROWSER_H + +#include "winbase.h" +#include "winuser.h" +#include "wine/obj_base.h" +#include "wine/obj_shellview.h" + +DEFINE_SHLGUID(IID_ICommDlgBrowser, 0x000214F1L, 0, 0); +typedef struct ICommDlgBrowser ICommDlgBrowser, *LPCOMMDLGBROWSER; + +/* for OnStateChange*/ +#define CDBOSC_SETFOCUS 0x00000000 +#define CDBOSC_KILLFOCUS 0x00000001 +#define CDBOSC_SELCHANGE 0x00000002 +#define CDBOSC_RENAME 0x00000003 + + +#define ICOM_INTERFACE ICommDlgBrowser +#define ICommDlgBrowser_METHODS \ + ICOM_METHOD1(HRESULT, OnDefaultCommand, IShellView*, IShellView) \ + ICOM_METHOD2(HRESULT, OnStateChange, IShellView*, IShellView, ULONG, uChange) \ + ICOM_METHOD2(HRESULT, IncludeObject, IShellView*, IShellView, LPCITEMIDLIST, pidl) +#define ICommDlgBrowser_IMETHODS \ + IUnknown_IMETHODS \ + ICommDlgBrowser_METHODS +ICOM_DEFINE(ICommDlgBrowser,IUnknown) +#undef ICOM_INTERFACE + +#ifdef ICOM_CINTERFACE +#define ICommDlgBrowser_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) +#define ICommDlgBrowser_AddRef(p) ICOM_CALL(AddRef,p) +#define ICommDlgBrowser_Release(p) ICOM_CALL(Release,p) +#define ICommDlgBrowser_OnDefaultCommand(p,a) ICOM_CALL1(OnDefaultCommand,p,a) +#define ICommDlgBrowser_OnStateChange(p,a,b) ICOM_CALL2(OnStateChange,p,a,b) +#define ICommDlgBrowser_IncludeObject(p,a,b) ICOM_CALL2(IncludeObject,p,a,b) +#endif + + +#endif /* __WINE_WINE_OBJ_ICOMMDLGBROWSER_H */ diff --git a/include/wine/obj_contextmenu.h b/include/wine/obj_contextmenu.h new file mode 100644 index 00000000000..3903b4361c5 --- /dev/null +++ b/include/wine/obj_contextmenu.h @@ -0,0 +1,128 @@ +/************************************************************ + * IContextMenu + */ + +#ifndef __WINE_WINE_OBJ_ICONTEXTMENU_H +#define __WINE_WINE_OBJ_ICONTEXTMENU_H + +#include "winbase.h" +#include "winuser.h" +#include "wine/obj_base.h" + +DEFINE_SHLGUID(IID_IContextMenu, 0x000214E4L, 0, 0); +DEFINE_SHLGUID(IID_IContextMenu2, 0x000214F4L, 0, 0); +typedef struct IContextMenu IContextMenu, *LPCONTEXTMENU; + +/* default menu items*/ +#define IDM_EXPLORE 0 +#define IDM_OPEN 1 +#define IDM_RENAME 2 +#define IDM_LAST IDM_RENAME + +/* QueryContextMenu uFlags */ +#define CMF_NORMAL 0x00000000 +#define CMF_DEFAULTONLY 0x00000001 +#define CMF_VERBSONLY 0x00000002 +#define CMF_EXPLORE 0x00000004 +#define CMF_NOVERBS 0x00000008 +#define CMF_CANRENAME 0x00000010 +#define CMF_NODEFAULT 0x00000020 +#define CMF_INCLUDESTATIC 0x00000040 +#define CMF_RESERVED 0xffff0000 /* View specific */ + +/* GetCommandString uFlags */ +#define GCS_VERBA 0x00000000 /* canonical verb */ +#define GCS_HELPTEXTA 0x00000001 /* help text (for status bar) */ +#define GCS_VALIDATEA 0x00000002 /* validate command exists */ +#define GCS_VERBW 0x00000004 /* canonical verb (unicode) */ +#define GCS_HELPTEXTW 0x00000005 /* help text (unicode version) */ +#define GCS_VALIDATEW 0x00000006 /* validate command exists (unicode) */ +#define GCS_UNICODE 0x00000004 /* for bit testing - Unicode string */ + +#define GCS_VERB GCS_VERBA +#define GCS_HELPTEXT GCS_HELPTEXTA +#define GCS_VALIDATE GCS_VALIDATEA + +#define CMDSTR_NEWFOLDERA "NewFolder" +#define CMDSTR_VIEWLISTA "ViewList" +#define CMDSTR_VIEWDETAILSA "ViewDetails" +#define CMDSTR_NEWFOLDERW L"NewFolder" +#define CMDSTR_VIEWLISTW L"ViewList" +#define CMDSTR_VIEWDETAILSW L"ViewDetails" + +#define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERA +#define CMDSTR_VIEWLIST CMDSTR_VIEWLISTA +#define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSA + +#define CMIC_MASK_HOTKEY SEE_MASK_HOTKEY +#define CMIC_MASK_ICON SEE_MASK_ICON +#define CMIC_MASK_FLAG_NO_UI SEE_MASK_FLAG_NO_UI +#define CMIC_MASK_UNICODE SEE_MASK_UNICODE +#define CMIC_MASK_NO_CONSOLE SEE_MASK_NO_CONSOLE +#define CMIC_MASK_HASLINKNAME SEE_MASK_HASLINKNAME +#define CMIC_MASK_FLAG_SEP_VDM SEE_MASK_FLAG_SEPVDM +#define CMIC_MASK_HASTITLE SEE_MASK_HASTITLE +#define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK + +#define CMIC_MASK_PTINVOKE 0x20000000 + +/*NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor */ +typedef struct tagCMINVOKECOMMANDINFO +{ DWORD cbSize; /* sizeof(CMINVOKECOMMANDINFO) */ + DWORD fMask; /* any combination of CMIC_MASK_* */ + HWND hwnd; /* might be NULL (indicating no owner window) */ + LPCSTR lpVerb; /* either a string or MAKEINTRESOURCE(idOffset) */ + LPCSTR lpParameters; /* might be NULL (indicating no parameter) */ + LPCSTR lpDirectory; /* might be NULL (indicating no specific directory) */ + INT nShow; /* one of SW_ values for ShowWindow() API */ + + DWORD dwHotKey; + HANDLE hIcon; +} CMINVOKECOMMANDINFO, *LPCMINVOKECOMMANDINFO; + +typedef struct tagCMInvokeCommandInfoEx +{ DWORD cbSize; /* must be sizeof(CMINVOKECOMMANDINFOEX) */ + DWORD fMask; /* any combination of CMIC_MASK_* */ + HWND hwnd; /* might be NULL (indicating no owner window) */ + LPCSTR lpVerb; /* either a string or MAKEINTRESOURCE(idOffset) */ + LPCSTR lpParameters; /* might be NULL (indicating no parameter) */ + LPCSTR lpDirectory; /* might be NULL (indicating no specific directory) */ + INT nShow; /* one of SW_ values for ShowWindow() API */ + + DWORD dwHotKey; + + HANDLE hIcon; + LPCSTR lpTitle; /* For CreateProcess-StartupInfo.lpTitle */ + LPCWSTR lpVerbW; /* Unicode verb (for those who can use it) */ + LPCWSTR lpParametersW; /* Unicode parameters (for those who can use it) */ + LPCWSTR lpDirectoryW; /* Unicode directory (for those who can use it) */ + LPCWSTR lpTitleW; /* Unicode title (for those who can use it) */ + POINT ptInvoke; /* Point where it's invoked */ + +} CMINVOKECOMMANDINFOEX, *LPCMINVOKECOMMANDINFOEX; + +#define ICOM_INTERFACE IContextMenu +#define IContextMenu_METHODS \ + ICOM_METHOD5(HRESULT, QueryContextMenu, HMENU, hmenu, UINT, indexMenu, UINT, idCmdFirst, UINT, idCmdLast, UINT, uFlags) \ + ICOM_METHOD1(HRESULT, InvokeCommand, LPCMINVOKECOMMANDINFO, lpici) \ + ICOM_METHOD5(HRESULT, GetCommandString, UINT, idCmd, UINT, uType, UINT*, pwReserved, LPSTR, pszName, UINT, cchMax) \ + ICOM_METHOD3(HRESULT, HandleMenuMsg, UINT, uMsg, WPARAM, wParam, LPARAM, lParam) \ + void * guard; /*possibly another nasty entry from ContextMenu3 ?*/ +#define IContextMenu_IMETHODS \ + IUnknown_IMETHODS \ + IContextMenu_METHODS +ICOM_DEFINE(IContextMenu,IUnknown) +#undef ICOM_INTERFACE + +#ifdef ICOM_CINTERFACE +#define IContextMenu_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) +#define IContextMenu_AddRef(p) ICOM_CALL(AddRef,p) +#define IContextMenu_Release(p) ICOM_CALL(Release,p) +#define IContextMenu_QueryContextMenu(p,a,b,c,d,e) ICOM_CALL5(QueryContextMenu,p,a,b,c,d,e) +#define IContextMenu_InvokeCommand(p,a) ICOM_CALL1(InvokeCommand,p,a) +#define IContextMenu_GetCommandString(p,a,b,c,d,e) ICOM_CALL5(GetCommandString,p,a,b,c,d,e) +#define IContextMenu_HandleMenuMsg(p,a,b,c) ICOM_CALL3(HandleMenuMsg,p,a,b,c) +#endif + + +#endif /* __WINE_WINE_OBJ_ICONTEXTMENU_H */ diff --git a/include/wine/obj_dockingwindowframe.h b/include/wine/obj_dockingwindowframe.h new file mode 100644 index 00000000000..5573f119787 --- /dev/null +++ b/include/wine/obj_dockingwindowframe.h @@ -0,0 +1,43 @@ +/************************************************************ + * IDockingWindowFrame + */ + +#ifndef __WINE_WINE_OBJ_IDOCKINGWINDOWFRAME_H +#define __WINE_WINE_OBJ_IDOCKINGWINDOWFRAME_H + +#include "winbase.h" +#include "winuser.h" +#include "wine/obj_base.h" +#include "wine/obj_inplace.h" + +typedef struct IDockingWindowFrame IDockingWindowFrame, *LPDOCKINGWINDOWFRAME; +DEFINE_GUID (IID_IDockingWindowFrame, 0x47D2657AL, 0x7B27, 0x11D0, 0x8C, 0xA9, 0x00, 0xA0, 0xC9, 0x2D, 0xBF, 0xE8); + +#define DWFRF_NORMAL 0x0000 /* femove toolbar flags*/ +#define DWFRF_DELETECONFIGDATA 0x0001 +#define DWFAF_HIDDEN 0x0001 /* add tolbar*/ + +#define ICOM_INTERFACE IDockingWindowFrame +#define IDockingWindowFrame_METHODS \ + ICOM_METHOD3(HRESULT, AddToolbar, IUnknown*, punkSrc, LPCWSTR, pwszItem, DWORD, dwAddFlags) \ + ICOM_METHOD2(HRESULT, RemoveToolbar, IUnknown*, punkSrc, DWORD, dwRemoveFlags) \ + ICOM_METHOD3(HRESULT, FindToolbar, LPCWSTR, pwszItem, REFIID, riid, LPVOID*, ppvObj) +#define IDockingWindowFrame_IMETHODS \ + IOleWindow_IMETHODS \ + IDockingWindowFrame_METHODS +ICOM_DEFINE(IDockingWindowFrame,IOleWindow) +#undef ICOM_INTERFACE + +#ifdef ICOM_CINTERFACE +#define IDockingWindowFrame_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) +#define IDockingWindowFrame_AddRef(p) ICOM_CALL(AddRef,p) +#define IDockingWindowFrame_Release(p) ICOM_CALL(Release,p) +#define IDockingWindowFrame_GetWindow(p,a) ICOM_CALL1(GetWindow,p,a) +#define IDockingWindowFrame_ContextSensitiveHelp(p,a) ICOM_CALL1(ContextSensitiveHelp,p,a) +#define IDockingWindowFrame_AddToolbar(p,a,b,c) ICOM_CALL3(AddToolbar,p,a,b,c) +#define IDockingWindowFrame_RemoveToolbar(p,a,b) ICOM_CALL2(RemoveToolbar,p,a,b) +#define IDockingWindowFrame_FindToolbar(p,a,b,c) ICOM_CALL3(FindToolbar,p,a,b,c) +#endif + + +#endif /* __WINE_WINE_OBJ_IDOCKINGWINDOWFRAME_H */ diff --git a/include/wine/obj_extracticon.h b/include/wine/obj_extracticon.h new file mode 100644 index 00000000000..3d02f946be8 --- /dev/null +++ b/include/wine/obj_extracticon.h @@ -0,0 +1,49 @@ +/************************************************************ + * IExtractIconA + */ + +#ifndef __WINE_WINE_OBJ_IEXTRACTICONA_H +#define __WINE_WINE_OBJ_IEXTRACTICONA_H + +#include "winbase.h" +#include "winuser.h" +#include "wine/obj_base.h" + +DEFINE_SHLGUID(IID_IExtractIconA, 0x000214EBL, 0, 0); +DEFINE_SHLGUID(IID_IExtractIconW, 0x000214FAL, 0, 0); +typedef struct IExtractIconA IExtractIconA,*LPEXTRACTICONA; + +/* GetIconLocation() input flags*/ +#define GIL_OPENICON 0x0001 /* allows containers to specify an "open" look */ +#define GIL_FORSHELL 0x0002 /* icon is to be displayed in a ShellFolder */ +#define GIL_ASYNC 0x0020 /* this is an async extract, return E_ASYNC */ + +/* GetIconLocation() return flags */ +#define GIL_SIMULATEDOC 0x0001 /* simulate this document icon for this */ +#define GIL_PERINSTANCE 0x0002 /* icons from this class are per instance (each file has its own) */ +#define GIL_PERCLASS 0x0004 /* icons from this class per class (shared for all files of this type) */ +#define GIL_NOTFILENAME 0x0008 /* location is not a filename, must call ::ExtractIcon */ +#define GIL_DONTCACHE 0x0010 /* this icon should not be cached */ + + +#define ICOM_INTERFACE IExtractIconA +#define IExtractIconA_METHODS \ + ICOM_METHOD5(HRESULT, GetIconLocation, UINT, uFlags, LPSTR, szIconFile, UINT, cchMax, INT*, piIndex, UINT *, pwFlags) \ + ICOM_METHOD5(HRESULT, Extract, LPCSTR, pszFile, UINT, nIconIndex, HICON*, phiconLarge, HICON*, phiconSmall, UINT, nIconSize) +#define IExtractIconA_IMETHODS \ + IUnknown_IMETHODS \ + IExtractIconA_METHODS +ICOM_DEFINE(IExtractIconA,IUnknown) +#undef ICOM_INTERFACE + +#ifdef ICOM_CINTERFACE +#define IExtractIconA_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) +#define IExtractIconA_AddRef(p) ICOM_CALL(AddRef,p) +#define IExtractIconA_Release(p) ICOM_CALL(Release,p) +#define IExtractIconA_GetIconLocation(p,a,b,c,d,e) ICOM_CALL5(GetIconLocation,p,a,b,c,d,e) +#define IExtractIconA_Extract(p,a,b,c,d,e) ICOM_CALL5(Extract,p,a,b,c,d,e) +#endif + +#define IExtractIcon IExtractIconA + +#endif /* __WINE_WINE_OBJ_IEXTRACTICONA_H */ diff --git a/include/wine/obj_shellbrowser.h b/include/wine/obj_shellbrowser.h new file mode 100644 index 00000000000..961fecff645 --- /dev/null +++ b/include/wine/obj_shellbrowser.h @@ -0,0 +1,106 @@ +/************************************************************ + * IShellBrowser + */ + +#ifndef __WINE_WINE_OBJ_ISHELLBROWSER_H +#define __WINE_WINE_OBJ_ISHELLBROWSER_H + +#include "winbase.h" +#include "winuser.h" +#include "wine/obj_base.h" +#include "wine/obj_inplace.h" /* IOleWindow */ +#include "wine/obj_shellview.h" /* IShellView */ +#include "commctrl.h" /* TBBUTTON */ + +/* it's ok commented out, see obj_shellview.h + typedef struct IShellBrowser IShellBrowser, *LPSHELLBROWSER; +*/ + +DEFINE_SHLGUID(IID_IShellBrowser, 0x000214E2L, 0, 0); +#define SID_SShellBrowser IID_IShellBrowser + +/* targets for GetWindow/SendControlMsg */ +#define FCW_STATUS 0x0001 +#define FCW_TOOLBAR 0x0002 +#define FCW_TREE 0x0003 +#define FCW_INTERNETBAR 0x0006 +#define FCW_PROGRESS 0x0008 + +/* wFlags for BrowseObject*/ +#define SBSP_DEFBROWSER 0x0000 +#define SBSP_SAMEBROWSER 0x0001 +#define SBSP_NEWBROWSER 0x0002 + +#define SBSP_DEFMODE 0x0000 +#define SBSP_OPENMODE 0x0010 +#define SBSP_EXPLOREMODE 0x0020 + +#define SBSP_ABSOLUTE 0x0000 +#define SBSP_RELATIVE 0x1000 +#define SBSP_PARENT 0x2000 +#define SBSP_NAVIGATEBACK 0x4000 +#define SBSP_NAVIGATEFORWARD 0x8000 + +#define SBSP_ALLOW_AUTONAVIGATE 0x10000 + +#define SBSP_INITIATEDBYHLINKFRAME 0x80000000 +#define SBSP_REDIRECT 0x40000000 +#define SBSP_WRITENOHISTORY 0x08000000 + +/* uFlage for SetToolbarItems */ +#define FCT_MERGE 0x0001 +#define FCT_CONFIGABLE 0x0002 +#define FCT_ADDTOEND 0x0004 + +/* undocumented, found in the web posted by Chris Becke */ +#define CWM_SETPATH (WM_USER+2) +#define CWM_WANTIDLE (WM_USER+3) +#define CWM_GETSETCURRENTINFO (WM_USER+4) +#define CWM_SELECTITEM (WM_USER+5) +#define CWM_STOPWAITING (WM_USER+6) +#define CWM_GETISHELLBROWSER (WM_USER+7) + +#define ICOM_INTERFACE IShellBrowser +#define IShellBrowser_METHODS \ + ICOM_METHOD2(HRESULT, InsertMenusSB, HMENU, hmenuShared, LPOLEMENUGROUPWIDTHS, lpMenuWidths) \ + ICOM_METHOD3(HRESULT, SetMenuSB, HMENU, hmenuShared, HOLEMENU, holemenuReserved, HWND, hwndActiveObject) \ + ICOM_METHOD1(HRESULT, RemoveMenusSB, HMENU, hmenuShared) \ + ICOM_METHOD1(HRESULT, SetStatusTextSB, LPCOLESTR, lpszStatusText) \ + ICOM_METHOD1(HRESULT, EnableModelessSB, BOOL, fEnable) \ + ICOM_METHOD2(HRESULT, TranslateAcceleratorSB, LPMSG, lpmsg, WORD, wID) \ + ICOM_METHOD2(HRESULT, BrowseObject, LPCITEMIDLIST, pidl, UINT, wFlags) \ + ICOM_METHOD2(HRESULT, GetViewStateStream, DWORD, grfMode, LPSTREAM*, ppStrm) \ + ICOM_METHOD2(HRESULT, GetControlWindow, UINT, id, HWND*, lphwnd) \ + ICOM_METHOD5(HRESULT, SendControlMsg, UINT, id, UINT, uMsg, WPARAM, wParam, LPARAM, lParam, LRESULT*, pret) \ + ICOM_METHOD1(HRESULT, QueryActiveShellView, IShellView**, IShellView) \ + ICOM_METHOD1(HRESULT, OnViewWindowActive, IShellView*, IShellView) \ + ICOM_METHOD3(HRESULT, SetToolbarItems, LPTBBUTTON, lpButtons, UINT, nButtons, UINT, uFlags) +#define IShellBrowser_IMETHODS \ + IOleWindow_IMETHODS \ + IShellBrowser_METHODS +ICOM_DEFINE(IShellBrowser,IOleWindow) +#undef ICOM_INTERFACE + +#ifdef ICOM_CINTERFACE +#define IShellBrowser_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) +#define IShellBrowser_AddRef(p) ICOM_CALL(AddRef,p) +#define IShellBrowser_Release(p) ICOM_CALL(Release,p) +#define IShellBrowser_GetWindow(p,a) ICOM_CALL1(GetWindow,p,a) +#define IShellBrowser_ContextSensitiveHelp(p,a) ICOM_CALL1(ContextSensitiveHelp,p,a) +#define IShellBrowser_InsertMenusSB(p,a,b) ICOM_CALL2(InsertMenusSB,p,a,b) +#define IShellBrowser_SetMenuSB(p,a,b,c) ICOM_CALL3(SetMenuSB,p,a,b,c) +#define IShellBrowser_RemoveMenusSB(p,a) ICOM_CALL1(RemoveMenusSB,p,a) +#define IShellBrowser_SetStatusTextSB(p,a) ICOM_CALL1(SetStatusTextSB,p,a) +#define IShellBrowser_EnableModelessSB(p,a) ICOM_CALL1(EnableModelessSB,p,a) +#define IShellBrowser_TranslateAcceleratorSB(p,a,b) ICOM_CALL2(TranslateAcceleratorSB,p,a,b) +#define IShellBrowser_BrowseObject(p,a,b) ICOM_CALL2(BrowseObject,p,a,b) +#define IShellBrowser_GetViewStateStream(p,a,b) ICOM_CALL2(GetViewStateStream,p,a,b) +#define IShellBrowser_GetControlWindow(p,a,b) ICOM_CALL2(GetControlWindow,p,a,b) +#define IShellBrowser_SendControlMsg(p,a,b,c,d,e) ICOM_CALL5(SendControlMsg,p,a,b,c,d,e) +#define IShellBrowser_QueryActiveShellView(p,a) ICOM_CALL1(QueryActiveShellView,p,a) +#define IShellBrowser_OnViewWindowActive(p,a) ICOM_CALL1(OnViewWindowActive,p,a) +#define IShellBrowser_SetToolbarItems(p,a,b,c) ICOM_CALL3(SetToolbarItems,p,a,b,c) +#endif + + +#endif /* __WINE_WINE_OBJ_ISHELLBROWSER_H */ diff --git a/include/wine/obj_shellextinit.h b/include/wine/obj_shellextinit.h new file mode 100644 index 00000000000..70437772590 --- /dev/null +++ b/include/wine/obj_shellextinit.h @@ -0,0 +1,33 @@ +/************************************************************ + * IShellExtInit + */ + +#ifndef __WINE_WINE_OBJ_ISHELLEXTINIT_H +#define __WINE_WINE_OBJ_ISHELLEXTINIT_H + +#include "winbase.h" +#include "winuser.h" +#include "wine/obj_base.h" +#include "wine/obj_dataobject.h" + +typedef struct IShellExtInit IShellExtInit, *LPSHELLEXTINIT; +DEFINE_SHLGUID(IID_IShellExtInit, 0x000214E8L, 0, 0); + +#define ICOM_INTERFACE IShellExtInit +#define IShellExtInit_METHODS \ + ICOM_METHOD3(HRESULT, Initialize, LPCITEMIDLIST, pidlFolder, LPDATAOBJECT, lpdobj, HKEY, hkeyProgID) +#define IShellExtInit_IMETHODS \ + IUnknown_IMETHODS \ + IShellExtInit_METHODS +ICOM_DEFINE(IShellExtInit,IUnknown) +#undef ICOM_INTERFACE + +#ifdef ICOM_CINTERFACE +#define IShellExtInit_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) +#define IShellExtInit_AddRef(p) ICOM_CALL(AddRef,p) +#define IShellExtInit_Release(p) ICOM_CALL(Release,p) +#define IShellExtInit_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c) +#endif + + +#endif /* __WINE_WINE_OBJ_ISHELLEXTINIT_H */ diff --git a/include/wine/obj_shellfolder.h b/include/wine/obj_shellfolder.h index c9a2533e7d1..02dafacca85 100644 --- a/include/wine/obj_shellfolder.h +++ b/include/wine/obj_shellfolder.h @@ -87,6 +87,45 @@ typedef enum tagSHCONTF #define SFGAO_VALIDATE 0x01000000L /* invalidate cached information */ #define SFGAO_REMOVABLE 0x02000000L /* is this removeable media? */ +/************************************************************************ + * + * FOLDERSETTINGS +*/ + +typedef LPBYTE LPVIEWSETTINGS; + +/* NB Bitfields. */ +/* FWF_DESKTOP implies FWF_TRANSPARENT/NOCLIENTEDGE/NOSCROLL */ +typedef enum +{ FWF_AUTOARRANGE = 0x0001, + FWF_ABBREVIATEDNAMES = 0x0002, + FWF_SNAPTOGRID = 0x0004, + FWF_OWNERDATA = 0x0008, + FWF_BESTFITWINDOW = 0x0010, + FWF_DESKTOP = 0x0020, + FWF_SINGLESEL = 0x0040, + FWF_NOSUBFOLDERS = 0x0080, + FWF_TRANSPARENT = 0x0100, + FWF_NOCLIENTEDGE = 0x0200, + FWF_NOSCROLL = 0x0400, + FWF_ALIGNLEFT = 0x0800, + FWF_SINGLECLICKACTIVATE=0x8000 /* TEMPORARY -- NO UI FOR THIS */ +} FOLDERFLAGS; + +typedef enum +{ FVM_ICON = 1, + FVM_SMALLICON = 2, + FVM_LIST = 3, + FVM_DETAILS = 4 +} FOLDERVIEWMODE; + +typedef struct +{ UINT ViewMode; /* View mode (FOLDERVIEWMODE values) */ + UINT fFlags; /* View options (FOLDERFLAGS bits) */ +} FOLDERSETTINGS, *LPFOLDERSETTINGS; + +typedef const FOLDERSETTINGS * LPCFOLDERSETTINGS; + /************************************************************************ * Desktopfolder */ @@ -133,7 +172,7 @@ ICOM_DEFINE(IShellFolder,IUnknown) #define IShellFolder_GetUIObjectOf(p,a,b,c,d,e,f) ICOM_CALL6(GetUIObjectOf,p,a,b,c,d,e,f) #define IShellFolder_GetDisplayNameOf(p,a,b,c) ICOM_CALL3(GetDisplayNameOf,p,a,b,c) #define IShellFolder_SetNameOf(p,a,b,c,d,e) ICOM_CALL5(SetNameOf,p,a,b,c,d,e) -#define IShellFolder_GetFolderPath(p,a,b) ICOM_CALL2(GetDisplayNameOf,p,a,b) +#define IShellFolder_GetFolderPath(p,a,b) ICOM_CALL2(GetFolderPath,p,a,b) #endif /***************************************************************************** diff --git a/include/wine/obj_shellview.h b/include/wine/obj_shellview.h new file mode 100644 index 00000000000..938eabfdba3 --- /dev/null +++ b/include/wine/obj_shellview.h @@ -0,0 +1,143 @@ +/************************************************************ + * IShellView + */ + +#ifndef __WINE_WINE_OBJ_ISHELLVIEW_H +#define __WINE_WINE_OBJ_ISHELLVIEW_H + +#include "winbase.h" +#include "winuser.h" +#include "wine/obj_base.h" +#include "wine/obj_inplace.h" +#include "wine/obj_shellfolder.h" +#include "prsht.h" /* LPFNADDPROPSHEETPAGE */ + +/**************************************************************************** + * IShellBrowser is here defined because of a cyclic dependance between + * IShellBrowser and IShellView + */ +typedef struct IShellBrowser IShellBrowser, *LPSHELLBROWSER; + +DEFINE_SHLGUID(IID_IShellView, 0x000214E3L, 0, 0); +typedef struct IShellView IShellView, *LPSHELLVIEW; + +/* shellview select item flags*/ +#define SVSI_DESELECT 0x0000 +#define SVSI_SELECT 0x0001 +#define SVSI_EDIT 0x0003 /* includes select */ +#define SVSI_DESELECTOTHERS 0x0004 +#define SVSI_ENSUREVISIBLE 0x0008 +#define SVSI_FOCUSED 0x0010 + +/* shellview get item object flags */ +#define SVGIO_BACKGROUND 0x00000000 +#define SVGIO_SELECTION 0x00000001 +#define SVGIO_ALLVIEW 0x00000002 + +/* The explorer dispatches WM_COMMAND messages based on the range of + command/menuitem IDs. All the IDs of menuitems that the view (right + pane) inserts must be in FCIDM_SHVIEWFIRST/LAST (otherwise, the explorer + won't dispatch them). The view should not deal with any menuitems + in FCIDM_BROWSERFIRST/LAST (otherwise, it won't work with the future + version of the shell). + + FCIDM_SHVIEWFIRST/LAST for the right pane (IShellView) + FCIDM_BROWSERFIRST/LAST for the explorer frame (IShellBrowser) + FCIDM_GLOBAL/LAST for the explorer's submenu IDs +*/ +#define FCIDM_SHVIEWFIRST 0x0000 +/* undocumented */ +#define FCIDM_SHVIEW_ARRANGE 0x7001 +#define FCIDM_SHVIEW_DELETE 0x7011 +#define FCIDM_SHVIEW_PROPERTIES 0x7013 +#define FCIDM_SHVIEW_CUT 0x7018 +#define FCIDM_SHVIEW_COPY 0x7019 +#define FCIDM_SHVIEW_INSERT 0x701A +#define FCIDM_SHVIEW_UNDO 0x701B +#define FCIDM_SHVIEW_INSERTLINK 0x701C +#define FCIDM_SHVIEW_SELECTALL 0x7021 +#define FCIDM_SHVIEW_INVERTSELECTION 0x7022 +#define FCIDM_SHVIEW_BIGICON 0x7029 +#define FCIDM_SHVIEW_SMALLICON 0x702A +#define FCIDM_SHVIEW_LISTVIEW 0x702B +#define FCIDM_SHVIEW_REPORTVIEW 0x702C +#define FCIDM_SHVIEW_AUTOARRANGE 0x7031 +#define FCIDM_SHVIEW_SNAPTOGRID 0x7032 +#define FCIDM_SHVIEW_HELP 0x7041 + +#define FCIDM_SHVIEWLAST 0x7fff +#define FCIDM_BROWSERFIRST 0xA000 +/* undocumented toolbar items from stddlg's*/ +#define FCIDM_TB_SMALLICON 0xA003 +#define FCIDM_TB_REPORTVIEW 0xA004 + +#define FCIDM_BROWSERLAST 0xbf00 +#define FCIDM_GLOBALFIRST 0x8000 +#define FCIDM_GLOBALLAST 0x9fff + +/* +* Global submenu IDs and separator IDs +*/ +#define FCIDM_MENU_FILE (FCIDM_GLOBALFIRST+0x0000) +#define FCIDM_MENU_EDIT (FCIDM_GLOBALFIRST+0x0040) +#define FCIDM_MENU_VIEW (FCIDM_GLOBALFIRST+0x0080) +#define FCIDM_MENU_VIEW_SEP_OPTIONS (FCIDM_GLOBALFIRST+0x0081) +#define FCIDM_MENU_TOOLS (FCIDM_GLOBALFIRST+0x00c0) +#define FCIDM_MENU_TOOLS_SEP_GOTO (FCIDM_GLOBALFIRST+0x00c1) +#define FCIDM_MENU_HELP (FCIDM_GLOBALFIRST+0x0100) +#define FCIDM_MENU_FIND (FCIDM_GLOBALFIRST+0x0140) +#define FCIDM_MENU_EXPLORE (FCIDM_GLOBALFIRST+0x0150) +#define FCIDM_MENU_FAVORITES (FCIDM_GLOBALFIRST+0x0170) + +/* control IDs known to the view */ +#define FCIDM_TOOLBAR (FCIDM_BROWSERFIRST + 0) +#define FCIDM_STATUS (FCIDM_BROWSERFIRST + 1) + +/* uState values for IShellView::UIActivate */ +typedef enum +{ SVUIA_DEACTIVATE = 0, + SVUIA_ACTIVATE_NOFOCUS = 1, + SVUIA_ACTIVATE_FOCUS = 2, + SVUIA_INPLACEACTIVATE = 3 /* new flag for IShellView2 */ +} SVUIA_STATUS; + +#define ICOM_INTERFACE IShellView +#define IShellView_METHODS \ + ICOM_METHOD1(HRESULT, TranslateAccelerator, LPMSG, lpmsg) \ + ICOM_METHOD1(HRESULT, EnableModeless, BOOL, fEnable) \ + ICOM_METHOD1(HRESULT, UIActivate, UINT, uState) \ + ICOM_METHOD(HRESULT, Refresh) \ + ICOM_METHOD5(HRESULT, CreateViewWindow, IShellView*, lpPrevView, LPCFOLDERSETTINGS, lpfs, IShellBrowser*, psb, RECT*, prcView, HWND*, phWnd) \ + ICOM_METHOD(HRESULT, DestroyViewWindow) \ + ICOM_METHOD1(HRESULT, GetCurrentInfo, LPFOLDERSETTINGS, lpfs) \ + ICOM_METHOD3(HRESULT, AddPropertySheetPages, DWORD, dwReserved, LPFNADDPROPSHEETPAGE, lpfn, LPARAM, lparam) \ + ICOM_METHOD (HRESULT, SaveViewState) \ + ICOM_METHOD2(HRESULT, SelectItem, LPCITEMIDLIST, pidlItem, UINT, uFlags) \ + ICOM_METHOD3(HRESULT, GetItemObject, UINT, uItem, REFIID, riid, LPVOID*, ppv) +#define IShellView_IMETHODS \ + IOleWindow_IMETHODS \ + IShellView_METHODS +ICOM_DEFINE(IShellView,IOleWindow) +#undef ICOM_INTERFACE + +#ifdef ICOM_CINTERFACE +#define IShellView_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) +#define IShellView_AddRef(p) ICOM_CALL(AddRef,p) +#define IShellView_Release(p) ICOM_CALL(Release,p) +#define IShellView_GetWindow(p,a) ICOM_CALL1(GetWindow,p,a) +#define IShellView_ContextSensitiveHelp(p,a) ICOM_CALL1(ContextSensitiveHelp,p,a) +#define IShellView_TranslateAccelerator(p,a) ICOM_CALL1(TranslateAccelerator,p,a) +#define IShellView_EnableModeless(p,a) ICOM_CALL1(EnableModeless,p,a) +#define IShellView_UIActivate(p,a) ICOM_CALL1(UIActivate,p,a) +#define IShellView_Refresh(p) ICOM_CALL(Refresh,p) +#define IShellView_CreateViewWindow(p,a,b,c,d,e) ICOM_CALL5(CreateViewWindow,p,a,b,c,d,e) +#define IShellView_DestroyViewWindow(p) ICOM_CALL(DestroyViewWindow,p) +#define IShellView_GetCurrentInfo(p,a) ICOM_CALL1(GetCurrentInfo,p,a) +#define IShellView_AddPropertySheetPages(p,a,b,c) ICOM_CALL3(AddPropertySheetPages,p,a,b,c) +#define IShellView_SaveViewState(p) ICOM_CALL(SaveViewState,p) +#define IShellView_SelectItem(p,a,b) ICOM_CALL2(SelectItem,p,a,b) +#define IShellView_GetItemObject(p,a,b,c) ICOM_CALL3(GetItemObject,p,a,b,c) +#endif + + +#endif /* __WINE_WINE_OBJ_ISHELLVIEW_H */