how to create shortcut icon for application programatically in program files. RRS feed

  • Question

  • Hi,

        I need to create additional shortcut icon (programatically) for my application in program files folder (in addition to one tht is created during cab file installation).

        Req:  I want to show 2 icons with different names for same application as shortcut in program files.

    Tuesday, October 27, 2009 9:05 AM


All replies

  • Why don't you add the extra link to the CAB installer as well. From what you describe these are two different files (links) that point to the same location, but are named differently.

    Tuesday, October 27, 2009 9:41 AM
  • Hi,

    This discussion helps you to Create Shortcut programatically:


    Tuesday, October 27, 2009 9:52 AM
  • Hi,

          I am using VC++ for development and using SHCreateShortcut i am able to create shortcut but the problem is there is no option for changing icon
    of the shortcut.

    req : create new shortcut with new icon. I am able to create new shortcut with new name(using SHCreateShortcut ) but icon remains same.

    @shai  cant use cab installer in this case since req is to create shortcut with new name and icon dynamically.

    Tuesday, October 27, 2009 10:28 AM
  • If I am not mistaken the icon is stored in the target, meaning in the exe file it points to.
    Tuesday, October 27, 2009 10:53 AM
  • I should say No for tht , ok i will try to explain req bit more :

    REQ : I hav appl A  using some file FileA, after sometimes application is updated(call it B) which is same application but using FileB and not FileA.

         I need existance of both application A and B, so basically .exe file for both of them will remain same . , so in one of few solutions tht i thought to         acheive this is, to create 2 different shortcut icons for same application. so when user presses icon for application A ..FileA will be used and if B then fileB will be used.

    SHCreateShortcut , do creates shortcuts for me but uses icon of .exe ... but tht fails req ... i need way to change icon of shortcut .


    Tuesday, October 27, 2009 11:22 AM
  • Hi All,

    While creating shortcuts to the application, the exe's icon is
    associated to the .lnk file. How do we change the icon or use our own
    icon for displaying in the .lnk file?
    I'm aware that, current Windows CE api's (i.e., SHCreateShortcut,
    SHCreateShortcutEx) doesn't support this feature.

    Any other way to do it programmatically?

    Or Atleast how do we associate the windowsce's default icon?

    Any help is greately appreciated..

    • Merged by warrentang Friday, October 30, 2009 7:35 AM multi-post
    Wednesday, October 28, 2009 6:27 AM
  • Hi,



    I guess you are looking for this,



    Hope it helps,

    Zhe Zhao

    • Marked as answer by warrentang Monday, November 2, 2009 2:26 AM
    Thursday, October 29, 2009 6:45 AM