Skip to content

Send notifications even when we're unpackaged - #20013

Merged
Carlos Zamora (carlos-zamora) merged 2 commits into
dev/cazamor/toast/basefrom
dev/cazamor/toast/unpackaged
Mar 25, 2026
Merged

Carlos Zamora (carlos-zamora) merged 2 commits into
dev/cazamor/toast/basefrom
dev/cazamor/toast/unpackaged

Conversation

@carlos-zamora

Copy link
Copy Markdown

Summary of the Pull Request

Targets #20010

Manually assign an AUMID to our process when we're running unpackaged.
Main difference from #19937 is what AUMID we use. Before, it was per branding, but the WindowEmperor already appends an exe path hash for unpackaged instances to prevent crosstalk. Here, we're just using the same pattern: Microsoft.WindowsTerminal.<hash>.

Heavily based on #19937
Co-authored by Mike Griese (@zadjii-msft)

// and toast notifications may not be supported without additional setup.
auto notifier = ToastNotificationManager::CreateToastNotifier();
notifier.Show(toast);
// For unpackaged apps, we must pass the explicit AUMID that was registered

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you make the other block a separate PR to main, you can fold this one into #20010

Comment on lines +117 to +118
if (notifier)
{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do those WinRT (?) functions really return null instead of throwing an HRESULT?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if CreateToastNotifier() can return null, but I have trust issues haha.

It's more there for when this fails...

if (SUCCEEDED(GetCurrentProcessExplicitAppUserModelID(&aumid)))

@carlos-zamora

Copy link
Copy Markdown
Author

PR has been updated to move the WindowEmperor changes (unpackaged AUMID) into a separate PR targettng main.

Merging this PR into #20010 as Dustin suggested here: #20013 (comment)

@carlos-zamora
Carlos Zamora (carlos-zamora) merged commit 9df166e into dev/cazamor/toast/base Mar 25, 2026
12 checks passed
@carlos-zamora
Carlos Zamora (carlos-zamora) deleted the dev/cazamor/toast/unpackaged branch March 25, 2026 20:27
Carlos Zamora (carlos-zamora) pushed a commit that referenced this pull request Mar 27, 2026
## Summary of the Pull Request
Does what it says on the tin. Sets the AUMID to
`WindowsTerminal.<hash>` with a slightly different prefix
based on the branding. The hash is based on the full process image name.

Extracted from #20013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants