Tray icon End task
End the app behind a system tray icon with a modifier + middle click (Ctrl+Shift by default), including icons in the hidden icons flyout
Author: SammySco
Hold Ctrl + Shift and middle click a system tray (notification area) icon to
forcefully end the app that owns the icon. Icons in the hidden icons flyout
work too. The keys can be changed in the mod settings.
Plain middle clicks, and middle clicks with other keys, are passed to the app
as usual.
Notes
- The app is terminated immediately, without a chance to save its data.
- Apps running as administrator can't be ended, since explorer doesn't have the
rights to do so. Critical system processes are always skipped.
- Only the process that owns the icon is ended. Some apps show their tray icon
from a separate helper process, in which case the main app keeps running.
- The mod removes the app's tray icon just before ending it. Icons registered
by GUID can't be removed this way. If an icon is left behind, hovering over
it removes it.
- To try it safely first, turn on Test mode. In test mode nothing is ended,
and the mod only logs which app it would have ended (enable debug logging in
the mod's Advanced tab to see it).
How it works
When a tray icon is clicked, explorer forwards the mouse event to the window
that registered the icon, using the icon's callback message. The mod watches
for a forwarded middle click while the configured keys were held, which
identifies the window, and from it the process, that owns the icon. No
undocumented tray internals are used.
Tested on Windows 11 24H2.