fix(NotifyIcon): Allow changing tray icon source#409
Merged
pomianowski merged 1 commit intolepoco:developmentfrom Oct 7, 2022
Merged
fix(NotifyIcon): Allow changing tray icon source#409pomianowski merged 1 commit intolepoco:developmentfrom
pomianowski merged 1 commit intolepoco:developmentfrom
Conversation
- Properly set `_notifyIconService.Icon` from `OnIconChanged` handler in `NotifyIcon`. - Adds a new `ModifyIcon` function to `INotifyIcon`. Internally, this functions calls the Win32 `Shell_NotifyIcon` with the first argument being `NIM_MODIFY`. - Edits the `Hicon.FromSource` to allow converting the more general `BitmapSource` class to a `Hicon`.
a18cad2 to
b9d347d
Compare
pomianowski
approved these changes
Oct 7, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_notifyIconService.IconfromOnIconChangedhandler inNotifyIcon.ModifyIconfunction toINotifyIcon. Internally, this functions calls the Win32Shell_NotifyIconwith the first argument beingNIM_MODIFY.Hicon.FromSourceto allow converting the more generalBitmapSourceclass to aHicon.Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: See #408
What is the new behavior?
The tray icon changes properly if the
Iconproperty ofNotifyIconis set to a validBitmapSource.Other information
Should fix #408
The PR adds a new function to
INotifyIconandTrayManagerto expose the Win32 functionality of modifying a ShellIcon.The PR does not modify any public API and/or UI controls.