Solved

What should be icon size that goes to systray

Posted on 2003-11-16
5
344 Views
Last Modified: 2010-04-02
I want to put an icon in systray, but I don't know what size icon should be?
0
Comment
Question by:amakalski
  • 3
  • 2
5 Comments
 

Expert Comment

by:ks5d
ID: 9761400
OK, this isn't really a C++ question, but here goes:

from: http://www.techtv.com/callforhelp/howto/story/0,24330,3332137,00.html

"Icons come in three different sizes: 16x16, 32x32, and 48x48. 32x32 is the default, the size you see on your desktop. To create icons for your system tray or taskbar, go with 16x16."

Also, more to the programming interest of this board, here's an MSDN article describing how to create a system tray application:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp06102002.asp
0
 

Author Comment

by:amakalski
ID: 9764734
This type of question is difficult to find section for.
0
 

Author Comment

by:amakalski
ID: 9767644
I created 16x16 pixels icon, it looks ok in Resource Editor
but on systray it looks like it was squeezed a bit. Is it normal ?
0
 

Accepted Solution

by:
ks5d earned 50 total points
ID: 9768445

       Are you sure that the program isn't inadvertantly inserting a 32 x 32 version of the icon into the system tray?  What does your code look like?

Check out:
http://www.codeguru.com/mfc/comments/9525.shtml

    - Ken
0
 

Author Comment

by:amakalski
ID: 9773120
I used
nid.hIcon = AfxGetApp()->LoadIcon(IDI_SYSTEMTRAY_ICON2);
and I deleted 32x32 version from resource, but icon still looked bad.
I noticed that http://www.codeguru.com/mfc/comments/9525.shtml
uses different icon load method, so I tried using
nid.hIcon = (HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_SYSTEMTRAY_ICON2), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
Now the icon looks exactly as original.
Thank you.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question