dcsimg
Results 1 to 18 of 18
  1. #1

    Thread Starter
    Member aarslan1's Avatar
    Join Date
    Dec 2010
    Location
    Canada
    Posts
    46

    Cool Icons In a VB6 Executable

    Hello People,
    I was just trying to find a workaround to embed icons with transparency and alpha layer into a VB6 compiled Executable.
    I used two softwares for this purpose:

    1) IncoConverter_2_0.exe is a freeware software to convert a .PNG icon file to a .ico format.
    2) I used EXE Icon Converter Version 5.0 (its attached in the rar file). I created the .ico file of 128 x 128 size. and replaced the icons.
    Note: I replaced all the icon versions (128*128, 32*32, 16*16 with this one)

    -> The new generated exe shows the icon I replaced in Windows XP. However, In Windows 7, it shows the same VB6 Icon (White form with green title).
    Why is this happening, I have no idea, But I assume, its because of Windows 7's use of transparency and large icons (Maybe 256*256).

    Any Suggestions?
    Thinking And Saying Java is great because it works on All operating Systems is same as saying Anal is good because it works on all genders - By Arslan

  2. #2

    Thread Starter
    Member aarslan1's Avatar
    Join Date
    Dec 2010
    Location
    Canada
    Posts
    46

    Re: Icons In a VB6 Executable

    Sorry, Forgot to attach the file. Here it is.

    The icon is show properly in Folders (Because the icon file size it uses i guess is less than 128*128).
    However, when pasted on desktop, it shows vb6 default icon.
    What you suggest?
    Attached Files Attached Files
    Thinking And Saying Java is great because it works on All operating Systems is same as saying Anal is good because it works on all genders - By Arslan

  3. #3
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,346

    Re: Icons In a VB6 Executable

    I do not understand what you are trying to do! Is this what you are asking?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

  4. #4

    Thread Starter
    Member aarslan1's Avatar
    Join Date
    Dec 2010
    Location
    Canada
    Posts
    46

    Re: Icons In a VB6 Executable

    @nightwalker83 :

    No, The link you gave does not relate to my question. Kindly read the question again, and have a look at attached file.
    Thinking And Saying Java is great because it works on All operating Systems is same as saying Anal is good because it works on all genders - By Arslan

  5. #5
    Hyperactive Member
    Join Date
    Jul 2010
    Posts
    273

    Re: Icons In a VB6 Executable

    There is an error in the icon header entry of the file (to be specific, a wrong entry in .dHeight, coded as 0 wheras it should be 128). Otherwise it is a valid 128x128 32-BPP icon file in every respect.

    I've corrected the error; would you like to try the corrected file in the attached ZIP?

    Edited: The reason you see the image display of your icon file in XP/Vista explorer is that the explorer relies on Bitmap Information Header to display the image (not Icon Directory Entry header).
    Attached Files Attached Files
    Last edited by petersen; Apr 2nd, 2011 at 06:53 PM.

  6. #6

    Thread Starter
    Member aarslan1's Avatar
    Join Date
    Dec 2010
    Location
    Canada
    Posts
    46

    Exclamation Re: Icons In a VB6 Executable

    @Peterson:

    I thank you for replying.
    I tried the icon you attached, But its still shows the same problem.
    Windows 7 uses large icons by default on desktop (unless you CTRL+SCROLL DOWN to reduce their size). Now the problem is when i reduce icon size, on desktop, it shows me the icon I applied. However in large icons (the default size), it shows the VB default icon. I'm really surprised, But Now I'm sure its because of size of icons differing. But How to sort that out, i'm still confused. I guess using 256*256 size and then applying is solution.
    Thinking And Saying Java is great because it works on All operating Systems is same as saying Anal is good because it works on all genders - By Arslan

  7. #7
    Hyperactive Member
    Join Date
    Jul 2010
    Posts
    273

    Re: Icons In a VB6 Executable

    Attached ZIP contains 2 files: One is 256x256 32BPP ICO, another 256x256 32BPP PNG, generated from your 128x128 32BPP ICO.
    .
    Attached Files Attached Files

  8. #8

    Thread Starter
    Member aarslan1's Avatar
    Join Date
    Dec 2010
    Location
    Canada
    Posts
    46

    Question Re: Icons In a VB6 Executable

    @Peterson:
    Many Thanks for replying, The 256*256 icon you attached, when embedded into exe shows a blank icon.
    However, One other thing amuzed me, the file in 'transparent2.zip', when embedded into some other exe and then tried to see if it works on Win 7 - Sursprisingly, it did. Though I'm more confused than ever.
    Kindly tell me how you fixed the mentioned .dheight and other parameters, so that I can do so with other icon files too.
    Thinking And Saying Java is great because it works on All operating Systems is same as saying Anal is good because it works on all genders - By Arslan

  9. #9
    Hyperactive Member
    Join Date
    Jul 2010
    Posts
    273

    Re: Icons In a VB6 Executable

    Aarslan1 wrote

    Many Thanks for replying, The 256*256 icon you attached, when embedded into exe shows a blank icon. However, One other thing amuzed me, the file in 'transparent2.zip', when embedded into some other exe and then tried to see if it works on Win 7 - Sursprisingly, it did. Though I'm more confused than ever.

    Kindly tell me how you fixed the mentioned .dheight and other parameters, so that I can do so with other icon files too
    This posting attempts to remove your confusion and to entertain your request.

    -- Earlier on I explained that Exploer relies only on Bitmap Information Header, hence is able to display the erroneously coded ICO file. However, not everyone adopts the same practice (ask yourself, otherwise what is the Icon Directory Entry header for if it can be ignored?). If one checks IDE, then one would reject the file because of the error there.

    -- For 256x256 icons, width and height are entered as "0" in Icon Directory Entry (MS invention, since there is no way to enter a value of "256" into a byte -- width and height are Byte in IDE).

    -- To make good of your other sloppy icon file, I let you use one of my gadgets. Please fetch the ZIP at: ---(URL removed as originally planned--- (I will remove the link later today, latest tomorrow). The ZIP contains 2 files: One exe and one zLIB.dll. Unzip them to a temporary folder and you can immediately use it. You may delete zLIB.dll if you wish so, but then you wouldn't have full options on saving PNGs. Please feel safe to run the program, it is good on all Windows platforms from WinME to Win 7 and it would never meddle with users' Windows registry.

    Basically, all you have to do is one by one "Open" and "Save" your ICO files -- errors in the original files if any are automatically corrected and the program would automatically save them to the most appropriate color depths.

    -- The screenshots below are self-explanatory. They are provided for your info only. For example, although all PNG items in a MS multi-item ICO file are coded as 32-BPP, some of them are in fact for "simple transparency" only. As such, my program would load it as non-32 BPP for good order's sake. If you select such an item and save it to an ICO file, you would find that there is a great saving in the saved file size (can be of several hundred &#37.

    Note that the first screenshot is just to let you have a feel how I detected the error, but this function is not included in the above-said program. You can't just take it as a wrong bHeight in IDE on seeing it is code "0" when bWidth is "128". For example, if biHeight of BIH is "512" (instead of the existing "256"), then bHeight of IDE is a valid one, i.e. icon size is 128x256. In that case, we have to look at other areas, including the three parts making up the icon -- image, mask & alpha.
    .
    Attached Images Attached Images     
    Last edited by petersen; Apr 5th, 2011 at 08:42 PM. Reason: Removed temp link as originally planned

  10. #10

    Thread Starter
    Member aarslan1's Avatar
    Join Date
    Dec 2010
    Location
    Canada
    Posts
    46

    Thumbs up Re: Icons In a VB6 Executable

    @Peterson:
    Many Many Thanks for replying and taking pains to solve the problem (alongwith PoC , you inspire me)

    -Well, I tried to do as you said, I believe i've now a good idea about whats happening. Still some icons are not working in some .exe's while working perfectly fine on other exe's (both in Win XP and Win 7, A paradox I still can't solve)



    Thank you
    ~Be Blessed~
    Thinking And Saying Java is great because it works on All operating Systems is same as saying Anal is good because it works on all genders - By Arslan

  11. #11
    Hyperactive Member
    Join Date
    Jul 2010
    Posts
    273

    Re: Icons In a VB6 Executable

    I would take a look of it, if you could send me the following:

    (1) The EXE file which has the icon that you want to replace.

    (2) Which icon inside the said EXE that you want to replace (with a screenshot of the existing image).

    (3) The replacing .ICO file.

  12. #12

    Thread Starter
    Member aarslan1's Avatar
    Join Date
    Dec 2010
    Location
    Canada
    Posts
    46

    Re: Icons In a VB6 Executable

    Sure, I'll PM you the link.
    Thinking And Saying Java is great because it works on All operating Systems is same as saying Anal is good because it works on all genders - By Arslan

  13. #13
    Hyperactive Member
    Join Date
    Jul 2010
    Posts
    273

    Re: Icons In a VB6 Executable

    You wrote that

    ,,,,some icons are not working in some .exe's while working perfectly fine on other exe's (both in Win XP and Win 7, A paradox I still can't solve)
    I believe I know the exact reason for what you encountered, i.e. sometimes okay and sometimes not. To prove what I suspect is truly the case, please send me the following instead:

    (1) 2 original EXE files: The one which is okay and the one which is not okay (if icons inside are replaced)

    (2) A screenshot of the image inside each of the above-said 2 EXE which you want to replace.

    Edited:
    I haven't received anything from you yet as of today.
    Last edited by petersen; Apr 6th, 2011 at 08:48 AM.

  14. #14

    Thread Starter
    Member aarslan1's Avatar
    Join Date
    Dec 2010
    Location
    Canada
    Posts
    46

    Question Re: Icons In a VB6 Executable

    Hello Peterson,
    I thank you for replying.
    I apologize for not replying fast, attribute this to my low internet speed in daytime.

    Here I'm posting some pictures of what I'm experiencing, I don't know if its happening only to me or there's some general reason behind it. I've also PM'ed you the link to the files.

    ~Be Blessed
    Attached Images Attached Images     
    Thinking And Saying Java is great because it works on All operating Systems is same as saying Anal is good because it works on all genders - By Arslan

  15. #15
    Hyperactive Member
    Join Date
    Jul 2010
    Posts
    273

    Re: Icons In a VB6 Executable

    I got your PM, but I am unable to obtain what I want, i.e. 2 EXE files and the screenshot requested in my last posting.

    I am not interested in the software that you used to replace icons.

    To simplify matters, please bundle the 2 items as I requested, in a ZIP (or RAR), and upload it here. After my acknowledgement (to signify that I have downloaded it), you may then remove the ZIP (or RAR).

  16. #16
    Hyperactive Member
    Join Date
    Jul 2010
    Posts
    273

    Re: Icons In a VB6 Executable

    This shall be my last posting in this thread.

    Simply put, in DLL/EXE files, icons may be organized on "individual" or "group" basis. Some EXE may have all icons on an individual basis, but not all (i.e. some of them have one or more group icons). To better present you the picture, shown below are two screenshots which should speak for themselves. EXE files follow the same resources format, although EXE files do not have that many icons, e.g. an EXE file of Adobe (PhotoShop or Reader) may have only a group icon consisting of a handful individual icons.

    If you replace some icons in an EXE file which happen to be belonging to a group, although individually retrieved they are okay, not so if the retrieval is on a group basis (the worst is, if the program itself makes a call referring by the group, you would be in deep trouble).

    So the problem is not with the replacing ICO files, but the software you are using -- it should not allow you to replace icons in an EXE file in such a manner. (BTW, I've also developed a gadget allowing users to replace icons in EXE, but it allows replacements only of the identical sizes and color depths of the respective ones).

    Edited:
    I've now taken a look of the EXE file in the RAR file in posting #2 and can confirm that it is exactly the case as described above: the 3 128x128 32-BPP icons belong to a group. When retrieved individually they are okay; however if one goes by group, the defect would surface. For example, dwBytesInRes of Library Icon Dir Entry (similar, but slightly different to Icon Directory Entry) for the first icon is "304" only (I believe it is the original entry before replacement of icon), despite the original icon had been changed to 128x128 32-BPP. Judging by the said "304" entry, the original is 32x32 1-BPP.
    .
    Attached Images Attached Images   
    Last edited by petersen; Apr 6th, 2011 at 09:36 PM.

  17. #17
    Junior Member
    Join Date
    May 2015
    Posts
    25

    Re: Icons In a VB6 Executable

    Could you please provide me the link of the convertion software, that PNG, MNG and other supplements, the software which petersen used???

  18. #18
    Junior Member
    Join Date
    May 2015
    Posts
    25

    Re: Icons In a VB6 Executable

    And please also that library icon extractor???

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width