You cant' do it with just c.. you need to use some api provided by gnome or kde.
http://vamsikrishna.v.googlepages.com/trayicon
The link above is how you can do it using kde libraries. There must be similar for gnome too(since you are
looking for 'c' based .. i suggest you look for gnome equivalent).