>>26

if Screen.ActiveForm.ClassName = 'TMessageForm' then
Screen.ActiveForm.Close;