I have a lengthy process that I can't run asynchronously, so just like Explorer when you're copying files, I have a progress dialog. I show the dialog modally, then perform the operations (we'll call it copying files to keep it abstract), update the progress dialog, and pump messages with Application.DoEvents() to keep the application main frame painting and responsive.
Since the dialog is modal, the user isn't able to do anything other than watch or cancel. In other words, they can't select a menu item or click any buttons.
I've always believed Application.DoEvents to be extremely evil, because you could re-enter code you didn't intend to be re-entrant. But in this case, since the progress dialog is modal, I can't see a reason why this is a bad or dangerous solution.
Am I overlooking something, or is pumping messages with Application.DoEvents a legitimate thing to do with a modal dialog up?