Solved

Changing icons for Shortcuts

Posted on 1998-03-10
7
615 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

679 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