Solved

What should be icon size that goes to systray

Posted on 2003-11-16
5
345 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 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.

749 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