title: FolderBrowserDialog - Win32Exception occurred - The parameter is incorrect
body: <p>I try to use the FolderBrowserDialog from WPF like this:</p>
  
  <pre><code>public static bool BrowseFolder(out string folderName)
  {
     using (System.Windows.Forms.FolderBrowserDialog dlg = new System.Windows.Forms.FolderBrowserDialog())
     {
          var result = dlg.ShowDialog();
          folderName = dlg.SelectedPath;
          return result == System.Windows.Forms.DialogResult.OK;
     }
  }
  </code></pre>
  
  <p>When using "break on exception" in Visual Studio 2010 I get an Exception after closing the Dialog in the ShowDialog() call. I'm curious why this occurs. </p>
  
  <p>Exception: Win32Exception<br>
  Message: The parameter is incorrect<br>
  Stacktrace:  at MS.Win32.UnsafeNativeMethods.SetFocus(HandleRef hWnd)</p>
  
  <p><strong>Update</strong><br>
  I also tried to set the parent explicitly, but the exception was thrown nonetheless.</p>
  
  <pre><code>var w = new System.Windows.Interop.WindowInteropHelper(parent);
  System.Windows.Forms.IWin32Window i = new WindowWrapper(w.Handle);
  result = dlg.ShowDialog(i);
  </code></pre>