Bugfixes, shellview uses DPA's now, IShellView_GetItemObject implemented.
This commit is contained in:
parent
bbb946f0ed
commit
6acd059970
|
@ -304,7 +304,7 @@ static HRESULT WINAPI IClassFactory_CreateInstance(
|
|||
{ pObj = (IUnknown *)IShellFolder_Constructor(NULL,NULL);
|
||||
}
|
||||
else if (IsEqualIID(riid, &IID_IShellView))
|
||||
{ pObj = (IUnknown *)IShellView_Constructor();
|
||||
{ pObj = (IUnknown *)IShellView_Constructor(NULL,NULL);
|
||||
}
|
||||
else if (IsEqualIID(riid, &IID_IShellLink))
|
||||
{ pObj = (IUnknown *)IShellLink_Constructor();
|
||||
|
|
|
@ -119,13 +119,13 @@ LPSTR WINAPI PathFindExtension(LPSTR path) {
|
|||
LPSTR WINAPI PathAddBackslash(LPSTR path)
|
||||
{ int len;
|
||||
TRACE(shell,"%p->%s\n",path,path);
|
||||
|
||||
len = strlen(path);
|
||||
if (len && path[len-1]!='\\')
|
||||
{ path[len+0]='\\';
|
||||
path[len+1]='\0';
|
||||
{ path[len] = '\\';
|
||||
path[len+1]= 0x00;
|
||||
return path+len+1;
|
||||
}
|
||||
else
|
||||
return path+len;
|
||||
}
|
||||
|
||||
|
@ -232,17 +232,25 @@ LPSTR WINAPI PathAppend(LPSTR x1,LPSTR x2) {
|
|||
*
|
||||
* NOTES
|
||||
* if lpszFile='.' skip it
|
||||
* szDest can be equal to lpszFile. Thats why we use sTemp
|
||||
*/
|
||||
LPSTR WINAPI PathCombine(LPSTR szDest, LPCSTR lpszDir, LPCSTR lpszFile)
|
||||
{ TRACE(shell,"%s %s\n",lpszDir,lpszFile);
|
||||
{ char sTemp[MAX_PATH];
|
||||
TRACE(shell,"%p %p->%s %p->%s\n",szDest, lpszDir, lpszDir, lpszFile, lpszFile);
|
||||
|
||||
if (!lpszFile || !lpszFile[0] || (lpszFile[0]=='.' && !lpszFile[1]) )
|
||||
{ strcpy(szDest,lpszDir);
|
||||
return szDest;
|
||||
}
|
||||
strcpy(szDest,lpszDir);
|
||||
PathAddBackslash(szDest);
|
||||
strcat(szDest,lpszFile);
|
||||
|
||||
/* if lpszFile is a complete path don't care about lpszDir */
|
||||
if (PathIsRoot(lpszFile))
|
||||
{ strcpy(szDest,lpszFile);
|
||||
}
|
||||
strcpy(sTemp,lpszDir);
|
||||
PathAddBackslash(sTemp);
|
||||
strcat(sTemp,lpszFile);
|
||||
strcpy(szDest,sTemp);
|
||||
return szDest;
|
||||
}
|
||||
|
||||
|
@ -777,15 +785,33 @@ DWORD WINAPI SHAddToRecentDocs32 (UINT32 uFlags,LPCVOID pv)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* SHFileOperation32 [SHELL32.242]
|
||||
*
|
||||
*/
|
||||
DWORD WINAPI SHFileOperation32(DWORD x)
|
||||
{ FIXME(shell,"0x%08lx stub\n",x);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHFileOperation [SHELL32.242]
|
||||
* SHFileOperation32A [SHELL32.243]
|
||||
*
|
||||
* NOTES
|
||||
* exported by name
|
||||
*/
|
||||
DWORD WINAPI SHFileOperation32 (
|
||||
LPSHFILEOPSTRUCT32A lpFileOp)
|
||||
DWORD WINAPI SHFileOperation32A (LPSHFILEOPSTRUCT32A lpFileOp)
|
||||
{ FIXME (shell,"(%p):stub.\n", lpFileOp);
|
||||
return 1;
|
||||
}
|
||||
/*************************************************************************
|
||||
* SHFileOperation32W [SHELL32.244]
|
||||
*
|
||||
* NOTES
|
||||
* exported by name
|
||||
*/
|
||||
DWORD WINAPI SHFileOperation32W (LPSHFILEOPSTRUCT32W lpFileOp)
|
||||
{ FIXME (shell,"(%p):stub.\n", lpFileOp);
|
||||
return 1;
|
||||
}
|
||||
|
@ -964,13 +990,37 @@ HRESULT WINAPI SHGetDataFromIDListA(DWORD u, DWORD v, DWORD w, DWORD x, DWORD y)
|
|||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* SHFileOperationA [SHELL32.243]
|
||||
* SHRegQueryValueEx32W [NT4.0:SHELL32.511]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI SHFileOperationA(DWORD x)
|
||||
{ FIXME(shell,"0x%08lx stub\n",x);
|
||||
HRESULT WINAPI SHRegQueryValueEx32W (DWORD u, LPWSTR v, DWORD w, DWORD x, DWORD y, DWORD z)
|
||||
{ FIXME(shell,"0x%04lx %s 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",u,debugstr_w(v),w,x,y,z);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* ReadCabinetState [NT 4.0:SHELL32.651]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI ReadCabinetState(DWORD u, DWORD v)
|
||||
{ FIXME(shell,"0x%04lx 0x%04lx stub\n",u,v);
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* WriteCabinetState [NT 4.0:SHELL32.652]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI WriteCabinetState(DWORD u)
|
||||
{ FIXME(shell,"0x%04lx stub\n",u);
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* IsUserAdmin [NT 4.0:SHELL32.680]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI IsUserAdmin()
|
||||
{ FIXME(shell,"stub\n");
|
||||
return TRUE;
|
||||
}
|
||||
/*************************************************************************
|
||||
* SHFlushClipboard [SHELL32.121]
|
||||
|
|
|
@ -378,14 +378,16 @@ static HRESULT WINAPI IShellFolder_BindToStorage(
|
|||
* LPARAM lParam, //[in ] Column?
|
||||
* LPCITEMIDLIST pidl1, //[in ] simple pidl
|
||||
* LPCITEMIDLIST pidl2) //[in ] simple pidl
|
||||
*
|
||||
* NOTES
|
||||
* Special case - If one of the items is a Path and the other is a File,
|
||||
* always make the Path come before the File.
|
||||
*
|
||||
* FIXME
|
||||
* we have to handle simple pidl's only
|
||||
* we have to handle simple pidl's only (?)
|
||||
*/
|
||||
static HRESULT WINAPI IShellFolder_CompareIDs(
|
||||
LPSHELLFOLDER this,
|
||||
LPARAM lParam,
|
||||
LPCITEMIDLIST pidl1, /*simple pidl*/
|
||||
LPCITEMIDLIST pidl2) /*simple pidl*/
|
||||
static HRESULT WINAPI IShellFolder_CompareIDs(LPSHELLFOLDER this,
|
||||
LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
|
||||
{ CHAR szString1[MAX_PATH] = "";
|
||||
CHAR szString2[MAX_PATH] = "";
|
||||
int nReturn;
|
||||
|
@ -393,8 +395,12 @@ static HRESULT WINAPI IShellFolder_CompareIDs(
|
|||
|
||||
TRACE(shell,"(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n",this,lParam,pidl1,pidl2);
|
||||
|
||||
/*Special case - If one of the items is a Path and the other is a File, always
|
||||
make the Path come before the File.*/
|
||||
if (!pidl1 && !pidl2)
|
||||
return 0;
|
||||
if (!pidl1) /* Desktop < anything */
|
||||
return -1;
|
||||
if (!pidl2)
|
||||
return 1;
|
||||
|
||||
/* get the last item in each list */
|
||||
while((ILGetNext(pidlTemp1))->mkid.cb)
|
||||
|
@ -412,12 +418,14 @@ static HRESULT WINAPI IShellFolder_CompareIDs(
|
|||
_ILGetDrive( pidl1,szString1,sizeof(szString1));
|
||||
_ILGetDrive( pidl2,szString1,sizeof(szString2));
|
||||
nReturn = strcasecmp(szString1, szString2);
|
||||
|
||||
if(nReturn)
|
||||
return nReturn;
|
||||
|
||||
_ILGetFolderText( pidl1,szString1,sizeof(szString1));
|
||||
_ILGetFolderText( pidl2,szString2,sizeof(szString2));
|
||||
nReturn = strcasecmp(szString1, szString2);
|
||||
|
||||
if(nReturn)
|
||||
return nReturn;
|
||||
|
||||
|
@ -439,11 +447,8 @@ static HRESULT WINAPI IShellFolder_CompareIDs(
|
|||
* NOTES
|
||||
* the same as SHCreateShellFolderViewEx ???
|
||||
*/
|
||||
static HRESULT WINAPI IShellFolder_CreateViewObject(
|
||||
LPSHELLFOLDER this,
|
||||
HWND32 hwndOwner,
|
||||
REFIID riid,
|
||||
LPVOID *ppvOut)
|
||||
static HRESULT WINAPI IShellFolder_CreateViewObject( LPSHELLFOLDER this,
|
||||
HWND32 hwndOwner, REFIID riid, LPVOID *ppvOut)
|
||||
{ LPSHELLVIEW pShellView;
|
||||
char xriid[50];
|
||||
HRESULT hr;
|
||||
|
@ -494,7 +499,8 @@ static HRESULT WINAPI IShellFolder_GetAttributesOf(LPSHELLFOLDER this,UINT32 cid
|
|||
|
||||
do
|
||||
{ if (*pidltemp)
|
||||
{ if (_ILIsDesktop( *pidltemp))
|
||||
{ pdump (*pidltemp);
|
||||
if (_ILIsDesktop( *pidltemp))
|
||||
{ *rgfInOut |= ( SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANLINK );
|
||||
}
|
||||
else if (_ILIsMyComputer( *pidltemp))
|
||||
|
@ -542,9 +548,8 @@ static HRESULT WINAPI IShellFolder_GetAttributesOf(LPSHELLFOLDER this,UINT32 cid
|
|||
static HRESULT WINAPI IShellFolder_GetUIObjectOf( LPSHELLFOLDER this,HWND32 hwndOwner,UINT32 cidl,
|
||||
LPCITEMIDLIST * apidl, REFIID riid, UINT32 * prgfInOut,LPVOID * ppvOut)
|
||||
{ char xclsid[50];
|
||||
LPEXTRACTICON pei;
|
||||
LPCONTEXTMENU pcm;
|
||||
LPITEMIDLIST pidl;
|
||||
LPUNKNOWN pObj = NULL;
|
||||
|
||||
WINE_StringFromCLSID(riid,xclsid);
|
||||
|
||||
|
@ -554,51 +559,32 @@ static HRESULT WINAPI IShellFolder_GetUIObjectOf( LPSHELLFOLDER this,HWND32 hwnd
|
|||
*ppvOut = NULL;
|
||||
|
||||
if(IsEqualIID(riid, &IID_IContextMenu))
|
||||
{ pcm = IContextMenu_Constructor(this, apidl, cidl);
|
||||
if(pcm)
|
||||
{ *ppvOut = pcm;
|
||||
return S_OK;
|
||||
{ if(cidl < 1)
|
||||
return E_INVALIDARG;
|
||||
pObj = (LPUNKNOWN)IContextMenu_Constructor(this, apidl, cidl);
|
||||
}
|
||||
else if (IsEqualIID(riid, &IID_IDataObject))
|
||||
{ if (cidl < 1)
|
||||
return(E_INVALIDARG);
|
||||
pObj = (LPUNKNOWN)IDataObject_Constructor (hwndOwner, this, apidl, cidl);
|
||||
}
|
||||
|
||||
if(cidl != 1)
|
||||
return E_FAIL;
|
||||
|
||||
if(IsEqualIID(riid, &IID_IExtractIcon))
|
||||
{ pidl = ILCombine(this->mpidl, apidl[0]);
|
||||
pei = IExtractIcon_Constructor(pidl);
|
||||
|
||||
/* The temp PIDL can be deleted because the new CExtractIcon either failed or
|
||||
made its own copy of it. */
|
||||
else if(IsEqualIID(riid, &IID_IExtractIcon))
|
||||
{ if (cidl != 1)
|
||||
return(E_INVALIDARG);
|
||||
pidl = ILCombine(this->mpidl, apidl[0]);
|
||||
pObj = (LPUNKNOWN)IExtractIcon_Constructor(pidl);
|
||||
SHFree(pidl);
|
||||
|
||||
if(pei)
|
||||
{ *ppvOut = pei;
|
||||
return S_OK;
|
||||
}
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
/* if(IsEqualIID(riid, IID_IQueryInfo))
|
||||
{ CQueryInfo *pqit;
|
||||
LPITEMIDLIST pidl;
|
||||
pidl = m_pPidlMgr->Concatenate(m_pidl, pPidl[0]);
|
||||
pqit = new CQueryInfo(pidl);
|
||||
*/
|
||||
/* The temp PIDL can be deleted because the new CQueryInfo either failed or
|
||||
made its own copy of it. */
|
||||
/* m_pPidlMgr->Delete(pidl);
|
||||
|
||||
if(pqit)
|
||||
{ *ppvReturn = pqit;
|
||||
return S_OK;
|
||||
}
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
*/
|
||||
ERR(shell,"(%p)->E_NOINTERFACE\n",this);
|
||||
else
|
||||
{ ERR(shell,"(%p)->E_NOINTERFACE\n",this);
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
if(!pObj)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
*ppvOut = pObj;
|
||||
return S_OK;
|
||||
}
|
||||
/**************************************************************************
|
||||
* IShellFolder_GetDisplayNameOf
|
||||
* Retrieves the display name for the specified file object or subfolder
|
||||
|
|
|
@ -70,9 +70,12 @@ static struct IShellView_VTable svvt =
|
|||
#define IDM_VIEW_FILES (FCIDM_SHVIEWFIRST + 0x500)
|
||||
#define IDM_VIEW_IDW (FCIDM_SHVIEWFIRST + 0x501)
|
||||
#define IDM_MYFILEITEM (FCIDM_SHVIEWFIRST + 0x502)
|
||||
|
||||
#define ID_LISTVIEW 2000
|
||||
|
||||
#define MENU_OFFSET 1
|
||||
#define MENU_MAX 100
|
||||
|
||||
#define TOOLBAR_ID (L"SHELLDLL_DefView")
|
||||
//windowsx.h
|
||||
#define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
|
||||
|
@ -111,8 +114,10 @@ LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER pFolder, LPCITEMIDLIST pidl)
|
|||
|
||||
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);
|
||||
|
||||
|
@ -237,16 +242,18 @@ BOOL32 ShellView_InitList(LPSHELLVIEW this)
|
|||
* ShellView_CompareItems()
|
||||
*
|
||||
* NOTES
|
||||
* internal
|
||||
* internal, CALLBACK for DSA_Sort
|
||||
*/
|
||||
int CALLBACK ShellView_CompareItems(LPARAM lParam1, LPARAM lParam2, LPARAM lpData)
|
||||
{ LPSHELLFOLDER pFolder = (LPSHELLFOLDER)lpData;
|
||||
int CALLBACK ShellView_CompareItems(LPVOID lParam1, LPVOID lParam2, LPARAM lpData)
|
||||
{ int ret;
|
||||
TRACE(shell,"pidl1=%p pidl2=%p lpsf=%p\n", lParam1, lParam2, (LPVOID) lpData);
|
||||
|
||||
TRACE(shell,"\n");
|
||||
if(!pFolder)
|
||||
if(!lpData)
|
||||
return 0;
|
||||
|
||||
return (int)pFolder->lpvtbl->fnCompareIDs(pFolder, 0, (LPITEMIDLIST)lParam1, (LPITEMIDLIST)lParam2);
|
||||
ret = (int)((LPSHELLFOLDER)lpData)->lpvtbl->fnCompareIDs((LPSHELLFOLDER)lpData, 0, (LPITEMIDLIST)lParam1, (LPITEMIDLIST)lParam2);
|
||||
TRACE(shell,"ret=%i\n",ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -256,45 +263,68 @@ int CALLBACK ShellView_CompareItems(LPARAM lParam1, LPARAM lParam2, LPARAM lpDat
|
|||
* internal
|
||||
*/
|
||||
|
||||
void ShellView_FillList(LPSHELLVIEW this)
|
||||
static HRESULT ShellView_FillList(LPSHELLVIEW this)
|
||||
{ LPENUMIDLIST pEnumIDList;
|
||||
LPITEMIDLIST pidl;
|
||||
DWORD dwFetched;
|
||||
UINT32 i;
|
||||
LVITEM32A lvItem;
|
||||
HRESULT hRes;
|
||||
HDPA hdpa;
|
||||
|
||||
TRACE(shell,"%p\n",this);
|
||||
|
||||
if(SUCCEEDED(this->pSFParent->lpvtbl->fnEnumObjects(this->pSFParent,this->hWnd, SHCONTF_NONFOLDERS | SHCONTF_FOLDERS, &pEnumIDList)))
|
||||
{ SendMessage32A(this->hWndList, WM_SETREDRAW, FALSE, 0); /*turn the listview's redrawing off*/
|
||||
/* 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)
|
||||
return(NOERROR);
|
||||
return(hRes);
|
||||
}
|
||||
|
||||
/* create a pointer array */
|
||||
hdpa = DPA_Create(16);
|
||||
if (!hdpa)
|
||||
{ return(E_OUTOFMEMORY);
|
||||
}
|
||||
|
||||
/* copy the items into the array*/
|
||||
while((S_OK == pEnumIDList->lpvtbl->fnNext(pEnumIDList,1, &pidl, &dwFetched)) && dwFetched)
|
||||
{ ZeroMemory(&lvItem, sizeof(lvItem));
|
||||
{ if (DPA_InsertPtr(hdpa, 0x7fff, pidl) == -1)
|
||||
{ SHFree(pidl);
|
||||
}
|
||||
}
|
||||
|
||||
/*sort the array*/
|
||||
DPA_Sort(hdpa, ShellView_CompareItems, (LPARAM)this->pSFParent);
|
||||
|
||||
/*turn the listview's redrawing off*/
|
||||
SendMessage32A(this->hWndList, WM_SETREDRAW, FALSE, 0);
|
||||
|
||||
for (i=0; i < DPA_GetPtrCount(hdpa); ++i)
|
||||
{ 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.lParam = (LPARAM)ILClone(pidl); /*set the item's data*/
|
||||
lvItem.pszText = LPSTR_TEXTCALLBACK32A; /*get text on a callback basis*/
|
||||
lvItem.iImage = I_IMAGECALLBACK; /*get the image on a callback basis*/
|
||||
if ( S_OK == IncludeObject(this, ILClone(pidl) )) /* fixme free the pidl*/
|
||||
{ ListView_InsertItem32A(this->hWndList, &lvItem); /*add the item*/
|
||||
ListView_InsertItem32A(this->hWndList, &lvItem);
|
||||
}
|
||||
else
|
||||
{ SHFree(pidl); /* not viewed */
|
||||
SHFree(pidl); /* the listview has a COPY*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*sort the items*/
|
||||
/* ListView_SortItems(this->hWndList, ShellView_CompareItems, (LPARAM)this->pSFParent);*/
|
||||
|
||||
|
||||
/*turn the listview's redrawing back on and force it to draw*/
|
||||
SendMessage32A(this->hWndList, WM_SETREDRAW, TRUE, 0);
|
||||
InvalidateRect32(this->hWndList, NULL, TRUE);
|
||||
UpdateWindow32(this->hWndList);
|
||||
|
||||
pEnumIDList->lpvtbl->fnRelease(pEnumIDList);
|
||||
}
|
||||
pEnumIDList->lpvtbl->fnRelease(pEnumIDList); /* destroy the list*/
|
||||
DPA_Destroy(hdpa);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -576,7 +606,7 @@ BOOL32 ShellView_AddRemoveDockingWindow(LPSHELLVIEW this, BOOL32 bAdd)
|
|||
hr = this->pShellBrowser->lpvtbl->fnQueryInterface(this->pShellBrowser, (REFIID)&IID_IServiceProvider, (LPVOID*)&pSP);
|
||||
if(SUCCEEDED(hr))
|
||||
{ /*get the IDockingWindowFrame pointer*/
|
||||
hr = pSP->lpvtbl->fnQueryService(pSP, &SID_SShellBrowser, &IID_IDockingWindowFrame, (LPVOID*)&pFrame);
|
||||
hr = pSP->lpvtbl->fnQueryService(pSP, (REFGUID)&SID_SShellBrowser, (REFIID)&IID_IDockingWindowFrame, (LPVOID*)&pFrame);
|
||||
if(SUCCEEDED(hr))
|
||||
{ if(bAdd)
|
||||
{ hr = S_OK;
|
||||
|
@ -629,7 +659,7 @@ BOOL32 ShellView_CanDoIDockingWindow(LPSHELLVIEW this)
|
|||
/*get the browser's IServiceProvider*/
|
||||
hr = this->pShellBrowser->lpvtbl->fnQueryInterface(this->pShellBrowser, (REFIID)&IID_IServiceProvider, (LPVOID*)&pSP);
|
||||
if(hr==S_OK)
|
||||
{ hr = pSP->lpvtbl->fnQueryService(pSP, &SID_SShellBrowser, &IID_IDockingWindowFrame, (LPVOID*)&pFrame);
|
||||
{ hr = pSP->lpvtbl->fnQueryService(pSP, (REFGUID)&SID_SShellBrowser, (REFIID)&IID_IDockingWindowFrame, (LPVOID*)&pFrame);
|
||||
if(SUCCEEDED(hr))
|
||||
{ bReturn = TRUE;
|
||||
pFrame->lpvtbl->fnRelease(pFrame);
|
||||
|
@ -696,23 +726,23 @@ LRESULT ShellView_OnSettingChange(LPSHELLVIEW this, LPCSTR lpszSection)
|
|||
* ShellView_DoContextMenu()
|
||||
*/
|
||||
void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL32 fDefault)
|
||||
{ UINT32 uCommand, i, uSelected = ListView_GetSelectedCount(this->hWndList);
|
||||
{ UINT32 uCommand, i;
|
||||
DWORD wFlags;
|
||||
HMENU32 hMenu;
|
||||
BOOL32 fExplore = FALSE;
|
||||
HWND32 hwndTree = 0;
|
||||
INT32 nMenuIndex;
|
||||
LPITEMIDLIST *aSelectedItems;
|
||||
LVITEM32A lvItem;
|
||||
MENUITEMINFO32A mii;
|
||||
LPCONTEXTMENU pContextMenu = NULL;
|
||||
CMINVOKECOMMANDINFO32 cmi;
|
||||
|
||||
TRACE(shell,"(%p)->(0x%08x 0x%08x 0x%08x) stub\n",this, x, y, fDefault);
|
||||
aSelectedItems = (LPITEMIDLIST*)SHAlloc(uSelected * sizeof(LPITEMIDLIST));
|
||||
this->uSelected = ListView_GetSelectedCount(this->hWndList);
|
||||
this->aSelectedItems = (LPITEMIDLIST*)SHAlloc(this->uSelected * sizeof(LPITEMIDLIST));
|
||||
|
||||
if(aSelectedItems)
|
||||
{ TRACE(shell,"-- Items selected =%u\n", 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;
|
||||
|
@ -720,9 +750,9 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL32 fDefault)
|
|||
|
||||
i = 0;
|
||||
|
||||
while(ListView_GetItem32A(this->hWndList, &lvItem) && (i < uSelected))
|
||||
while(ListView_GetItem32A(this->hWndList, &lvItem) && (i < this->uSelected))
|
||||
{ if(lvItem.state & LVIS_SELECTED)
|
||||
{ aSelectedItems[i] = (LPITEMIDLIST)lvItem.lParam;
|
||||
{ this->aSelectedItems[i] = (LPITEMIDLIST)lvItem.lParam;
|
||||
i++;
|
||||
TRACE(shell,"-- selected Item found\n");
|
||||
}
|
||||
|
@ -731,9 +761,9 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL32 fDefault)
|
|||
|
||||
this->pSFParent->lpvtbl->fnGetUIObjectOf( this->pSFParent,
|
||||
this->hWndParent,
|
||||
uSelected,
|
||||
(LPCITEMIDLIST*)aSelectedItems,
|
||||
&IID_IContextMenu,
|
||||
this->uSelected,
|
||||
this->aSelectedItems,
|
||||
(REFIID)&IID_IContextMenu,
|
||||
NULL,
|
||||
(LPVOID *)&pContextMenu);
|
||||
|
||||
|
@ -756,7 +786,7 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL32 fDefault)
|
|||
0,
|
||||
MENU_OFFSET,
|
||||
MENU_MAX,
|
||||
CMF_NORMAL | (uSelected != 1 ? 0 : CMF_CANRENAME) | (fExplore ? CMF_EXPLORE : 0))))
|
||||
CMF_NORMAL | (this->uSelected != 1 ? 0 : CMF_CANRENAME) | (fExplore ? CMF_EXPLORE : 0))))
|
||||
{ if(fDefault)
|
||||
{ TRACE(shell,"-- fDefault\n");
|
||||
uCommand = 0;
|
||||
|
@ -789,10 +819,10 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL32 fDefault)
|
|||
OnDefaultCommand(this);
|
||||
}
|
||||
else /* we are acting with a full featured IShellBrowser */
|
||||
{ TRACE(shell,"-- fnBrowseObject pidl =%p\n", aSelectedItems[0]);
|
||||
{ TRACE(shell,"-- fnBrowseObject pidl =%p\n", this->aSelectedItems[0]);
|
||||
wFlags = SBSP_DEFBROWSER | SBSP_DEFMODE | SBSP_RELATIVE;
|
||||
this->pShellBrowser->lpvtbl->fnBrowseObject(this->pShellBrowser,
|
||||
aSelectedItems[0],
|
||||
this->aSelectedItems[0],
|
||||
wFlags);
|
||||
}
|
||||
}
|
||||
|
@ -808,7 +838,9 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL32 fDefault)
|
|||
}
|
||||
pContextMenu->lpvtbl->fnRelease(pContextMenu);
|
||||
}
|
||||
SHFree(aSelectedItems);
|
||||
SHFree(this->aSelectedItems);
|
||||
this->aSelectedItems=NULL;
|
||||
this->uSelected=0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1128,7 +1160,7 @@ LRESULT CALLBACK ShellView_WndProc(HWND32 hWnd, UINT32 uMessage, WPARAM32 wParam
|
|||
*
|
||||
*
|
||||
***************************************************************************
|
||||
* IShellView::QueryInterface
|
||||
* IShellView_QueryInterface
|
||||
*/
|
||||
static HRESULT WINAPI IShellView_QueryInterface(LPSHELLVIEW this,REFIID riid, LPVOID *ppvObj)
|
||||
{ char xriid[50];
|
||||
|
@ -1160,7 +1192,7 @@ static ULONG WINAPI IShellView_AddRef(LPSHELLVIEW this)
|
|||
return ++(this->ref);
|
||||
}
|
||||
/**************************************************************************
|
||||
* IShellView::Release
|
||||
* IShellView_Release
|
||||
*/
|
||||
static ULONG WINAPI IShellView_Release(LPSHELLVIEW this)
|
||||
{ TRACE(shell,"(%p)->()\n",this);
|
||||
|
@ -1211,7 +1243,7 @@ static HRESULT WINAPI IShellView_UIActivate(LPSHELLVIEW this,UINT32 uState)
|
|||
LRESULT lResult;
|
||||
int nPartArray[1] = {-1};
|
||||
|
||||
FIXME(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)
|
||||
{ return S_OK;
|
||||
|
@ -1268,8 +1300,10 @@ static HRESULT WINAPI IShellView_Refresh(LPSHELLVIEW this)
|
|||
static HRESULT WINAPI IShellView_CreateViewWindow(LPSHELLVIEW this, IShellView *lpPrevView,
|
||||
LPCFOLDERSETTINGS lpfs, IShellBrowser * psb,RECT32 * prcView, HWND32 *phWnd)
|
||||
{ WNDCLASS32A wc;
|
||||
/* LRESULT dwResult;*/
|
||||
*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,"-- 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);
|
||||
|
||||
|
@ -1281,10 +1315,12 @@ static HRESULT WINAPI IShellView_CreateViewWindow(LPSHELLVIEW this, IShellView *
|
|||
this->pShellBrowser->lpvtbl->fnAddRef(this->pShellBrowser);
|
||||
this->pShellBrowser->lpvtbl->fnGetWindow(this->pShellBrowser, &(this->hWndParent));
|
||||
|
||||
/* this->pShellBrowser->lpvtbl->fnSendControlMsg(this->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON, 0xa004, TRUE, &dwResult);
|
||||
*/
|
||||
/* try to get the ICommDlgBrowserInterface */
|
||||
this->pCommDlgBrowser=NULL;
|
||||
if ( SUCCEEDED (this->pShellBrowser->lpvtbl->fnQueryInterface( this->pShellBrowser,
|
||||
&IID_ICommDlgBrowser,
|
||||
(REFIID)&IID_ICommDlgBrowser,
|
||||
(LPVOID*) &this->pCommDlgBrowser)))
|
||||
{ TRACE(shell,"-- CommDlgBrowser\n");
|
||||
}
|
||||
|
@ -1353,11 +1389,21 @@ static HRESULT WINAPI IShellView_SelectItem(LPSHELLVIEW this, LPCITEMIDLIST pidl
|
|||
return E_NOTIMPL;
|
||||
}
|
||||
static HRESULT WINAPI IShellView_GetItemObject(LPSHELLVIEW this, UINT32 uItem, REFIID riid, LPVOID *ppvOut)
|
||||
{ char xriid[50];
|
||||
WINE_StringFromCLSID((LPCLSID)riid,xriid);
|
||||
{ LPDATAOBJECT pDataObject;
|
||||
char xriid[50];
|
||||
HRESULT hr;
|
||||
|
||||
FIXME(shell,"(%p)->(uItem=0x%08x,\n\tIID=%s, ppv=%p)stub\n",this, uItem, xriid, ppvOut);
|
||||
WINE_StringFromCLSID((LPCLSID)riid,xriid);
|
||||
TRACE(shell,"(%p)->(uItem=0x%08x,\n\tIID=%s, ppv=%p)\n",this, uItem, xriid, ppvOut);
|
||||
|
||||
*ppvOut = NULL;
|
||||
return E_NOTIMPL;
|
||||
pDataObject = IDataObject_Constructor(this->hWndParent, this->pSFParent,this->aSelectedItems,this->uSelected);
|
||||
if(!pDataObject)
|
||||
return E_OUTOFMEMORY;
|
||||
hr = pDataObject->lpvtbl->fnQueryInterface(pDataObject, riid, ppvOut);
|
||||
pDataObject->lpvtbl->fnRelease(pDataObject);
|
||||
|
||||
TRACE(shell,"-- (%p)->(interface=%p)\n",this, ppvOut);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
|
|
@ -167,7 +167,11 @@ typedef struct _SHFILEOPSTRUCTW
|
|||
#define SHFILEOPSTRUCT WINELIB_NAME_AW(SHFILEOPSTRUCT)
|
||||
#define LPSHFILEOPSTRUCT WINELIB_NAME_AW(LPSHFILEOPSTRUCT)
|
||||
|
||||
DWORD WINAPI SHFileOperation32(LPSHFILEOPSTRUCT32A lpFileOp);
|
||||
DWORD WINAPI SHFileOperation32A (LPSHFILEOPSTRUCT32A lpFileOp);
|
||||
DWORD WINAPI SHFileOperation32W (LPSHFILEOPSTRUCT32W lpFileOp);
|
||||
#define SHFileOperation WINELIB_NAME_AW(SHFileOperation)
|
||||
|
||||
DWORD WINAPI SHFileOperation32(DWORD x);
|
||||
|
||||
/****************************************************************************
|
||||
* APPBARDATA
|
||||
|
|
Loading…
Reference in New Issue