 import mx.core.windowClasses.StatusBar;
 import mx.core.windowClasses.TitleBar;
 import mx.events.AIREvent;
+import mx.events.EffectEvent;
 import mx.events.FlexEvent;
 import mx.events.FlexNativeWindowBoundsEvent;
 import mx.managers.DragManager;

     */
    private function windowMaximizeHandler(event:Event):void
    {
        removeEventListener("effectEnd", windowMaximizeHandler);
        if (!nativeWindow.closed)
            stage.nativeWindow.maximize();
    }

        // After here, afterState is normal
        else if (event.beforeDisplayState == NativeWindowDisplayState.MINIMIZED)
        {
            addEventListener(EffectEvent.EFFECT_END, windowUnminimizeHandler);
            dispatchEvent(new Event("windowUnminimize"));
        }
    }
