Change app icon in Windows System tray

Hello everyone

I can’t find a way to change the standard icon in the Windows System tray of my app…
Is there anyone here who can please help me?

The code I use to add my app to the System tray is:

dim Tray As AppTrayItem Tray = New AppTrayItem If Not Self.AddTrayItem(Tray) Then // There was an error adding the TrayItem End If

Is there a way to just use the standard icon I’ve set in de app in the System tray?

Thanks in advance!

http://documentation.xojo.com/index.php/TrayItem

Click “Icon”.

Thanks Michel, but I don’t see how I can set the icon to e.g. the icon I’ve already set for my app…
I’m sorry for the perhaps stupid question…

You’ll need to put a smaller version into your app as a picture. I believe it is 16x16.

I have the same problem I think.

I added all the sizes for the icon, the icons display everywhere correctly, except the tray icon.
The Tray icon is just a generic white rectangle with the green square. Like the one in the ide on a new window in a new project.

Thanks

Tim

In my case I have exact the same issue as Tim Kearns.

@Tim: Did you find a solution and would you share that?
@ others: Do you know how to change the icon?

If you are indeed talking about System tray, we are talking about the small icons on the right of the taskbar. The link to the LR explains how to do it.

Tray = New AppTrayItem Tray.Icon = myIcon If Not Self.AddTrayItem(Tray) Then // There was an error adding the TrayItem End If

If you are talking about the regular windows taskbar icons that show on the left, it will require declares. See http://stackoverflow.com/questions/16472538/changing-taskbar-icon-programatically-win32-c for a discussion about the code involved.

I tried again to make sure. No need to create a class, as described in the LR :

Create an app property Tray as TrayItem

Tray = New TrayItem Tray.icon = icon16 If Not Self.AddTrayItem(Tray) Then // There was an error adding the TrayItem End If

Icon16 is a 16x16 png picture dragged into the project.

As far as the taskbar icon is concerned, the app icon set in the app icon editor shows as expected.

Are the apps being compiled perhaps 64-bit (see <https://xojo.com/issue/39136>)?

A 64 bit compiled app will correctly show the tray icon with the code I posted, but indeed, the windows won’t have an icon, because 64 bit Windows builds simply do not support app icon at all.

For a regular taskbar icon, this may do the trick. At first glance, it seems fairly easy to port to Xojo.
http://stackoverflow.com/questions/5748968/cannot-change-excel-icon-in-taskbar-with-vba