I've written an application that wraps another in order to facilitate some
config and data file copying before and after the application runs.
i.e... User thinks they are running WinFax, but they are really launching
my wrapper. I then copy some files into place and launch the real WinFax.
No problems yet. I wait for WinFax to exit and then backup the changed
files to the network. All works well.
The problem comes in when the user doesn't close the app, but instead just
logs off. Then I get this:
..NET-BroadcastEventWindow.1.0.5000.0.3 etc.... And the user has the option
of ending the app...
While the system is waiting for my app to close, I'm waiting for WinFax to
close. (Process.WaitForExit(0)) It's a standoff - If WinFax is closed
while this error/dialog is on the screen the machine will then logiff, but
my copying code never runs.
How can I detect this situation in my code so I can close WinFax for them
and do my file copying before the logoff?
It's a windows app, but no UI. It appears that I have no close events to
respond to... Any thoughts are greatly appreciated.
Jerry