Probably the timer creates a separate thread, so it is not in a dialog event any more.