<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 2024-01-08 19:30, Davide Perini wrote:<br>
<blockquote type="cite" cite="mid:9ecd6e22-3eb1-489b-b166-652a2fd1bf22@dpsoftware.org">
Thanks for the Answer Aleksei,<br>
I have a lot of Windows apps that uses notifications without
problems.<br>
<br>
even a simple python program like this works correctly.<br>
<div style="background-color:#1e1f22;color:#bcbec4">
<pre style="font-family:'JetBrains Mono',monospace;font-size:9,8pt;"><span style="color:#cf8e6d;">from </span>win11toast <span style="color:#cf8e6d;">import </span>toast
toast(<span style="color:#6aab73;">'Hello'</span>, <span style="color:#6aab73;">'Click to run python script'</span>)</pre>
</div>
</blockquote>
<br>
Python could use newer WinRT APIs [6], in particular
ToastNotification class [7] which provide richer interface for the
toast notifications. The package name ‘toast’ hints it uses the
newer APIs.<br>
<br>
<blockquote type="cite" cite="mid:9ecd6e22-3eb1-489b-b166-652a2fd1bf22@dpsoftware.org">is
it possible that Microsoft changed the way how to create
Notifications in Windows 11 and Java still uses the way it worked
in Windows 7?<br>
</blockquote>
<br>
Perhaps, Microsoft changed how they handle notifications in Windows
11. In Windows 10, the notifications created with a Java app remain
in Action / Notification centre.<br>
<br>
Java uses Shell_NotifyIcon [8] function that has been available
since Windows 95.<br>
<br>
-- <br>
Regards,<br>
Alexey<br>
<br>
[6]
<a class="moz-txt-link-freetext" href="https://learn.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/">https://learn.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/</a><br>
[7]
<a class="moz-txt-link-freetext" href="https://learn.microsoft.com/en-us/uwp/api/windows.ui.notifications.toastnotification?view=winrt-22621">https://learn.microsoft.com/en-us/uwp/api/windows.ui.notifications.toastnotification?view=winrt-22621</a><br>
[8]
<a class="moz-txt-link-freetext" href="https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shell_notifyiconw">https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shell_notifyiconw</a><br>
<br>
<blockquote type="cite" cite="mid:9ecd6e22-3eb1-489b-b166-652a2fd1bf22@dpsoftware.org"> <br>
Thanks<br>
Davide<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">Il 08/01/2024 17:59, Aleksei Ivanov
ha scritto:<br>
</div>
<blockquote type="cite" cite="mid:b82b650e-63d0-4b61-af42-25b693d512a8@oracle.com">Hi
Davide, <br>
<br>
The bug that you reported has been moved to JDK project in JBS,
you can view it as JDK-8315647 [1]. You should've received a
link to it. <br>
<br>
<blockquote type="cite">Is there a way to workaround this JDK
bug? <br>
I opened a bug report months ago but no one answered. </blockquote>
<br>
What kind of answer did you expect to receive? <br>
<br>
You already asked this question on this mailing list in August
[2]. I replied to your question [3]. Nothing has changed since
August. It is not a bug in Java because a native Win32 app
behaves the same way. <br>
<br>
I compiled and tested the sample [4], it behaves in Windows 11
as Java does: the displayed balloon notification does not go to
notification centre. However, if I open notification centre
while the balloon is displayed, it remains there. If I disable
"Show notification banners" and leave "Show notifications in
notification centre" enabled, the balloon goes directly to
notification centre without displaying a banner. <br>
<br>
You can compile and test the sample too: <br>
<br>
git clone --filter=<a class="moz-txt-link-freetext" href="blob:none" moz-do-not-send="true">blob:none</a> --sparse
<a class="moz-txt-link-freetext" href="https://urldefense.com/v3/__https://github.com/microsoft/Windows-classic-samples.git__;!!ACWV5N9M2RV99hQ!NLmQsIei56bZm5IGVWA45k6g1Dduh_MFpShFK0TzjLM7OJHlH90je29IlZRa410GYcehUmNb21kyLplVv8fTzwWsci7s6yw2$" moz-do-not-send="true">https://github.com/microsoft/Windows-classic-samples.git</a>
windows-samples <br>
cd windows-samples <br>
git sparse-checkout add
Samples/Win7Samples/winui/shell/appshellintegration/NotificationIcon
<br>
<br>
Navigate to the NotificationIcon folder and open
NotificationIcon.sln in Visual Studio to compile and run it. <br>
<br>
If required, I can attach the compiled version of the
application. <br>
<br>
<br>
I have closed JDK-8315647 as duplicate of JDK-8310352 [5]. <br>
<br>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>