Sign in to follow this  
Followers 0
Autoseek

How to change icon of executable in task bar when running

3 posts in this topic

Hi everyone,
 
briefly upfront, this is just a "cool gimmick" I would like to implement. This is not "mission critical", and I won't get desperate if I don't find a solution. B)
 
I have written a little time tracking tool. When the tool is stopped, there is a "red light":

post-85977-0-97647700-1401118206_thumb.j

When the tool is running (tracking time), there is a "green light".

When the tool is minimized or the main window is in the background, i would like to see immediately whether the tool is running or not. Since the running executable is shown in the task bar. I thought it would be nice if I could change that small icon displayed in the task bar into "red" or into "green" depending on whether time is being tracked or not, please see a photoshopped example:

post-85977-0-56099600-1401118237_thumb.j

I think I have seen programs that can modify their icon during run-time. How can this be done using AutoIt?

Thank you for any suggestions.

Best regards

Autoseek

Share this post


Link to post
Share on other sites



You need to add the icons as resources with the AutoIt3Wrapper_Res_Icon_Add directive.

Then you can use TraySetIcon(@ScriptFullPath, -5) to change the icon an time you want.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thank you for your answer. While investigating this, I found the example under TraySetIcon, and I noted that my question was not precise enough. I meant to refer to that part of tray, where the program windows are shown, so more to the left. Still, you sent me into the right direction, and I found a solution with GUISetIcon. So, again, thanks, that was a big help!

BTW, in case anyone is interested. I went to the site Converticon to generate the required ICO-file.

Cheers

Autoseek

Edited by Autoseek

Share this post


Link to post
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
Sign in to follow this  
Followers 0