Actually, it would be better if RunDialog returned a modal result instead of a Boolean that could be signalled to an OnAfterDialog event.
Currently
procedure TDirectoryEdit.RunDialog;does not return anything but
TCommonDialog.Execute inside it return a Boolean.
A new
OnAfterDialog event could have a ModalResult parameter indeed. However
OnAcceptDirectory is still needed not to break existing code. Thus a new
OnCancelDialog event could suffice.
Something like in the attached patch.