Solved

Changing icons for Shortcuts

Posted on 1998-03-10
7
616 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

710 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