<AWT Dev> RFR: 6422025: ThemeReader.cpp can be updated for VC7
aivanov at openjdk.java.net
Fri Nov 6 18:21:00 UTC 2020
On Fri, 6 Nov 2020 08:51:46 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
> Some of the type definitions have been imported from `UxTheme.h` to the `ThemeReader.cpp` because at that time we supported the windows OS below XP as well as VC6.
> It is time to use `UxTheme.h ` directly, note I did not change how we load this library(JDK_LoadSystemLibrary(), as suggested in the comments of the bug it is not necessary that the application will use the win L&F and it is not necessary to link it directly.
> mach5 is green
Changes requested by aivanov (Reviewer).
src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp line 126:
> 124: DTRACE_PRINTLN("Loaded UxTheme.dll\n");
> 125: OpenThemeDataFunc = (PFNOPENTHEMEDATA)GetProcAddress(hModThemes,
> 126: "OpenThemeData");
Can't we use the functions directly? I mean we can link to `UxTheme.lib` and load the `UxTheme.dll` automatically.
Dynamic loading was necessary for Windows versions before Windows XP where `UxTheme.dll` doesn't exist.
More information about the awt-dev