How to make a non square Sys Tray Icon?

  • Thread starter Thread starter Benny Raymond
  • Start date Start date
B

Benny Raymond

I searched for a couple hours lastnight on example code of how to go
about making an item in the System Tray (notification area) not be
square. I've found several programs that do this but I can't seem to
find any documentation on how to actually get this to work.

I checked out some system messages that NotifyIcon uses thinking that I
could just make my component from scratch using these but nothing seemed
to be allowed to adjust the width of the icon.

Does anyone have any ideas? Eventually I want to have an item that
takes up two slots horizontaly, or an area like the clock - I know I can
create text by making a bitmap, drawing on it, and converting to an icon
- that's all working - but actually getting that to show up correctly is
giving me a headache.

Thanks in advance,
Benny
 
Benny,

You can't do this. The icon has to be 16x16 I believe. No other size
is allowed.

Hope this helps.
 
Benny,

I suspect you are having trouble differentiating between image formats. The
format used in the system tray is *.ico - You need to use transparency in
your *.ico to give the icon a non-square look (as the standard windows
"volume control" icon does.) Visual Studio is capable of creating such
icons.

I think Nick is correct... the standard Win32 API does not allow for
"multi-slot" tray icons.

--
Colin Neller
http://www.colinneller.com/blog



Nicholas Paldino said:
Benny,

You can't do this. The icon has to be 16x16 I believe. No other size
is allowed.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Benny Raymond said:
I searched for a couple hours lastnight on example code of how to go about
making an item in the System Tray (notification area) not be square. I've
found several programs that do this but I can't seem to find any
documentation on how to actually get this to work.

I checked out some system messages that NotifyIcon uses thinking that I
could just make my component from scratch using these but nothing seemed
to be allowed to adjust the width of the icon.

Does anyone have any ideas? Eventually I want to have an item that takes
up two slots horizontaly, or an area like the clock - I know I can create
text by making a bitmap, drawing on it, and converting to an icon -
that's all working - but actually getting that to show up correctly is
giving me a headache.

Thanks in advance,
Benny
 
I know about transparency in icons - I use it all the time - what i'm
talking about is different - please see my post RE Nicholas's post
 
Those programs don't appear to be written in .NET. You can always make a
PInvoke call to get to the unmanaged Win32 API. Try searching through the
Win32 forums or on www.pinvoke.net.

Alternatively, you could use a "toast" feature to keep the systray icon
small but popup a larger window periodically. Avalon (WPF) has very nice
support for Toast-style applications.
 
Benny,
both are completely different types of programs and both have non
standard "icons"

I don't think those are icons at all, but rather windows parented in
the notification area beside the toolbar holding the regular icons. In
other words it's a hack and not something supported through any API.

Do you have to place your GUI thingy in the notification area?
Wouldn't a supported extensibility way such as a desk band be an
option?

http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_adv/bands.asp


Mattias
 
I was about to write a simular response - after taking a quick look
through the pinvoke website I still couldn't find a way of doing it. I
guess doing a bad would be a friendlier way of doing this, however I
wanted my item to work as if it was a notification icon but take up 2
spaces instead of the normal 1 space. Perhaps I'll look a little more
into how to actually get a control to show up in the notification area
then then give up in a few weeks ;)

~benny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top