5 Replies Latest reply on Aug 11, 2008 2:55 PM by Liberato125

    Don't display taskbar button and save current position on screen?

    Liberato125
      Does anyone know how I can remove the taskbar button (main window)? I tried this but it doesn't work:
      quote:

      var windowInitOpts = new air.NativeWindowInitOptions();
      windowInitOpts.type = air.NativeWindowType.LIGHTWEIGHT;


      Also, is there a way to detect where the app is located on screen and save/restore that for the next time it's launched?

      Thanks in advance,
      Stefan

      PS: I've made it in HTML/Javascript.
        • 1. Re: Don't display taskbar button and save current position on screen?
          anirudhs Level 2
          Hi,

          Your main window cannot be of type lightweight. Let your main window be invisible, launch a lightweight window from there on applicationComplete. Note that windowInitOpts.systemChrome must be none as well.

          window.stage.nativeWindow.x and window.stage.nativeWindow.y will give you the window coordinates. Save and set it to those values on startup.

          • 2. Re: Don't display taskbar button and save current position on screen?
            Liberato125 Level 1
            Thank you for the reply. I got the window position working now, but I can't seem to figure out how to open a new window and point it to a other html file. I currently have:

            quote:

            var options:NativeWindowInitOptions = new NativeWindowInitOptions();
            options.systemChrome = NativeWindowSystemChrome.LIGHTWEIGHT;
            options.transparent = false;
            options.resizable = false;
            options.maximizable = false;
            options.minimizable = true;
            var newWin:NativeWindow = new NativeWindow(options);


            How can I let it open a the applications' html file?

            Thanks,
            Stefan
            • 3. Re: Don't display taskbar button and save current position on screen?
              Admiral_Brodnack Level 1
              If you are creating an HTML window, use HTMLLoader.createRootWindow() which creates a window with an HTMLLoader object. (See docs at http://help.adobe.com/en_US/AIR/1.1/jslr/). Use the load() function of the HTMLLoader object to load your html file:

              options = new NativeWindowInitOptions();
              //... set your options

              html = HTMLLoader.createRootWindow(true, options);
              html.load(new URLRequest("url"));
              • 4. Don't display taskbar button and save current position on screen?
                Liberato125 Level 1
                I've tried it like this on the main page:

                <script type="text/javascript" src="AIRAliases.js"></script>
                <script type="text/javascript" src="AIRIntrospector.js"></script>
                <script type="text/javascript">
                var windowInitOpts = new air.NativeWindowInitOptions();
                windowInitOpts.systemChrome = air.NativeWindowSystemChrome.NONE;
                windowInitOpts.type = air.NativeWindowType.LIGHTWEIGHT;
                windowInitOpts.transparent = true;
                windowInitOpts.resizable = false;
                windowInitOpts.maximizable = false;
                windowInitOpts.minimizable = true;
                var bounds = new air.Rectangle(10, 10, 900, 800);
                var html = air.HTMLLoader.createRootWindow(true, windowInitOpts, true, bounds);
                html.load(new air.URLRequest("athena.html"));
                </script>

                And this in my application.xml:

                <initialWindow>
                <content>index.html</content>
                <height>800</height>
                <width>900</width>
                <x>0</x>
                <y>0</y>
                <systemChrome>none</systemChrome>
                <transparent>true</transparent>
                <visible>false</visible>
                <minimizable>false</minimizable>
                <maximizable>false</maximizable>
                <resizable>false</resizable>
                </initialWindow>

                But it still displays the taskbar button for the main window. The new window works now (without taskbar button).
                • 5. Re: Don't display taskbar button and save current position on screen?
                  Liberato125 Level 1
                  I finally got it working, but now I've got another problem (last one): when minimizing the second winfow, it shows a small transparant window in the bottom left on the screen with scrollbars. I think this is the second window which is resized and for some reason shows scrollbars. Does anyone know how I can fix this or how to hide it?

                  Thanks
                  Stefan

                  PS: I used the code from http://help.adobe.com/en_US/AIR/1.1/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7dcc. html