|
-
November 2nd, 2008, 04:05 PM
#1
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!
-
November 3rd, 2008, 07:03 AM
#2
Re: How to get IContextMenu from IShellLink?
From MSDN:
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.
Best regards,
Igor
-
November 3rd, 2008, 01:17 PM
#3
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)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|