0

How can one change the icon image of a pre-existing shortcut through java? I do not want to change the icon image of a java executable, but have a java program that changes a shortcut's icon image.

I know I can manually change the icon image by right clicking on a shortcut and going to properties->shortcut->change icon, but I would like to do this through java.

user972276
  • 2,973
  • 9
  • 33
  • 46

1 Answers1

1

Its impractical do this in pure java yourself, although the lnk-file format is documented by microsoft (http://msdn.microsoft.com/en-us/library/dd871305.aspx), but since it originated with Win95 it underwent significant extensions and redefinitions over the years. Implementing this seems like a daunting task.

You can try to find a library that implements it for you, e.g. http://ovanttasks.sourceforge.net/ov-native/ may do what you want.

The alternative would be to use existing Windows API's to do the job (See How do you create (and read) windows shortcut(.lnk file) in Java?).

Community
  • 1
  • 1
Durandal
  • 19,919
  • 4
  • 36
  • 70