TheCodeArtist / Active-Window-Logger

Smartly log the active foreground window of the system to transparently capture usage analytics.
25 stars 2 forks source link

Exception triggerred by getProcessName() #15

Closed TheCodeArtist closed 8 years ago

TheCodeArtist commented 8 years ago

If the active window/process closes just as it is being queried using getprocessname(), the following runtime exception is triggered:

Process has exited, so the requested information is not available"

left unhandled, the system (.net runtime?) displays the continue/stop dialog box with the details of the above exception.

Handle this exception properly in code (in tmrPoll tick) instead of allowing the system to show the continue/stop dialog box.