      */
     public function open(openWindowActive:Boolean = true):void
     {
+        // Event for Automation so we know when windows 
+        // are created or destroyed.
+        if (FlexGlobals.topLevelApplication)
+        {
+            FlexGlobals.topLevelApplication.dispatchEvent(
+                new WindowExistenceEvent(WindowExistenceEvent.WINDOW_CREATING, 
+                    false, false, this));
+        }
+        
         flagForOpen = true;
         openActive = openWindowActive;
         commitProperties();


    /**
     *  Creates the underlying NativeWindow and opens it.
     *
     *  @param  openWindowActive specifies whether the Window opens
     *  activated (that is, whether it has focus). The default value

        if (sm.isTopLevel())
        {
            focusManager = new FocusManager(this);
            var awm:IActiveWindowManager = 
                IActiveWindowManager(sm.getImplementation("mx.managers::IActiveWindowManager"));
            if (awm)
                   awm.activate(this);
            else
                focusManager.activate();

