Can't get a form to display on Hidden Desktop

Help
mikev
2004-08-01
2013-04-24
  • mikev

    mikev - 2004-08-01

    I'm trying to run an nunitforms test directly instead of through nunit but I can't get the form to display on the hiddendesktop.  Instead its always visible.  I haven't overridden UseHidden or DisplayHidden, I can see that the Hidden desktop is being created when I call Init().  I create an instance of the form after calling Init().  Is there some other magic needed to get the form onto the HiddenDesktop?

     
    • mikev

      mikev - 2004-08-01

      In Desktop the call to SetThreadDesktop is returning zero.  When I print the error by changing it to:

      if (Win32.SetThreadDesktop( handle ).Equals(0))
         throw new Win32Exception();

      It says: 'The requested resource is in use'.  I'm running this as a console application and there have been no other forms opened.  Maybe some of my earlier crashes are leaving hidden desktops open?

       
    • Luke Maxon

      Luke Maxon - 2004-08-02

      Is there a [STAThread] attribute on your main method?  That will not work with hidden desktop.

       
  • Gaines Kergosien

    I'm also having trouble getting my tests to run in a hidden desktop. I don't know if it has to do with the fact that I'm using Resharper, but when I check the UseHidden property it says false. I tried overriding it to return true, but even though it now says true my tests are still not running hidden.

     

Log in to post a comment.