changing an application icon
changing an application icon
raising an old issue from here https://autohotkey.com/board/topic/73578-changing-an-application-icon
comes a time when i open several instances of the same application, let's say Visual Studio for several projects.
now... looking at the task bar it is impossible to see which task item relates to which project as they all have the same Visual Studio icon.
can i somehow grab a window and change its icon?
see the last reply in the old thread... it works only part way...
it sets only the small icon on the window, but the icon on windows taskbar is not changed.
how do i change an icon for a specific window in the taskbar?
comes a time when i open several instances of the same application, let's say Visual Studio for several projects.
now... looking at the task bar it is impossible to see which task item relates to which project as they all have the same Visual Studio icon.
can i somehow grab a window and change its icon?
see the last reply in the old thread... it works only part way...
it sets only the small icon on the window, but the icon on windows taskbar is not changed.
how do i change an icon for a specific window in the taskbar?
-
- Posts: 4331
- Joined: 29 Mar 2015, 09:41
- Contact:
Re: changing an application icon
Should work like this:
Code: Select all
WM_SETICON := 0x80
ICON_SMALL := 0
ICON_BIG := 1
IMAGE_ICON := 1
$F1::
hIcon := LoadPicture("Shell32.dll", "Icon5", IMAGE_ICON)
SendMessage, WM_SETICON, ICON_SMALL, hIcon,, A
SendMessage, WM_SETICON, ICON_BIG, hIcon,, A
Return
Re: changing an application icon
this is indeed changing the icon on the application window itself.
but it is not changing the icon in windows taskbar.
but it is not changing the icon in windows taskbar.
-
- Posts: 4331
- Joined: 29 Mar 2015, 09:41
- Contact:
Re: changing an application icon
For me it changes icons on the window title bar and on the taskbar button both. Tested on Windows 7 and 10.
Re: changing an application icon
mmm... you are right... it does work... in most cases.
for some reason trying this on "ahk_exe webstorm64.exe" does not work.
any idea why?
for some reason trying this on "ahk_exe webstorm64.exe" does not work.
any idea why?
Last edited by shemesh on 31 Jul 2021, 04:36, edited 1 time in total.
-
- Posts: 4331
- Joined: 29 Mar 2015, 09:41
- Contact:
Re: changing an application icon
Tested with PhpStorm, the same result, the toolbar icon was not changed, can't tell why.
Re: changing an application icon
could the reason be because the running program is a 64bit version??
any way to force it work?
any way to force it work?
-
- Posts: 25
- Joined: 05 Jan 2022, 08:25
Re: changing an application icon
any solution to this? small icon works but not big
Code: Select all
SendMessage, WM_SETICON:=0x80, ICON_SMALL:=0, % LoadPicture(A_WorkingDir "\icon.ico", "Icon1", isIcon),, ahk_id %id%
SendMessage, WM_SETICON:=0x80, ICON_BIG:=1, % LoadPicture(A_WorkingDir "\icon.ico", "Icon2", isIcon),, ahk_id %id%