Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python-Tkinter:how to highlight item on taskbar on windows xp when window is minimized to the taskbar

i am using python/tkinter to write a IM software on XP. now i've got all the main functions done except i don't know how to highlight or change colour my IM item on taskbar on windows xp when window is minimized to the taskbar when a new message is received. i've search for this but just got c# solution. i need help on python. thanks!

like image 696
Basil Avatar asked Sep 18 '25 13:09

Basil


1 Answers

I needed to do this for a tkinter python slack client I am writing and found http://wiki.tcl.tk/1049 . After a bit of guessing, I found that

Tk().deiconify()
Tk().focus_force()

(i.e. on the root window) does the trick. Windows doesn't actually change the focus and show the window since applications are not allowed to do that (Windows after XP) but it flashes the taskbar instead. It will keep flashing until clicked on but that seems to be the behaviour of Skype/Slack etc. Certainly close enough for many uses.

Obviously this is an old question but I couldn't find a concise, python only, answer and still needed one!

like image 195
Dominic Fitzpatrick Avatar answered Sep 21 '25 02:09

Dominic Fitzpatrick