[python-win32] Cleanly Close System Tray Process
Mark Mc Mahon
mark.m.mcmahon at gmail.com
Tue Aug 1 20:55:01 CEST 2006
Hi,
On 8/1/06, Gregory Piñero <gregpinero at gmail.com> wrote:
> Hi guys,
>
> I've got this little yellow icon sitting in my system tray:
> http://i7.tinypic.com/21n08ig.png
>
> I'd like to use the windows API to somehow ask it to shutdown? If a
> system tray icon counts as a window then perhaps I could get its hwnd
> and do something like:
> win32gui.PostMessage(hwnd, win32con.WM_CLOSE, 0, 0)
> ?
>
> FYI so far I've been closing it with kill process but the problem is
> that it leaves the icon in the system tray and after a few days of
> opening and closing this thing I have 1000's of icons left over in the
> system tray.
I would suggest killing and refreshing the system tray (or
notification area). As far as I know if you kill the process and then
move your mouse over the icon - it will disappear.
Though it sounds much better to stop that process running if you
really don't want it to run.
Look in the registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
"Startup" Start menu folder
Not sure if those help?
>
> Much thanks!
>
Mark
More information about the Python-win32
mailing list