On Mon, 20 Jul 2026 11:21:23 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).
>
> Matthias Baesken has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Remove m_listDefWindowProc

Changes requested by aivanov (Reviewer).

src/java.desktop/windows/native/libawt/windows/ComCtl32Util.h line 47:

> 45:         }
> 46: 
> 47:         WNDPROC SubclassHWND(HWND hwnd, WNDPROC _WindowProc);

Suggestion:

        void SubclassHWND(HWND hwnd, WNDPROC _WindowProc);

I suggest changing the return type of `SubclassHWND`. I already raised [this 
concern](https://github.com/openjdk/jdk/pull/31814#discussion_r3558368596), but 
now that the scope of the change has expanded, I think it's right to change the 
return type in this PR.

No return value will flag all the assignments of `SubclassHWND`, and we'll get 
a cleaner code.

src/java.desktop/windows/native/libawt/windows/awt_Choice.h line 1:

> 1: /*

Bump up the copyright year, for consistency.

src/java.desktop/windows/native/libawt/windows/awt_PrintDialog.cpp line 102:

> 100:             // subclass dialog's parent to receive additional messages
> 101:             WNDPROC lpfnWndProc = 
> ComCtl32Util::GetInstance().SubclassHWND(hdlg,
> 102:                                                                          
>   PrintDialogWndProc);

`lpfnWndProc` local variable is not needed.

src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp line 3241:

> 3239:             // subclass dialog's parent to receive additional messages
> 3240:             WNDPROC lpfnWndProc = 
> ComCtl32Util::GetInstance().SubclassHWND(hDlg,
> 3241:                                                                         
>    PageDialogWndProc);

`lpfnWndProc` is not needed.

-------------

PR Review: https://git.openjdk.org/jdk/pull/31814#pullrequestreview-4743172562
PR Review Comment: https://git.openjdk.org/jdk/pull/31814#discussion_r3621376623
PR Review Comment: https://git.openjdk.org/jdk/pull/31814#discussion_r3621026669
PR Review Comment: https://git.openjdk.org/jdk/pull/31814#discussion_r3621041626
PR Review Comment: https://git.openjdk.org/jdk/pull/31814#discussion_r3621054145

Reply via email to