lepoco / lepoco/wpfui

Unregistering tray icon does not work

Open
#240 1 comment 0 reactions 1 assignee View on GitHub

@pomianowski is already working on this.

Since Jun 20, 2022.

bug controls
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:

  1. Call Unregister
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.