Solved

What should be icon size that goes to systray

Posted on 2003-11-16
5
341 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now