Because I can't be the only person who's run into this: I think I've found a bug in Windows 7 where icons can disappear from the system tray if an application hides and then unhides an icon. It appears that Windows doesn't rearrange all the icons (as it does when a program adds or deletes an icon), but instead just moves the icons in that row along one space. If you've got more than one row, then you end up with an empty space at the end of that row... which Windows will happily fill with another icon. If the original icon is then unhidden then it pushes the new one off the end of the tray and it disappears from view entirely.
It's most annoying, as RSSOwl minimises to the tray but hides its icon when you reopen it triggering this bug. And some quirk of how the icons have ended up in the tray means it's often the icon for Semagic that vanishes from my taskbar.
Anyway, the workaround is to not use the NIS_HIDDEN flag but instead just add/delete the icon. Or if there's just one application causing it then I think moving it to the bottom-right corner of the tray also solves this, as stuff in the last row seems to be reordered correctly.
I wonder how one goes about reporting bugs to Microsoft?