PDA

View Full Version : Shell.CreateShortcut - Icon fails to show


mjt1
09-08-2006, 07:34 AM
Hi,

Shell.CreateShortcut works fine and creates the shortcut. But the shortcut shows no icon. The icon index is correct. In fact if I right click on the icon and select Change Icon you can see the icon there. It seems to need an Apply.

Shell.CreateShortcut(Shell.GetFolder(SHF_DESKTOP), "My App", SessionVar.Expand("\"%AppFolder%\\mypp.exe\""), "", SessionVar.Expand("%AppFolder%"), SessionVar.Expand("\"%AppFolder%\\myapp.exe\""), 0, SW_SHOWNORMAL, nil, "");

I have tried specifying the target in the icon file path. Icon index is left as zero as I want the first icon in the file. Why is the icon not showing on the shortcut - it's as if I need to call another command to do some kind of refresh or something.

Same parameters work in SuF6.0 with the old Create Shortcut action.

Any ideas?

Tek
09-08-2006, 04:59 PM
You may have a problem in your syntax, and you may have missed an 'a' in there. Try this instead:


Shell.CreateShortcut(Shell.GetFolder(SHF_DESKTOP), "My App", SessionVar.Expand("%AppFolder%\\myapp.exe"), "", SessionVar.Expand("%AppFolder%"), SessionVar.Expand("%AppFolder%\\myapp.exe"), 0, SW_SHOWNORMAL, nil, "");