Change the method: "TCustomComPort.ShowSetupDialog"
into an function with eg. TModalResult as result type.
(offcourse the methode "EditComPort" needs to be
changed with this one.
In this way we can check if we need to store the
settings or not.
Another possibilty is to introduce a property wich can
tell if the settings are changed (and not saved).