Using Window's System Tray Icon

G

Guest

When I add a USB key, system tray icon on Windows XP shows USB icon. It also
shows icon that can be used to "Safely Remove Hardware". I would like to use
this icon in one of my Visual C++ application.

All I could find is that I can use LoadStandardIcon() call in Windows to
expose very few Standard icons, which includes default application icon,
information icon, warning icon, error icon, question mark icon and
exclamation point icon.

I didn’t see any way to use other Windows icons. If anyone knows a way, I
would be interested in getting a solution. Thank you.
 
B

Bruno van Dooren [MVP VC++]

When I add a USB key, system tray icon on Windows XP shows USB icon. It
also
shows icon that can be used to "Safely Remove Hardware". I would like to
use
this icon in one of my Visual C++ application.

All I could find is that I can use LoadStandardIcon() call in Windows to
expose very few Standard icons, which includes default application icon,
information icon, warning icon, error icon, question mark icon and
exclamation point icon.

I didn't see any way to use other Windows icons. If anyone knows a way, I
would be interested in getting a solution. Thank you.

Undoubtedly there is a better solution for this, but this is what I do when
I want to use specific icons.

make a screenshot of the desktop when the desired icon is visible.
Then paste it in mspaint, set the zoom to large, and then select and copy a
32x32 bit region.

Then, in a VS project, create a new icon resource and paste the copied
bitmap inside.
The use that in the project.

It may be a bit clunky, but it works.

--

Kind regards,
Bruno van Dooren
(e-mail address removed)
Remove only "_nos_pam"
 
C

Carl Daniel [VC++ MVP]

Bruno van Dooren said:
Undoubtedly there is a better solution for this, but this is what I do
when I want to use specific icons.

make a screenshot of the desktop when the desired icon is visible.
Then paste it in mspaint, set the zoom to large, and then select and copy
a 32x32 bit region.

Then, in a VS project, create a new icon resource and paste the copied
bitmap inside.
The use that in the project.

It may be a bit clunky, but it works.

But be aware that icons are generally subject to copyright laws, so if you
grab a screenshot of someone else's icon and use it in your program, you may
be crossing the line from a legal standpoint.

-cd
 

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

Top