Solved

Changing icons for Shortcuts

Posted on 1998-03-10
7
611 Views
Last Modified: 2008-02-26
I am creating Desktop shortcuts for an Access97 application using fCreateShellLink from STKIT432.dll.  The problem is that it creates the shortcut using the Access97 icon rather than my program icon.  How can I change the icon for the shortcut?  From what I have read, I would have to use the IShellLink interface, but I haven't been able to successfully implement it.
0
Comment
Question by:mikk7
7 Comments
 
LVL 1

Expert Comment

by:cbeattie
ID: 1970410
I may be misunderstanding the question, but I think you should be able the edit the desktop shortcut like any other.  Once the icon is there, right click the icon, select properties, and the shortcut tab has a button for "change icon".
0
 

Author Comment

by:mikk7
ID: 1970411
I need to change the icon programmatically.  This shortcut will be placed on the desktop after installation.
0
 
LVL 27

Expert Comment

by:aburr
ID: 1970412
Find the Access 97 icon, rename it, substitute your own icon
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:mikk7
ID: 1970413
When I check the icon properties, %SystemRoot%\system32\SHELL32.dll is listed as the icon.  Even if I could find the access icon, I wouldn't want to change it because some users have Access 97 loaded on their computers.

What I'm looking for is a function like fCreateShellLink that allows me to specify the icon or a way to implement iShellLink, which opens up all of the properties of the Shell Links.
0
 
LVL 3

Expert Comment

by:hkp
ID: 1970414
You  are talking about a specific DLL, and a specific Interface in some COM-enabled language... Right?

There's no way to get a particular icon referenced from a multiple icons DLL. You have to point it out, manually, then you can copy the shortcut to where you need it.

You could extract the needed icon from the STKIT432.DLL, and then refer directly to it from the "Change Icon" Dialog Window.
This solution gives you any icon you want.

To be able to extract the icons from a DLL or EXE file, there are some icon managers around. Try the following URL for a download: http://www.risoftsystems.com/iclbuild.asp


0
 

Author Comment

by:mikk7
ID: 1970415
The icon I want is not in a multiple icons dll file.  I have an ico file for it.  The problem I'm having is how to get the icon (or any) property of the .lnk file.
0
 
LVL 3

Accepted Solution

by:
hkp earned 100 total points
ID: 1970416
Why don't you look at the file with "debug"?

By looking at a .lnk file or two I found that the position 56 in decimal holds the current icon number amongst the icon ressources in the given .exe file, or .dll file.

The position 64 hold the ASCII value of the short cut key
position 65 has bit 0 set if shift is used in the short cut key
position 65 has bit 1 set if ctrl is used in the short cut key
position 65 has bit 2 set if alt is used in the short cut key

By continuing to experiment you can probably find out how the .lnk files are organized, and then you can obtain your needed information.

The last string in the .lnk is the host file for the icons

Now, I can't get you closer, sorry. Btw, programming can do the rest of the job.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now