Solved

Changing icons for Shortcuts

Posted on 1998-03-10
7
609 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
Comment Utility
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
Comment Utility
I need to change the icon programmatically.  This shortcut will be placed on the desktop after installation.
0
 
LVL 27

Expert Comment

by:aburr
Comment Utility
Find the Access 97 icon, rename it, substitute your own icon
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:mikk7
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

771 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

11 Experts available now in Live!

Get 1:1 Help Now