Unregistering tray icon does not work
@pomianowski is already working on this.
Since Jun 20, 2022.
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Calling Unregister on NotifyIcon has no effect.
To Reproduce
Steps to reproduce the behavior:
- Call
Unregister - Icon does not disappear from tray menu.
Expected behavior
Tray icon should go away.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Windows 11
- .NET: .net6
- Version: 2.0.1
Additional context
Looking at the code, ShellIconData is not assigned in public static bool Register(Controls.NotifyIcon notifyIcon, HwndSource parentSource) which is in TrayManager line 47. Looking at the code we should assign the shellIconData returned from interop call back to notifyIcon.ShellIconData.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.