11 Replies Latest reply on Aug 29, 2006 2:17 AM by AntiTRUST�

    window list

    farhanakhan Level 1
      hi
      my problem is that i want to get the window list in director
      means i want to know whihc applications are running and i want to get list of these running application window

      thx reply me fast
        • 1. Re: window list
          Lukewig Level 1
          Use BuddyAPI -- for example
          • 2. Re: window list
            farhanakhan Level 1
            thx for reply
            but this code is not working now i tried to apply this but the result is come ------invaild
            plz tell me what i do
            • 3. Re: window list
              Level 7
              Try again. That code works for me. I added a line to remove most of the
              redundancies. This will send a smaller list with not as many repeats.
              You can trim it down further if you want. I suggest you look through
              the BuddyAPI help file to see what the various window-related commands
              do. It is very powerful, and pretty easy to use.

              on GetWindows()
              wlist = baWindowList("","", false)
              repeat with aWindow in wList
              if baWindowInfo(aWindow,"title")="" then next repeat
              put baWindowInfo(aWindow, "app")
              end repeat
              end
              • 4. Re: window list
                farhanakhan Level 1
                ok i try to agian to apply this code but i m confuse with "awindow" & "app" whihc u used in the
                repeat with aWindow in wList
                if baWindowInfo(aWindow,"title")="" then next repeat
                put baWindowInfo(aWindow, "app")

                so tell me abou thte app and awindow
                i m waiting for the reply im very thankfull to u

                • 5. Re: window list
                  AntiTRUST�
                  Hi,
                  I did the same thing but i did in Flash by using Zinc. The code is in Javascript:

                  quote:


                  var listBan:Array = Array("notepad", "internet explorer", "temp", "app name");
                  var windowList:Array = mdm.System.getWindowList();
                  var msg:String = "";
                  var found:Boolean = false;


                  if (windowList.length>0) {
                  var current;
                  var currentTitle:Array;
                  for (var i:Number = 0; i<windowList.length; i++) {
                  current = windowList [0];
                  for (var j:Number = 0; j<listBan.length; j++) {
                  currentTitle = current.toString().toLowerCase();
                  if (currentTitle.indexOf(listBan[j].toLowerCase())>-1) {
                  found = true;
                  msg = "found: "+currentTitle+newline;
                  }
                  }
                  }
                  if (found == false) {
                  msg += "nothing found";
                  }
                  mdm.Dialogs.prompt(msg);
                  }



                  May it can help.

                  Regards,
                  Amir
                  • 6. Re: window list
                    Lukewig Level 1
                    Hi,

                    baWindowList("","", false) gives a list of 'handles' all the windows - it will look something like this:

                    [131073, 393217, 524289, 655361, ... etc]

                    The lingo "repeat with aWindow in wList" loops through this list and asigns each item in the list to the variable aWindow.

                    The window 'handle' that is stored in the variable "aWindow" is then used by another buddyAPI function like this

                    put baWindowInfo(aWindow, "app")

                    The second parameter "app" tells BuddyAPI what kind of information we want. Check the BuddyAPI help for the other parameters you can use.

                    If you are looking for a particular window, maybe you could use baFindWindow instead. For example:

                    put baFindWindow("", "Director MX")

                    or put baFindWindow("MD03", "") -- Macintosh 'creator' code; windows uses a 'class'

                    -- Luke
                    • 7. Re: window list
                      AntiTRUST� Level 1
                      Hi,
                      I also used the same thing with my director, but there is one thing if i use windowList in BuddyAPI but it gives me list of sooo many windows, even of those which are not running in my system! for example "Database Connection Error" []and "Acrobat Reader", etc...

                      And i double check of such windows, but never found any of it. Even i closed all of my running applications and windows but still showing soo many window ids.

                      Well, with this i used another Xtra with the same functionality, that is mcProFusion". And this xtra really gives me a proper list of running applications which are reallying running.

                      So, the problem is that i have already purchased BuddyAPI but not mxProFusion. So, any way around in BuddyAPI which can provide us list of only those applications which are presently running which a person can view.

                      Any idea ??


                      Regards,
                      Amir
                      • 8. Re: window list
                        AntiTRUST� Level 1
                        Hello Lukewig,
                        Also, one more thing that is i never found this APP in BuddyAPI Help and functions.

                        Is there is any version issue ??
                        I am using BuddyAPI 3.51
                        • 9. Re: window list
                          Lukewig Level 1
                          Hi,

                          >BuddyAPI but it gives me list of sooo many windows, even of those which
                          > are not running in my system!

                          Really? Have a look at your Task Manager (Windows) or Acitivity Viewer (Mac) to see all the running programs and processes (I'm not surprised to see Acrobat Reader showing up even when you think its not running).

                          > I am using BuddyAPI 3.51

                          The windows version is up to 3.7.3 or something like that -- maybe the "app" parameter is new than your version.

                          -- Luke
                          • 10. Re: window list
                            AntiTRUST� Level 1
                            Hi Lukewig,
                            You are right they must be opened some where in my system, but the list it gives me is too long. Here i am giving you what i write to get window list in BuddyAPI:


                            wlist = baWindowList("","", false)
                            put wlist

                            [395282, 395284, 4064222, 15598522, 4915774, 65688, 4129430, 65670, 196682, 131192, 65672, 196680, 196678, 393684, 196664, 3539406, 3998288, 5243462, 1835468, 918128, 1573928, 1115364, 3736526, 1639216, 1704724, 2425724, 9175970, 1639010, 65676, .............., 65674]


                            After getting this list i use the following code to get the window captions:


                            wlist = baWindowList("","", false)
                            put wlist
                            repeat with aWindow in wList
                            if baWindowInfo(aWindow,"title")="" then next repeat
                            put baWindowInfo(aWindow, "title")
                            end repeat


                            --Which gives me:


                            [65670, 131192, 196682, 65672, 196680, 196678, 393684, 196664, 395282, 395284, 4064222, 15598522, 4915774, 65688, 4129430, 3539406, 3998288, 5243462, 1835468, 918128, 1573928, 1115364, 3736526, 1639216, 1704724, 2425724, 9175970, 1639010, 65676, 1443022, ............, 65674]

                            --"SysFader"
                            -- "SysFader"
                            -- "SysFader"
                            -- "SysFader"
                            -- "list - Director MX 2004"
                            -- "Buddy API"
                            -- "Timer"
                            -- "Helix DSWnd"
                            -- "Messages.log - Notepad"
                            -- "Untitled - Notepad"
                            -- "CleanUp Application"
                            -- "CleanUp Application"
                            -- "screen-capturing"
                            -- "Acrobat IEHelper"
                            -- "Tooltips"
                            -- "Acrobat IEHelper"
                            -- "Acrobat IEHelper"
                            -- "DDE Server Window"
                            -- "CwndSessionMonitor"
                            -- "Acrobat IEHelper"
                            -- "__RNWK__DeviceEventNotification_WindowName_wmdm_device"
                            -- "HXEngineCommInternal"
                            -- "MessageBouncer"
                            -- "Acrobat IEHelper"
                            -- "Notification Wnd for RNAdmin"
                            -- "MSNUnnamedWindow"
                            -- "MSNUnnamedWindow"
                            -- "MSNUnnamedWindow"
                            -- "MSNUnnamedWindow"
                            -- "MSNUnnamedWindow"
                            -- "MSNUnnamedWindow"
                            -- "MSNMSGRAbsConnWindow"
                            -- "Download Accelerator Plus - DAP"
                            -- "Dummy Video Parent"
                            -- "MSNUnnamedWindow"
                            -- "MSNUnnamedWindow"
                            -- "MSNUnnamedWindow"
                            -- "MSNUnnamedWindow"
                            -- "MSNMSGRAbsConnWindow"
                            -- "MSNUnnamedWindow"
                            -- "MSNUnnamedWindow"
                            -- "DDE Server Window"
                            -- "MSNUnnamedWindow"
                            -- "MCI command handling window"
                            -- "NetscapeDispatchWnd"
                            -- "XPCOM:EventReceiver"
                            -- "ymsgr-tray-wnd"
                            -- "VPIPCLINK"
                            -- "Scan"
                            -- "SMax4PNP"
                            -- "SoundMax4"
                            -- "ccApp"
                            -- "Connections Tray"
                            -- "Dialog"
                            -- "DAPDownloadManager"
                            -- "Power Meter"
                            -- "Missing Virus Definitions"
                            -- "MS_WebcheckMonitor"
                            -- "Symantec AntiVirus"
                            -- "InterBase Server"
                            -- "InterBase Guardian"
                            -- "SysFader"
                            -- "Adobe - Lingo - Mozilla Firefox"
                            -- "Now Playing"
                            -- "RealPlayer: 01 - Chand Sifarish - ApniISP.Com"
                            -- "xtras"
                            -- "wndxtra"
                            -- "Program Manager"




                            You see, how long the list is and what if i now go to detect windows from my selected list, it off course will take a lot of memory resources.


                            Well, besides this i also give a try to mcProFusion to do the same:

                            profusion xtra result
                            program=mcWindowGetList()
                            put program


                            -- "list - Director MX 2004
                            Buddy API
                            Messages.log - Notepad
                            Untitled - Notepad
                            Buddy API Pricing - Microsoft Internet Explorer
                            Adobe - Lingo - Mozilla Firefox
                            RealPlayer: 01 - Chand Sifarish - ApniISP.Com
                            xtras
                            wndxtra
                            Program Manager
                            "



                            And this is giving me a short of only those windows which are presently running on a user system and which a user can see as well.

                            So, can you tell me any way to use this buddyAPI to get a short list of only viewable/presently running window's captions ??

                            Thanks a lot anyways.

                            Regards,
                            Amir
                            • 11. Re: window list
                              AntiTRUST� Level 1
                              OK Guys,
                              I found the solution, in BuddyAPI if you want only to get the visible list of windows running, then you should use this:

                              if baWindowInfo( aWindow, "state" ) = "hidden" then next repeat

                              Otherwise BuddyAPI wil show all the windows including HIDDEN ones.


                              Thanks to Garry :) And all others.
                              Amir