microsoft / microsoft/windows-rs

`windows-notifyicon`: Add ability to provide HICON manually

Open
#4,973 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
12.8k
Forks
665
Avg merge
7h 9m
Merged PRs (30d)
70

Description

NotifyIcon appears to require an icon file on disk. I'd like to instead handle that part and hand NotifyIcon a handle to an icon I've loaded via other means. This handle may also be shared (see LR_SHARED) and not Owned, so should not be destroyed.

For example, I may want to call `LoadLibraryEx(... | LOAD_LIBRARY_AS_IMAGE_RESOURCE)` > `LoadIconWithScaleDown` > `HICON` and perhaps `NotifyIcon::new(icon_handle)...`.

Contributor guide

Open the contributing guide

Research direction

Start by locating the windows-notifyicon entry point and the NotifyIcon::new API that currently accepts an icon file. Trace how the HICON is stored and released, including the shared-handle case described with LR_SHARED. Done means callers can provide an HICON directly without NotifyIcon destroying a handle it does not own.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.