How to detect BrowserWindow Existence RRS feed

  • Question

  • Hi All

    How do I detect if there's a browser already running?

    At the moment I'm having to do a try catch fudge to work around but surely there must be a more succinct way.

    BrowserWindow BWindow = new BrowserWindow();//new System.Uri("http://About.blank"));
          // Tell it its going to use internet explorer
          BWindow.SearchProperties[UITestControl.PropertyNames.ClassName] = "IEFrame";
          // Launch it if its not already there
            if (BWindow.Exists == true)
              status = status;
            BWindow = BrowserWindow.Launch(new System.Uri("http://About.blank"));


    Any Ideas?

    Tuesday, May 17, 2011 10:36 AM


All replies