Evgeniy
Evgeniy

Reputation: 193

How to get taskbar background color

I have notifyIcon located at the notifyArea of the Win7 taskbar. This Icon contain dynamic text info - Black text on the trasparent bitmap. So, with Standard Windows theme (light) information readable but with other "dark" windows themes not.

I want to get taskbar background color and eventually draw Icon with appropriate color (ex White text if Dark taskbar color)

Upvotes: 4

Views: 744

Answers (1)

Sheepy
Sheepy

Reputation: 18005

It seems that you are not the first to try.

I think that there are two alternatives, if you don't want a background colour:

  1. Add a text border or shadow. You can do that by drawing the text in the border/shadow colour first with a one pixel deviation in the four directions (border) or in the shadow direction. I suggest a black border around light text.

  2. As I understand windows icon support a reverse colour, which is the opposite of whatever colour it is painted on. Don't look nice but they are pretty visible - I am using them for my cursor.

Hope this helps.

Upvotes: 1

Related Questions