Sign in to follow this  
Followers 0
Christopher Blue

How can I refresh the system tray?

7 posts in this topic

Recently I have written a script to kill all open instances of AutoIt. However, by doing so, they leave their icons in the system tray until I mouse over them. I was wondering if there is a DLLCall or otherwise that will allow me to force a systray refresh before my "kill" script exits itself?

Share this post


Link to post
Share on other sites



I have found some information here. I shall check it out and reply back.

Share this post


Link to post
Share on other sites

It seems that I could simply program my script to mouseover the systray and then return to it's previous spot before my script exits but it seems like a half-hearted solution compared telling the system tray itself to refresh.

Share this post


Link to post
Share on other sites

How do I find those hidden AutoIt windows? A search for AutoIt3 and AutoIt3.exe both find nothing.

Share this post


Link to post
Share on other sites

Here's an example you could use.

;Put this in the script you want to shutdown later

AutoItWinSetTitle(@ScriptName)

;Use this to shutdown the other script

WinClose("filename of the script")

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Thank you for the tip SlimShady! I have been able to finish my AutoIt Killer script:

AutoItKiller.au3:

Opt("WinTitleMatchMode", 3)
AutoItWinSetTitle("AutoIt Killer"); Give this script a different name so it doesn't kill itself off

$window_name = "AutoIt v3"

While (WinExists($window_name))
    WinClose($window_name)
WEnd

This works well for the most part but will prove imperfect if I start naming my AutoIt script windows. But I have not had to yet and if I do I shall deal with it on a case-by-case basis.

edit: Actually I could just name my AutoIt scripts with a standard prefix like "Christopher Blue's *blah* *blah*". That would allow me to successfully search and close all AU3 windows without losing the ability to differentiate between them for programming purposes. So I spoke too soon I guess...your method rocks SlimShady! :)

Edited by Christopher Blue

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