2

Is it possible to modify NotifyIcon behavior to AlwaysShow in C#? A code snippet would be greatly appreciated:) Thanks in advance...

Cheers

---edited

One of our clients said quote "it seems necessary to customise icons to always show". What he meant was that he has to do it manually by r-clicking on task bar then click on Properties -> Task Bar -> Customize Notifications and then you can set behavior to Always Show / Always Hide / Hide when inactive for each taskbar icon on the list.

Can you do that programically in C#?

I want to ensure that my NotifyIcon is ALWAYS visible. I'm already setting icon.Visible = true but it looks like it doesn't work for him hence the complaint.

Is there any easy way of setting the behavior by altering [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify] IconsStream registry value?

pRintLn
  • 139
  • 2
  • 8
  • what do you mean ? it *is* always shown, unless you set Visible to false... – Thomas Levesque Aug 10 '09 at 23:58
  • Do you mean setting it so it doesn't hide if the user doesn't click on it for a while? I don't think you can, or at least I hope applications can't, that would be quite annoying. – Ray Aug 11 '09 at 00:15
  • Did you get the Solution?? I'm currently facing the same problem. – Krishna Thota Sep 27 '12 at 07:54
  • This other topic provides a solution using a Powershell script https://stackoverflow.com/questions/7877435/set-tray-icon-to-always-show – L2M Sep 10 '21 at 05:49

2 Answers2

1
NotifyIcon icon = ...;
icon.Visible = true;

Edit for updated information: There shouldn't be, and if for some reason it exists, don't use it. That's the user's preference, not yours.

Sam Harwell
  • 97,721
  • 20
  • 209
  • 280
  • 2
    you made a valid point... that's what I originally said but I get a bit of pressure from my management to have it done otherwise the universe will collapse... – pRintLn Aug 11 '09 at 01:49
0

I'm sure it's possible with enough Registry hacking, but not at all recommended. They added the collapsing-notification-area behavior in XP because so many applications were shoving themselves in that space. Much like Start Menu pinning behavior in XP/Vista/7, the lack of a public API means you're supposed to let the user decide that sort of thing.

ChrisV
  • 3,363
  • 16
  • 19