Thanks.Then it is related to the O/S.. BTW, I have found the solution. Don't display the dialog inside the OnExit event, but show it after the event is finished with the help of Application.QueueAsyncCall