mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
fix context menu support
svn path=/trunk/; revision=8147
This commit is contained in:
parent
27aa9a168f
commit
cec35a5347
1 changed files with 11 additions and 5 deletions
|
@ -455,13 +455,19 @@ LRESULT FileChildWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
||||||
IShellFolder* parentFolder;
|
IShellFolder* parentFolder;
|
||||||
LPCITEMIDLIST pidlLast;
|
LPCITEMIDLIST pidlLast;
|
||||||
|
|
||||||
// get and use the parent folder to display correct context menu in all cases -> correct "Properties" dialog for directories, ...
|
static DynamicFct<HRESULT(WINAPI*)(LPCITEMIDLIST, REFIID, LPVOID*, LPCITEMIDLIST*)> SHBindToParent(TEXT("SHELL32"), "SHBindToParent");
|
||||||
if (SUCCEEDED(SHBindToParent(pidl_abs, IID_IShellFolder, (LPVOID*)&parentFolder, &pidlLast))) {
|
|
||||||
HRESULT hr = ShellFolderContextMenu(GetDesktopFolder(), _hwnd, 1, &pidlLast, pos.x, pos.y);
|
|
||||||
|
|
||||||
parentFolder->Release();
|
if (SHBindToParent) {
|
||||||
|
// get and use the parent folder to display correct context menu in all cases -> correct "Properties" dialog for directories, ...
|
||||||
|
if (SUCCEEDED((*SHBindToParent)(pidl_abs, IID_IShellFolder, (LPVOID*)&parentFolder, &pidlLast))) {
|
||||||
|
HRESULT hr = ShellFolderContextMenu(parentFolder, _hwnd, 1, &pidlLast, pos.x, pos.y);
|
||||||
|
|
||||||
CHECKERROR(hr);
|
parentFolder->Release();
|
||||||
|
|
||||||
|
CHECKERROR(hr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
CHECKERROR(ShellFolderContextMenu(GetDesktopFolder(), _hwnd, 1, &pidl_abs, pos.x, pos.y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;}
|
break;}
|
||||||
|
|
Loading…
Reference in a new issue