From cec35a53476501248559cb9f0d03cde2b408cf15 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Wed, 11 Feb 2004 08:35:10 +0000 Subject: [PATCH] fix context menu support svn path=/trunk/; revision=8147 --- .../subsys/system/explorer/shell/filechild.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/reactos/subsys/system/explorer/shell/filechild.cpp b/reactos/subsys/system/explorer/shell/filechild.cpp index da4ac223df9..171cc676a6e 100644 --- a/reactos/subsys/system/explorer/shell/filechild.cpp +++ b/reactos/subsys/system/explorer/shell/filechild.cpp @@ -455,13 +455,19 @@ LRESULT FileChildWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) IShellFolder* parentFolder; LPCITEMIDLIST pidlLast; - // 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); + static DynamicFct SHBindToParent(TEXT("SHELL32"), "SHBindToParent"); - 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;}