title: Setting UIaccess altering behavior of ShowDialog
body: <p>I have a login prompt as part of a WPF application - when the user enters an incorrect password, a new modal dialog window appears informing them that their password is incorrect.</p>
  <p>This modal dialog is launched via <code>ShowDialog()</code>, and behaves as expected - the dialog launches successfully, appears in front of the login prompt that spawned it (I've verified in the debugger that <code>Owner</code> is being set correctly to the login prompt), and the user can't click back to the login dialog until the warning message is addressed.</p>
  <p>As part of an external requirement, we have an alternate launcher executable that sets the UIaccess attribute in the manifest file to <code>true</code>. I personally dislike this behavior, but due to business requirements, it cannot be removed. Other than the manifest file difference, the regular launcher and this alternate version run the exact same code, the same dlls, etc.</p>
  <p>Here's the issue: on this UIaccess version, when the user enters the wrong password, the dialog warning of invalid credentials shows up <em>behind</em> the login dialog box. Then the user is unable to interact with any part of the application, because the code is still waiting for <code>ShowDialog()</code> to resolve, and the login dialog window is disabled until the user closes the warning prompt (hidden behind the login dialog - inaccessible).</p>
  <p>While we were able to resolve this issue by adding a check to the constructor of the modal dialog box that looks like this (the login dialog is always set to <code>Topmost=true</code>, this condition ensures that other dialog boxes of the same type aren't necessarily <code>Topmost</code>):</p>
  <pre><code>if (owner != null &amp;&amp; owner.Topmost)
      Topmost = true;
  </code></pre>
  <p>We're still noticing some behavior that is different between the two versions, but only in the way this login dialog and its modal prompt are displayed - now the modal window appears on top as desired, but the user can click the login dialog and it will move up to the top, though it's still disabled.</p>
  <p>The root of the question is: why does the UIAccess attribute change the behavior of <code>ShowDialog()</code> in this way? If both the dialog and the modal window are in the same thread, why should their relative positions be changed by setting UIAccess for the whole application?</p>