TrayIcon with GUID

Zexor

Well-known member
Joined
Nov 28, 2008
Messages
520
Programming Experience
3-5
How do i create a trayicon with GUID so it stay the same after an update?
 
What exactly do you mean?
You want your form to have a NotifyIcon display? Or do you need the icon to be there without a form being present at all?
 
In windows 7 and 8 , you can set the notification area to hide all icons but the ones you set to Show. After a ClickOnce update, the tray icon will be hidden again since the ClickOnce app will be like a new app with a different GUID. With NotifyIcon, i cant set the GUID for the icon. So i want to create the TrayIcon without using notifyIcon, and set the GUID to be the same even after an Update.
 
I think i got the icon to show but how do you set the GUID? I have the Dim guidItem as Guid. But how do you set a value to a Guid type?
 
Last edited:
also how do you handle mouse click and contextmenu for it? Also i tried to set the tooltip text with szTip, but it only showed the first char.
 
Last edited:
I recommend you download Reflector .Net and read the code for the managed NotifyIcon class, you can read it in VB language. It has everything the standard component has, using the same native methods that you must do, except the ability to set the new Guid item. You have to be pretty good with understanding the native calls however to get anywhere, and based on your previous input here on the forums I thinks this is too difficult for you.
 
Ok. Even after i set the same Guid to the icon, the tray area still seems to treat it as a new icon after an update. Does the Guid need to be set for the application? And what is Reflector .Net?
 
still seems to treat it as a new icon after an update.
Depends on what you mean by "update". All you need in order to test this is to run the app in debug, change its version, and run it in debug again.
If you mean update by deployment, it also depends on how you do that. ClickOnce for example is a no-go, ClickOnce puts each publish version in a version dependent path, so that can not meet the same path+guid requirement.
 
oh thats why its not working. I am using ClickOnce. So is there no way to do it for ClickOnce app?
 
oh thats why its not working. I am using ClickOnce. So is there no way to do it for ClickOnce app?
My guess would be probably not, that being said there are alternatived, like Inno which is free and what I prefer for application deployment.
 
Can Inno update? I use ClickOnce because i can just My.Application.Deployment.Update() without doing another installation.
 
Back
Top