When closing a notepad process im getting exception why is that?
<p>This is the code:</p>

<pre><code>private void processNotePad_Exited(object sender, EventArgs e)
        {
            this.Invoke((MethodInvoker)delegate
            {
                View_Log_File.Enabled = true;
            });
        }
</code></pre>

<p>In Form1 i have a menu i click on it and a new Form is opened there i have a button click wich open a log files(txt file) using notepad.exe 
If i first close the notepad then close the menu form it's all ok.
But if i first close the menu form and after it trying to close the notepad im getting an exception:</p>

<p>The exception error is: Invoke or BeginInvoke cannot be called on a control until the window handle has been created</p>

<pre><code>System.InvalidOperationException was unhandled
  HResult=-2146233079
  Message=Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
  Source=System.Windows.Forms
  StackTrace:
       at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
       at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
       at System.Windows.Forms.Control.Invoke(Delegate method)
       at mws.SettingsMenu.processNotePad_Exited(Object sender, EventArgs e) in D:\C-Sharp\Download File\Downloading-File-Project-Version-012\Downloading File\SettingsMenu.cs:line 148
       at System.Diagnostics.Process.OnExited()
       at System.Diagnostics.Process.RaiseOnExited()
       at System.Diagnostics.Process.CompletionCallback(Object context, Boolean wasSignaled)
       at System.Threading._ThreadPoolWaitOrTimerCallback.WaitOrTimerCallback_Context(Object state, Boolean timedOut)
       at System.Threading._ThreadPoolWaitOrTimerCallback.WaitOrTimerCallback_Context_f(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(Object state, Boolean timedOut)
  InnerException: 
</code></pre>

<p>How should i take care in this situation ? If the user first close the menu form and then the notepad it will throw this exception.</p>
