mirror of
https://github.com/reactos/reactos.git
synced 2026-09-09 10:50:37 +08:00
CORE-20706 The `DF_END` flag is set when `EndDialog()` is invoked. When this is done in a dialog's `WM_INITDIALOG` handler, further processing is halted after the handler returns. This ensures in particular that the dialog isn't shown[^1], stays hidden, since it's going to be automatically destroyed next. - Add a `DF_END` check just after invoking the `WM_INITDIALOG` handler, and don't execute the focus-assignment code block if the flag is set. - Don't continue if the dialog has been forcefully destroyed (with a direct `DestroyWindow()` call) in `WM_INITDIALOG`. - Don't try to make the dialog visible if the `DF_END` flag has been set. - Add a TODO to remember we have to handle `DS_SETFOREGROUND`. [^1]: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enddialog#remarks > A dialog box procedure can call EndDialog at any time, even during the > processing of the WM_INITDIALOG message. If your application calls the > function while WM_INITDIALOG is being processed, the dialog box is > destroyed before it is shown and before the input focus is set.