Hi All,
Currently the way that ShellExecute is implemented looks wrong. Resolving shortcuts is done by calling SHELL_ResolveShortCutW (line 273 of dlls/shell32/shlexec.c) instead of invoking ShellLink object and letting it resolve itself.
The question is, through which interface (or set of interfaces) does shell32 invoke the Shelllink object?
From what I can determine, ShellExecute should use the .lnk extension to look in the registry (HKCR.lnk -> HKCR\lnkfile\CLSID) and get CLSID_ShellLink. Using the CLSID, it calls CoCreateInstance, then IShellExtInit->Initialize() which loads the .lnk file.
Unfortunately, the next step is unclear to me. I think that IContextMenu->InvokeCommand is used, but I'm not sure as to how.
If anybody (Michael Jung?) knows how this works, please let me know, as I'd like to make IShellLink work properly, complete MSI advertised shortcuts and clean up ShellExecute...
thanks!
Mike
On Friday 23 September 2005 4:10 am, Mike McCormack wrote:
Hi All, The question is, through which interface (or set of interfaces) does shell32 invoke the Shelllink object?
From what I can determine, ShellExecute should use the .lnk extension to look in the registry (HKCR.lnk -> HKCR\lnkfile\CLSID) and get CLSID_ShellLink. Using the CLSID, it calls CoCreateInstance, then IShellExtInit->Initialize() which loads the .lnk file.
Unfortunately, the next step is unclear to me. I think that IContextMenu->InvokeCommand is used, but I'm not sure as to how.
Pass the result of IShellLink::GetIDList to IShellFolder::GetUIObjectOf to get an IContextMenu Or if IShellLink::GetIDList fails, you could pass IShellLink::GetPath to IShellFolder::ParseDisplayName first Then call IContextMenu::InvokeCommand