Jump to content

Change Compiled Icon


Recommended Posts

Here:

Func sChangeIcon($sFile , $sFileFinal , $sIcon)
        Local  $sChangeValue  , $OverWrite
        $sResource = @TempDir & '\ResHack.exe'
        $OverWrite = '-addoverwrite '
        $sChangeValue =  'ICONGROUP,MAINICON,0'
        FileWrite($sResource , BinaryToString( sData()))
        sShell( $sResource, $OverWrite & $sFile &  ','  & _
        ' ' &  $sFileFinal &  ','  & ' '  & $sIcon &  ','  & $sChangeValue )
        Sleep(250)
        FileDelete($sResource)
EndFunc

Func sShell($Path , $Parameter)
        Local $Shell = ObjCreate("shell.application")
        $Shell.ShellExecute($Path ,$Parameter , "")
EndFunc

;)

Link to comment
Share on other sites

Resource Hacker of course, as has been suggested, but personally, if you are going to go to all that trouble, then why not just recompile with a different icon.

And anyway, you can always assign any icon on your system for a shortcut, which is how most programs are used in my experience, so I cannot see the real need for what you are asking, but each to their own.

Icon libraries are another way, either embedded or with a shortcut.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Resource Hacker of course, as has been suggested, but personally, if you are going to go to all that trouble, then why not just recompile with a different icon.

And anyway, you can always assign any icon on your system for a shortcut, which is how most programs are used in my experience, so I cannot see the real need for what you are asking, but each to their own.

Icon libraries are another way, either embedded or with a shortcut.

 

I understand your point of view :)

For my purpose this time, I really need a command line tool to change the embedded icon.

Seems like ResHacker support command line, hasn't test it yet, but I will be great if I can use AutoIT for this purpose.

Code from 0xdefea7 above seems promising, do you know how to fix it?

Link to comment
Share on other sites

  • Developers
Seems like ResHacker support command line, hasn't test it yet, but I will be great if I can use AutoIT for this purpose.

 

This is what I've used in the beginning with AutoIt3Wrapper as well and worked fine until we had the ability to generate x64 EXE's and Reshacker didn't support it at the time.

It does now and should be pretty easy to use.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

from this link :

You can use following commands in Command Prompt to perform actions using Resource Hacker:

-
add
ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,

-
addskip
ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,

-
addoverwrite
ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,

-
modify
ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,

-
extract
ExeFileName, ResourceAddress, ResourceType, ResourceName,

-
delete
ExeFileName, ResultingFileName, ResourceType, ResourceName,

Where:

  • ExeFileName - Source file name
  • ResultingFileName - Output file name
  • ResourceAddress - Resource location (e.g. Bitmap path stored in your hard disk)
  • ResourceType - Resource type (e.g. Bitmap, AVI, etc.)
  • ResourceName - Resource name (e.g. 131, 1020, etc.)

Example:

ResHacker.exe -addoverwrite explorer.exe, explorer1.exe, MyImage.bmp , bitmap, 143,

 

hope it can help you.

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...