Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Put an Icon in a WSH Script?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00478045
Message ID:
00478844
Views:
31
>>>I am shelling out from my VFP app to a WSH VBScript file. How can I staple an icon on to the executing script?
>>>
>>>Thanks.
>>
>>Do you mean a shortcut icon?
>>if so I use this
>>** MakeSC()
>>LPARAMETERS tcLink, tcTargetPath, tcDescription, tcWorkingDirectory
>>LOCAL loShell, loShortcut, lcDesktop
>>loShell = CREATEOBJECT("WScript.Shell")
>>lcDesktop = loShell.SpecialFolders("Desktop")
>>loShortcut = loShell.CreateShortcut(lcDesktop + "\\" + tcLink + ".lnk")
>>loShortcut.TargetPath = tcTargetPath
>>loShortcut.WindowStyle = 1
>>loShortcut.Description = tcDescription
>>loShortcut.WorkingDirectory = tcWorkingDirectory
>>loShortcut.Save()
>>
>>And the icon is carried over from the exe, I am also having icon problems
>
>You can specify the icon, using the IconLocation property of the WSHShortCut object. This can be in the executable or other resource such as a DLL. Simply set the property. It takes the form of:
>
>loShortcut.IconLocation = < filename, index >
>
>IOW, the string contains the fully qualified filename, followed by a comma, then the zero based offset of the icon within the file.

My prob is I add a single icon file with both a 16x16 and a 32x32 icons in it but it only sees the 32x32 icon, I tried to follow the steps I found here (UT) but it has a refrence to a Visual Studio image program that I didn't get with my VFP6.0, so I tried to use many other programs with the same result
( you don't have to worry about answering this, I could care less if the 16x16 icon is the basic VFP icon or a general exe icon, but I would like to fix it)

btw George is it me or are you the VFP guru?
Stephen McLaughlin
"Sexy Steve Valenteno", "Blastmaster"
stephenmclaughlin@gmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform