How to get IContextMenu from IShellLink?
Hi everyone:
My goal is to call IContextMenu::InvokeCommand on a default command of a context menu for a shortcut. I can get a reference to the IShellLink the following way:
Code:
IShellLink* pshl;
IPersistFile* ppf;
CoCreateInstance(CLSID_ShellLink, ..., &pshl);
pshl->QueryInterface(IID_IPersisFile, &ppf);
ppf->Load(pShortcutFilePath, STGM_READ);
but how do I get a reference to IContextMenu then?
Thank you!
Re: How to get IContextMenu from IShellLink?
From MSDN:
Quote:
IContextMenu Interface
. . .
Remarks
. . .
Applications use IContextMenu to retrieve information about the items in an object's shortcut menu and to invoke the associated commands. To retrieve an object's IContextMenu interface, an application must call the object's IShellFolder::GetUIObjectOf method.
Re: How to get IContextMenu from IShellLink?
It's a Win32 FAQ : you get it from the pidl
see news://194.177.96.26/comp.os.ms-wind...ogrammer.win32
(C/C++ code)