mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
fixed ShellFolderContextMenu() parameter
svn path=/trunk/; revision=7141
This commit is contained in:
parent
69090b81d4
commit
5ff90962eb
2 changed files with 11 additions and 3 deletions
|
@ -327,13 +327,21 @@ bool DesktopShellView::DoContextMenu(int x, int y)
|
||||||
}
|
}
|
||||||
|
|
||||||
LPIDA pida = pidList;
|
LPIDA pida = pidList;
|
||||||
|
if (!pida->cidl) {
|
||||||
|
selection->Release();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
LPCITEMIDLIST parent_pidl = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
|
LPCITEMIDLIST parent_pidl = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
|
||||||
LPCITEMIDLIST first_pidl = (LPCITEMIDLIST)((LPBYTE)pida+pida->aoffset[1]);
|
|
||||||
|
LPCITEMIDLIST* apidl = (LPCITEMIDLIST*) alloca(pida->cidl*sizeof(LPCITEMIDLIST));
|
||||||
|
|
||||||
|
for(int i=pida->cidl; i>0; --i)
|
||||||
|
apidl[i-1] = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[i]);
|
||||||
|
|
||||||
ShellFolder folder(parent_pidl);
|
ShellFolder folder(parent_pidl);
|
||||||
|
|
||||||
hr = ShellFolderContextMenu(folder, _hwnd, pida->cidl, &first_pidl, x, y);
|
hr = ShellFolderContextMenu(folder, _hwnd, pida->cidl, apidl, x, y);
|
||||||
|
|
||||||
selection->Release();
|
selection->Release();
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,7 @@ int MainFrame::OpenShellFolders(LPIDA pida, HWND hFrameWnd)
|
||||||
ShellFolder folder(parent_pidl);
|
ShellFolder folder(parent_pidl);
|
||||||
|
|
||||||
for(int i=pida->cidl; i>0; --i) {
|
for(int i=pida->cidl; i>0; --i) {
|
||||||
LPCITEMIDLIST pidl = (LPCITEMIDLIST)((LPBYTE)pida+pida->aoffset[i]);
|
LPCITEMIDLIST pidl = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[i]);
|
||||||
|
|
||||||
SFGAOF attribs = SFGAO_FOLDER;
|
SFGAOF attribs = SFGAO_FOLDER;
|
||||||
HRESULT hr = folder->GetAttributesOf(1, &pidl, &attribs);
|
HRESULT hr = folder->GetAttributesOf(1, &pidl, &attribs);
|
||||||
|
|
Loading…
Reference in a new issue