Any way to change the AHK icons?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
dangerdogL2121
Posts: 173
Joined: 01 Oct 2013, 23:11

Any way to change the AHK icons?

12 Nov 2013, 01:00

Reference to post: http://www.autohotkey.com/board/topic/5 ... file-icon/

I couldn't get what SCAN did to work, since I'm using windows7 and not XP. I tried using ResoureHacker to remove the icons from the program, but that didn't work either. The hope in this is to be able to change the taskbar icon for AHK message boxes.
thanks
lexikos
Posts: 9635
Joined: 30 Sep 2013, 04:07
Contact:

Re: Any way to change the AHK icons?

12 Nov 2013, 03:40

SKAN's (not SCAN's) post has nothing to do with the taskbar icon. It is only for the icon associated with .ahk files.

Replacing the icon resources using Resource Hacker will work if you are using it correctly. It cannot fail, since if you replace the icon resources there will be nowhere for AutoHotkey to get the original icons from...
User avatar
dangerdogL2121
Posts: 173
Joined: 01 Oct 2013, 23:11

Re: Any way to change the AHK icons?

13 Nov 2013, 15:43

Yes, I was able to change the icon associated with certain scripts with Resource Hacker.
Replacing the icon resources using Resource Hacker will work if you are using it correctly. It cannot fail, since if you replace the icon resources there will be nowhere for AutoHotkey to get the original icons from...
What I was thinking was that I could replace the icon resources of the icon that is displayed on the taskbar. That way, I might be able to insert my own script taskbar icon. Do you know if this is possible?
thanks
User avatar
emmanuel d
Posts: 90
Joined: 17 Nov 2013, 04:45

Re: Any way to change the AHK icons?

18 Nov 2013, 16:22

From our boy SKAN:

Code: Select all

#Persistent 
Ico := A_Temp "\remums.ico" 
IfNotExist, %ICO%, URLDownloadToFile
          , http://dl.dropboxusercontent.com/u/6428211/Gentee/RemUMS/v1-0/RemUMS.ico,%ICO%
Menu,Tray,Icon,%Ico%

Run, Notepad.exe,,, PID
Winwait, ahk_pid %PID%
ID := WinExist("ahk_pid" PID)

hIcon := DllCall( "LoadImage", UInt,0, Str,Ico, UInt,1, UInt,0, UInt,0, UInt,0x10 )
SendMessage, 0x80, 0, hIcon ,, ahk_id %ID%  ; One affects Title bar and
SendMessage, 0x80, 1, hIcon ,, ahk_id %ID%  ; the other the ALT+TAB menu

SetTimer, CheckID, 1000
Return

CheckID:
 If ! WinExist( "ahk_id" ID )
    ExitApp
Return
You can tweak it to change the icon of your script.
It also apply's to the taskbar icon.
Last edited by SKAN on 18 Nov 2013, 16:56, edited 2 times in total.
Reason: Fixed non-working urldownloadtofile link
User avatar
dangerdogL2121
Posts: 173
Joined: 01 Oct 2013, 23:11

Re: Any way to change the AHK icons?

19 Nov 2013, 00:12

Thanks emmanuuel d and great job SKAN.

Its cool but not exactly what I was looking for.
Somthing like this except the script's taskbar icon should change too.

Code: Select all

#Persistent 
Ico := A_Temp "\remums.ico" 
IfNotExist, %ICO%, URLDownloadToFile
          , http://dl.dropboxusercontent.com/u/6428211/Gentee/RemUMS/v1-0/RemUMS.ico,%ICO%
Menu,Tray,Icon,%Ico%

Gui, add, text, , look at this
Gui, show, Center h100 w100, gui 1
WinGet, ID, ID, gui 1

hIcon := DllCall( "LoadImage", UInt,0, Str,Ico, UInt,1, UInt,0, UInt,0, UInt,0x10 )
SendMessage, 0x80, 0, hIcon ,, ahk_id %ID%  ; One affects Title bar and
SendMessage, 0x80, 1, hIcon ,, ahk_id %ID%  ; the other the ALT+TAB menu

SetTimer, CheckID, 1000
Return

CheckID:
If ! WinExist( "ahk_id" ID )
    ExitApp
Return
But as lexicos pointed out, ResHack will work if I use it correctly. I just haven't got around to doing it yet, and its not high up in my ahk priority list.
thanks
User avatar
emmanuel d
Posts: 90
Joined: 17 Nov 2013, 04:45

Re: Any way to change the AHK icons?

20 Nov 2013, 15:37

You must be on win 7 or something because on XP Taskbaricon changes fine.
I see sombody can edit my post :shock: :lol:
I had just copy pasted from the "OLD forum" did not check the links
User avatar
dangerdogL2121
Posts: 173
Joined: 01 Oct 2013, 23:11

Re: Any way to change the AHK icons?

21 Nov 2013, 09:43

Yeah, I'm on Windows 7.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 135 guests