Zhiyi Zhang (@zhiyi) commented about dlls/comctl32/tests/propsheet.c:
+ { + case WM_INITDIALOG: + hotkey_dialog = hwnd; + PostMessageW(hwnd, WM_DIALOG_LOADED, 0, 0); + break; + + case WM_DIALOG_LOADED: + SetEvent(hotkey_dialog_loaded); + return TRUE; + } + + return CallWindowProcW(old_hotkeys_dialog_proc, hwnd, msg, wparam, lparam); +} + + +static LRESULT CALLBACK hook_proc_hotkeys(int code, WPARAM wparam, LPARAM lparam) It seems to me that all this hooking is to get the dialog window handle and wait for it to be initialized. I think you can achieve the same thing with PROPSHEETHEADER.pfnCallback and wait for PSCB_INITIALIZED. See sheet_callback() in comctl32/tests/propsheet.c for example.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/5761#note_73046