AutoHotkey Community

It is currently May 27th, 2012, 7:36 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: AHK Icon Changer
PostPosted: January 4th, 2005, 8:25 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
This simple script will let you use custom icons for compiled ahk scripts (main/pause/suspend etc.). Run it after a new installation of ahk (or when u get bored of current icons)

Required : ResHacker

Code:
;These are the paths to icons
;leave blank to not to alter.

;Main
MIco = E:\stuff\Pics\icons\GeoIcons\arrow.ico

;Suspend
SIco =

;Suspend
PIco =

;Suspend + Pause
SPIco =

;Path to ResHacker.exe

RHPath = E:\Program Files\Resource Hacker\ResHacker.exe

;___________________________________________


; Gets path to AutoHotkey
RegRead, AHKPATH, HKEY_CLASSES_ROOT, AutoHotkeyScript\Shell\Run\Command,
StringGetPos, POS, AHKPATH, \AutoHotkey.exe
StringLeft, AHKPATH, AHKPATH, %POS%
StringReplace, AHKPATH, AHKPATH, ",, A

IfNotExist, %AHKPath%\Compiler\AutoHotkeySC.bin
{
   MsgBox, AutoHotkey is not correctly installed.
   ExitApp
}

;creates backup (no overwrite so orig is retained)
FileCopy, %AHKPath%\Compiler\AutoHotkeySC.bin, %AHKPath%\Compiler\AutoHotkeySC.bak


IfNotEqual, MIco,
   Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %MIco%`, icon`,159`,

IfNotEqual, SIco,
   Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %SIco%`, icon`,206`,

IfNotEqual, PIco,
   Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %PIco%`, icon`,207`,

IfNotEqual, SPIco,
   Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %SPIco%`, icon`,208`,


_________________
Image


Last edited by Rajat on January 27th, 2005, 12:15 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 4th, 2005, 9:04 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
This is a great workaround until better control over pause/suspend icons is implemented. There have definitely been requests for this sort of thing.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 4th, 2005, 11:27 pm 
:D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 5th, 2005, 3:35 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
Quote:
There have definitely been requests for this sort of thing.

yes i remember seeing a couple of posts asking kind of the same thing... so posted this simple way.

by the way i remember seeing posts for version info updation too... that can be easily achieved by:

-changing the ver info in .bin file.
-saving the changed resource as .res file.
-using cmd line (reshacker) to merge that resource when reqd.

this way one can keep different version resources .res files (just like different .ico files) and use the one reqd.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 20th, 2005, 4:06 am 
Offline

