Thanks for the feed-back.
I have just submited an update to souce code with:
BOOL CTrayIconPosition::CheckIfColorIsBlackOrNearBlack(COLORREF crColor)
>What do you think of using an icon with a white border (2pix for 32*32 icon) and calculate the exact rectangle of the icon?
I think that this could fail since there is no proof that border will not be disrupted by Windows. But I was thinking on a different approach. First you put a plain black icon into the tray and detect all black points, then put a bit lighter icon (dark gray) and check previously black pixels if now those are dark gray - is should stil take a blink of eye and be able to detect an rectangle of icon with a great precision.... I don't plan to implement this feature but (since simple point detection is enought in my applicatins) but I would gladly update souce code if someone would do this