S
S
Sergey Korenevsky2014-12-16 20:33:32
Icons
Sergey Korenevsky, 2014-12-16 20:33:32

How to get tray icon size?

I wrote a utility in C# that dives into the tray, attached a 16 * 16 icon to it and everything is fine.
Then a friend saw the Windows 8 taskbar mode "Do not group", in this mode the icons are displayed in 24 * 24. Of course, I opened the icon editor and put two more icons in the icon file with resolutions 24*24 and 32*32 to the existing 16*16.
I compiled my program and ran it. and I saw that in my tray with icons 16 * 16 my icon is displayed with a ladder. Those. I have a circle with a dot in my icon, and now a trapezoid with a triangle is displayed. Windows 8 (mine) took the icon from the program (NOT 16*16) (but 24*24 or 32*32) and converted it to 16*16 and brought it to the system menu.
How to find out the size of the displayed tray icon?
explorer-office.ru/soft/20-timerswitchoff

var systray = new System.Windows.Forms.NotifyIcon();
systray.BalloonTipIcon = ToolTipIcon.Info;
systray.Icon = new System.Drawing.Icon(GetType(), "_power.ico");

be52451f6876440eb805d7a9f0e8969e.png
did you see how ?, one with a ladder and the other without a ladder ?, in one (16,24,32) and in the other (16).
tajmer-viklyuchalka-timerswitchoff-big-1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Pukhov, 2014-12-17
@Neuroware

You can monitor the registry at the moment of switching the mode, the OS, like a smart masha, must put a check mark somewhere in the registry to remember the mode. Knowing in which branch the value changes, it will be possible to read it and therefore the attribute determines the modes, in fact this is the only moment on which the size of the icon depends, 16px is used everywhere

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question