Joined: November 6th, 2004, 11:03 am
Posts: 170
Location: Salt Lake City, UT
I updated this to include the icon resources for Win 98 (it's assumed that you would use the same ones on all OSes), and to include the Version Resource file.
Code:
;These are the paths to icons
;leave blank to not to alter.

;Main
MIco = E:\stuff\Pics\icons\GeoIcons\arrow.ico

;Suspend
SIco =

;Suspend
PIco =

;Suspend + Pause
SPIco =

;Version Resource - where the previously made .res file is stored
VRes = E:\stuff\version.res

;Path to ResHacker.exe

RHPath = C:\Program Files\AutoHotkey\ResHack\ResHacker.exe

;___________________________________________


; Gets path to AutoHotkey
RegRead, AHKPATH, HKEY_CLASSES_ROOT, AutoHotkeyScript\Shell\Run\Command,
StringGetPos, POS, AHKPATH, \AutoHotkey.exe
StringLeft, AHKPATH, AHKPATH, %POS%

IfNotExist, %AHKPath%\Compiler\AutoHotkeySC.bin
{
   MsgBox, AutoHotkey is not correctly installed.
   ExitApp
}

;creates backup (no overwrite so orig is retained)
FileCopy, %AHKPath%\Compiler\AutoHotkeySC.bin, %AHKPath%\Compiler\AutoHotkeySC.bak

; the first Run line is for the 2000/XP icon
; the second Run line is for 98/ME icon
IfNotEqual, MIco,
{
  Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %MIco%`, icon`,159`,
  Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %MIco%`, icon`,228`,
}

; the first Run line is for the 2000/XP icon
; the second Run line is for 98/ME icon
IfNotEqual, SIco,
{
  Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %SIco%`, icon`,206`,
  Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %SIco%`, icon`,229`,
}

IfNotEqual, PIco,
   Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %PIco%`, icon`,207`,

IfNotEqual, SPIco,
   Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %SPIco%`, icon`,208`,

IfNotEqual, VRes,
   Run, %RHPath% -addoverwrite %AHKPath%\Compiler\AutoHotkeySC.bin`, %AHKPath%\Compiler\AutoHotkeySC.bin`, %VRes%`, VersionInfo`,1`,


I discovered an interesting quirk of the ResHack program--on Win 98, at least: Opening the AutoHotkeySC.bin file from the Recent file list appears to load a cached version of at least the "Version Info" portion of the file. It took me way too long to figure that out. :oops:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 20th, 2005, 7:45 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
nice!

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 5th, 2005, 8:00 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
in case this might be of interest to anyone...

the icons of uncompiled scripts shown in tray can also be changed... use UPX from upx.sourceforge.net to unpack AutoHotkey.exe and then ResHacker to change icons.

I have the green one with the 'H' changed, as i got bored of it... even though i made that one! heh!!

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2006, 7:00 pm 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
I have updated the script a bit for comfort and added the possibility of several configurations (to manage different projects).
This script helps to change the icons of compiled and uncompiled (!) scripts.
It also allows to set the fileinformations (Copyright, Version, Description, ...) for a compiled script (has to be compiled with AHK Icon Changer).

To take full advantage you have simply to create a folder named "Settings" in the Scripts folder.

Image
Image

The script can be found here.

Thalon

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


Last edited by Thalon on October 27th, 2007, 2:42 pm, edited 9 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2006, 11:48 am 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
Rajat wrote:
in case this might be of interest to anyone...

the icons of uncompiled scripts shown in tray can also be changed... use UPX from upx.sourceforge.net to unpack AutoHotkey.exe and then ResHacker to change icons.

I have the green one with the 'H' changed, as i got bored of it... even though i made that one! heh!!
How can I use UPX to unpack AutoHotkey.exe?
The following command will end in a denied Permission:
Quote:
"C:\Dokumente und Einstellungen\Thalon\Desktop\upx.exe" upx -d C:\ProgramFiles\AutoHotkey\AutoHotkey.exe
Thalon

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2006, 12:43 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
After the reshack, one has to compile the script, right?
Couldn't this be done in this scripts too?

Just some ideas for usability:
- If the settings are saved in individual files or sections of on file, they could be listed in a listbox in the gui, so they could be easier selected and loaded via doubleclick.
- A preview of the icons in the gui would be nice.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2006, 1:34 pm 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
@toralf
At the moment the tools is not linked to a special script, but this support can be added.
The settings are saved in different configuration-files and the actual Save-dialog is only a fast implementation (can be seen at the fact that all path-information is thrown away).
A icon-preview will be added into the next version.

If I am able (and allowed) to recompile AutoHotkey.exe as shortly described by Rajat it will be also able to change the uncompiled scripts icons...
Other ideas are also welcome!

Thalon

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2006, 2:30 pm 
@toralf

What are you doing here? ;) Hast du keinen GUI zu programmieren? :lol: :mrgreen: I'm waiting full of excitement for SGUI v.4.2

Sorry for offtopic. :D
___________________
Cheers
AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2006, 2:50 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
:) Sorry.... *going back to work on prototype*

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 13th, 2006, 4:03 pm 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
I have updated the script above.

I have implemented toralfs suggestions there (it got a lot of code now ^^)

As soon as I know how to hack the Autohotkey.exe there will be a related update.

Further suggestions are welcome!

Edit: Deleting of config-files will be added soon
Thalon

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2006, 9:29 am 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
New Update available.
Added the Desciption-Property for Settingsfiles.
Added the possibility to Delete a Settingsfile via Dialog (Delete-Button and pressing Del-Button in Listview)
Minor changes in code-structure.

Thalon

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: kurakura, nothing, Yahoo [Bot] and 8 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group