2

In my Win32 Qt 5.6 program, I want to programmatically create a shortcut to .exe file with custom arguments, and I want to assign my own .ico icon to this shortcut.

Can I do it easly with Qt? I can't find enough information on intrnet about it. Thank you for any advice.

km2442
  • 779
  • 2
  • 11
  • 31
  • 2
    I don't think you can from Qt. Try native code http://stackoverflow.com/questions/3906974/how-to-programmatically-create-a-shortcut-using-win32 – o9000 May 10 '16 at 20:58

1 Answers1

1

The answer is half yes, and half no. You can create shell links using QFile::link(), but you can't set the icon.

This answer from o9000's linked question should help with setting the icon. You might want to go solely with the Windows API so that you can create the link and set its icon at the same time.

Community
  • 1
  • 1
jonspaceharper
  • 4,207
  • 2
  • 22
  • 42