2 Replies Latest reply on Sep 18, 2012 5:45 AM by SNO

    How to close external programs automatically using buddy api

    SNO

      Hi,

      I’m using Buddy API for an interface from which I call other windows like Flashplayer or a Webbrowser. When there’s no user interaction for a while, I want for example the Flashplayer (if actually open) to be closed automatically and the interface to be shown again. My problem is, that the windows (for flashplayer or the internet browser), which I call by button out of my director interface (using baOpenFile) aren’t handled like external windows (as f. e. calculator or notepad). Have any one an idea, why the following frame script in the director timeline does only work with windows, that aren’t called by buttons out of director? The second problem is, that it doesn't work at all under Windows 7  (even the external windows like calculator, that close automatically with my script below under XP).

       

      global gCounter

       

      on exitFrame me

       

        go to the frame

        --- Abfrage, ob etwas anderes als Hauptmenu im Vordergrund:

        if (baActiveWindow() <> baWinHandle()) then

          if the milliseconds - gCounter > 7000 then

      -- Fenster schließen, wenn länger als 7 Sekunden keine Eingabe erfolgt ist:

      put "schließen"

      baCloseWindow(baActiveWindow())

       

          end if

        end if

      end

       

      Thank you for any idea!

      Steffi

        • 1. Re: How to close external programs automatically using buddy api
          Dean Utian Adobe Community Professional

          Hi Steffi,
          I just asked in your other message to this forum exactly what you were after. I have the answer here. Using Buddy API, you can use Director to trigger other applications. However, those applications don't send any communication back to Director. So, won't be possble for Director to shut down say a web browser if no clicking within that browser has been occuring for a certain time.

          Dean

          • 2. Re: How to close external programs automatically using buddy api
            SNO Level 1

            Hi Dean,

             

            thank you for your answer! I think so too that it's not possible. To solve my problem, I've thought that it's a solution to use baSetScreenSaver. When the screensaver is stopped, I want to return to the menu/director, even when another window/application was open before the screensaver started. Below is my approach (but it doesn't work reliable). Have you got an idea, what's the fault?

             

            Steffi

             

            --- (in the start movie-Handler, the Screensaver is called:

            ---  OldSS = baSetScreenSaver( "C:\WINDOWS\wellwasser® bluescreen.scr" )

            ---  OldTime = baScreenSaverTime( 10 )

             

            on exitFrame me

             

             

              ssHandle = baFindWindow( "" , "WellwasserBluescreen" )

              baWaitForWindow( ssHandle , "active" , 0 )

              if baWindowExists( ssHandle )then

                WinHandle = baFindWindow( "" , "Adobe Acrobat Professional - [titel.pdf]" )

                if baWindowExists(WinHandle) then

                    baCloseWindow(WinHandle) -- close Acrobat

                end if

             

              end if

             

             

              go to the frame

            end