Okay, I found this out a while ago.
When a portable application such as Pidgin or Miranda runs, windows will store the settings for the behavior of the system tray icon [Always Show, Always Hide, Hide when Inactive] in the registry. However, when the program closes, these settings are kept and will be displayed under "Past Items" in the customize notifications part of the Taskbar & Start Menu Properties. This exposes all the applications which use system tray icons, that have previously been running on the computer. *gasps*
Fortunately, Microsoft has a solution for this issue:
To clear the Past Items list, perform the following steps:
- Delete the IconStreams and PastIconsStream values from the following registry key using regedit.exe:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify - Open Task Manager, click the Processes tab, click Explorer.exe, and then click End Process.
- In Task Manager, click File, click New Task, type explorer, and then click OK.
Would there be a way to automate this process by backing up the registry values and copying the user's custom ones in instead? The only thing left to automate would be the restart of explorer. Is it possible to stop and restart a process (eg. explorer.exe) using NSIS (or AutoIt, possibly)? This would also allow a user to take those icon behavior settings around to other computers, and would conceal which apps they were using.
This is just an idea, I don't know if it would work.
Any more ideas/suggestions?
[Pre tags added by moderator SL]
cowsay Moo
cowthink 'Dude, why are you staring at me.'
I think I'll try this out and make an app out of it. It would make clearing those icons a lot easier.
Thanks for that.
Only bad thing is that if you set the icons to always show/hide (I set all the ones for my portable apps to always show), Windows won't remember that once the icon is deleted from the registry...
Also, I notice that the NSIS script above kills explorer and restarts it. Not the best idea, as killing explorer like that loses the positions of any recently moved desktop icons, and may cause some tray icons to disappear unless the app(s) that created them are programmed to deal with explorer restarting (many still aren't!)
Yeah, I'd tend to agree.
What's the purpose for killing Explorer, did the Microsoft article say? If it is to clear Explorer's settings from memory, you'd do better (if on a computer at work or school) to restart the whole computer, or at least log off and back on (which restarts Explorer. You could have a the program clear those registry entries and log you off ... and dismount Truecrypt volumes, and run MRU-blaster, and securely erase everything in the TEMP directory, and ...
Have you checked whether those programs can be configured to not use the notification tray? Maybe that would eliminate the settings in the registry.
MC
I've researched this a little before. It is actually necessary to kill explorer via Task Manager. It seems the icon settings are stored in memory and rewritten to the registry on logoff/shutdown. So even if you clear the reg entries, they're recreated. Killing explorer prevents the entries from being recreated, and is the only way to clear the cache.
But you could follow also this guide.
"Those people who think they know everything are a great annoyance to those of us who do." Asimov
all u need to do to remove the registry without making a launcher is to make a new .reg file and do this.................
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify]
"BalloonTip"=dword:00000005:Original key to add to registry now for it to delete do this
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify]
"BalloonTip"=dword:00000005:Instead just put a hyphen (-) in the beginning of the value, then just double click, click yes to add, but instead it wont add these values, it will delete them. Now all you would need would be some kind of .bat file or NSIS script to close and restart explorer.exe or you could just restart computer.
Found this info at Microsoft
An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)
Sure, but you still have to kill and restart explorer to make it work.
Nice find. But I think you need to forcibly terminate explorer so it doesn't get a chance to write the keys in the registry. I think properly closing it would still allow it to do so.
And hence, as I said, you also lose some other explorer-related customizations and run the risk of losing tray icons, as well. Okay for a "personal" launcher but not so good for a release-worthy app.
Here is my solution:
Open notepad or any similar program
" here is wat will close then restart explorer"
paste this in
@echo off
taskkill /f /IM explorer.exe
explorer.exe
then just save it as something like explorerclose.bat or *anything*.bat
delete the registry key, then just run the newly created batch file and it should work.
An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)