Reputation: 5377
I have a procedure that ultimately formats an email message and sends the info to the user's default email client. I minimize my application just before this happens.
After the user clicks the 'send' button on his or her email client, I'd like my application to restore itself--but not before. A simple Application.Restore doesn't do it because my app will be restored before the user has clicked his or her email 'send' button (closing the mail app's form). In other words, Application.Restore restores the main form on top of the email client, before the user has sent an email message.
Upvotes: 0
Views: 342
Reputation: 473
For this to work you need to at least know which window to monitor. Increasing numbers of people now use webmail rather than an email opplication, to the point where invoking the computer's email application by default causes more confusion than it's worth. And then there's the plethora of possible email clients, not to mention the possibility that the user may already be composing an email message when your function runs.
I suggest you consider one of the following alternatives.
With both [1] and [2] you'll know when the message has been sent, and also whether sending was successful. With [3] it won't matter.
Upvotes: 1