Interaction between shell32.ShellExecute, IContextMenu and the ShellLink object?

Mike McCormack mike at
Fri Sep 23 03:10:53 CDT 2005

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...



More information about the wine-devel mailing list