On 17/07/2026 15:23, Matthias Baesken wrote:
On Thu, 16 Jul 2026 12:11:48 GMT, Matthias Baesken<[email protected]> wrote:
There is some handling for ancient Windows versions in AwtTrayIcon::InitNID
which most likely can be removed.
---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK
Interim AI Policy](https://openjdk.org/legal/ai).
I tested on Windows server 2016 and there the shellVersion is also 10.0 .
Unfortunately I have no older Windows like Win7/8 at hand to test.
-------------
PR Comment:https://git.openjdk.org/jdk/pull/31930#issuecomment-5004233177
The shell version for Windows 7 is 6.1. The removed (existing) code uses only the major version, which is 6. This means the proposed change is incompatible with
Windows 7, which is a problem for users of my application.
This isn't clear from the existing code because the comments are wrong. According to the comments, case 6 is WIN_XP and the default case is WIN_VISTA. In fact,
the shell major version 6 applies to Windows XP, Windows VIsta and Windows 7, so all of these will be broken by the change.
The following code should be OK for all versions from Windows XP onwards,
including Windows 7.
! switch (shellVersion) { ! case 6: // WIN_XP, WIN_VISTA, WIN_7 ! m_nid.cbSize = (BYTE *)(&m_nid.hBalloonIcon) - (BYTE *)(&m_nid.cbSize); ! break; ! default: //
WIN_8 and later ! m_nid.cbSize = sizeof(m_nid); ! break; ! }
Thanks, Simon