This project shows the correct way to do this. WinForm Applications can leave an icon stranded in the tray after they terminate, without idle states.
See my blog article describing the problem this template project solves.
For an animated tray icon example of the project, see the forked project here.