I have to correct myselve. Although sending a WM_PAINT message would refresh the systray, this should not be necesary if the icon was deleted successfully. If the icon was not deleted successfully refreshing the systray would only delete the icon, if the app that placed it there was not running anymore, so this would not help.

The only thing I can think about is that you might have declared the nid local to a procedure. When deleting the icon, you would send an empty NOTIFYICONDATA structure, and the delete would fail. If this is the case, declare the variable at module level (Private or Public as appropriate).

I know this is far fetched, but it is (next to the End statement) the only thing I can think about.