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,14 +455,20 @@ LRESULT FileChildWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
|||
IShellFolder* parentFolder;
|
||||
LPCITEMIDLIST pidlLast;
|
||||
|
||||
static DynamicFct<HRESULT(WINAPI*)(LPCITEMIDLIST, REFIID, LPVOID*, LPCITEMIDLIST*)> SHBindToParent(TEXT("SHELL32"), "SHBindToParent");
|
||||
|
||||
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(GetDesktopFolder(), _hwnd, 1, &pidlLast, pos.x, pos.y);
|
||||
if (SUCCEEDED((*SHBindToParent)(pidl_abs, IID_IShellFolder, (LPVOID*)&parentFolder, &pidlLast))) {
|
||||
HRESULT hr = ShellFolderContextMenu(parentFolder, _hwnd, 1, &pidlLast, pos.x, pos.y);
|
||||
|
||||
parentFolder->Release();
|
||||
|
||||
CHECKERROR(hr);
|
||||
}
|
||||
} else {
|
||||
CHECKERROR(ShellFolderContextMenu(GetDesktopFolder(), _hwnd, 1, &pidl_abs, pos.x, pos.y));
|
||||
}
|
||||
}
|
||||
break;}
|
||||
|
||||
|
|
Loading…
Reference in a new issue