On Tue, 7 Jul 2026 14:19:14 GMT, Matthias Baesken <[email protected]> wrote:
> [JDK-8387298](https://bugs.openjdk.org/browse/JDK-8387298) removed the > IS_WINXP macro, and the updated code in ComCtl32Util::UnsubclassHWND and > ComCtl32Util::DefWindowProc doesn't use the _DefWindowProc parameter any more. > > Thus, the _DefWindowProc parameter can be removed from these functions. > > Removing these parameters requires updating all the usages of the functions, > for example, in awt_Component.cpp, awt_Choice.cpp... > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). Changes requested by aivanov (Reviewer). src/java.desktop/windows/native/libawt/windows/ComCtl32Util.h line 1: > 1: /* Bump the copyright year. src/java.desktop/windows/native/libawt/windows/ComCtl32Util.h line 50: > 48: // DefWindowProc is the same as returned from SubclassHWND > 49: void UnsubclassHWND(HWND hwnd, WNDPROC _WindowProc); > 50: // DefWindowProc is the same as returned from SubclassHWND or NULL The comment is now irrelevant. src/java.desktop/windows/native/libawt/windows/awt_FileDialog.cpp line 1: > 1: /* Bump the copyright year? src/java.desktop/windows/native/libawt/windows/awt_FileDialog.cpp line 115: > 113: } > 114: > 115: WNDPROC lpfnWndProc = (WNDPROC)(::GetProp(hWnd, > NativeDialogWndProcProp)); The corresponding `::SetProp` at line 157 should also be removed. https://github.com/openjdk/jdk/blob/978dfecb6545166aee93a8e68c9c82535b0cb3e2/src/java.desktop/windows/native/libawt/windows/awt_FileDialog.cpp#L155-L157 Also, `::RemoveProp` for `NativeDialogWndProcProp` is to be removed: https://github.com/openjdk/jdk/blob/978dfecb6545166aee93a8e68c9c82535b0cb3e2/src/java.desktop/windows/native/libawt/windows/awt_FileDialog.cpp#L175 --- `SubclassHWND` always returns `NULL`. https://github.com/openjdk/jdk/blob/978dfecb6545166aee93a8e68c9c82535b0cb3e2/src/java.desktop/windows/native/libawt/windows/ComCtl32Util.cpp#L44-L47 Removing the return value from `SubclassHWND` is a candidate for another cleanup? Or it could be included in this PR. src/java.desktop/windows/native/libawt/windows/awt_PrintDialog.cpp line 1: > 1: /* Bump the copyright year. src/java.desktop/windows/native/libawt/windows/awt_PrintDialog.cpp line 67: > 65: } > 66: } > 67: return ComCtl32Util::GetInstance().DefWindowProc(hWnd, message, > wParam, lParam); `::SetProp` and `::RemoveProp` for `NativeDialogWndProcProp` are to be removed. src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp line 3208: > 3206: > 3207: WNDPROC lpfnWndProc = (WNDPROC)(::GetProp(hWnd, > NativeDialogWndProcProp)); > 3208: return ComCtl32Util::GetInstance().DefWindowProc(hWnd, message, > wParam, lParam); Remove `::GetProp`, `::SetProp` and `::RemoveProp` for `NativeDialogWndProcProp`. ------------- PR Review: https://git.openjdk.org/jdk/pull/31814#pullrequestreview-4670765305 PR Review Comment: https://git.openjdk.org/jdk/pull/31814#discussion_r3558440657 PR Review Comment: https://git.openjdk.org/jdk/pull/31814#discussion_r3558436517 PR Review Comment: https://git.openjdk.org/jdk/pull/31814#discussion_r3558328181 PR Review Comment: https://git.openjdk.org/jdk/pull/31814#discussion_r3558368596 PR Review Comment: https://git.openjdk.org/jdk/pull/31814#discussion_r3558419431 PR Review Comment: https://git.openjdk.org/jdk/pull/31814#discussion_r3558422283 PR Review Comment: https://git.openjdk.org/jdk/pull/31814#discussion_r3558431493
