Results 1 to 2 of 2

Thread: Setting an Icon

  1. #1

    Thread Starter
    New Member Graymalkin's Avatar
    Join Date
    Jan 2001
    Location
    Rio de Janeiro, Brazil
    Posts
    7

    Question Setting an Icon

    I know how to extract an icon from an executable and store it to a variable using ExtractIcon function, but how I set this icon to another executable? Is there any API call that do this?

    Thanks a lot.

    Graymalkin
    Why bother?

  2. #2
    Frenzied Member
    Join Date
    Aug 2001
    Posts
    1,075
    When you say "set this icon to another executable" do you mean you want Windows to display the extracted icon for some EXE file you select?

    If so, I don't think you can do that. Windows uses the ExtractIcon API to figure out what Icon to display for an EXE file. For other file types (TXT, DOC, ZIP) there is the \DefaultIcon registry setting.

    An EXE may have more than one icon in it but, as far as I know, Windows will always use the first one for the EXE. The other icons can be used to display differnt file formats associated with that EXE.

    HKEY_CLASSES_ROOT\.txt\DefaultIcon = "myapp.exe, 2"

    Use the 2nd icon in myapp.exe as the icon for TXT files.

    Greg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width