Find if a window is open.

Author Message
cshiers

  • Total Posts : 27
  • Scores: 0
  • Reward points : 0
  • Joined: 4/28/2005
  • Location:
  • Status: offline
Find if a window is open. Friday, May 13, 2005 4:44 AM (permalink)
0
I am trying to find out if a window is running. Dow the FindWindow function work in VBscript?

If not, how can I find if a window is running using VB script?
 
#1
    didorno

    • Total Posts : 361
    • Scores: 0
    • Reward points : 0
    • Joined: 2/12/2005
    • Location:
    • Status: offline
    Re: Find if a window is open. Friday, May 13, 2005 6:38 AM (permalink)
    0
    Better en more window commands can be found in a 3rd party tool :
    "AutoIt". I use, with success, version V3.0.102.
    It is very easy to use and you can manage a lot of things with
    windows which you can't do with vbs.
    Search with Google, I should say.

    Good luck !
     
    #2
      Fredledingue

      • Total Posts : 572
      • Scores: 2
      • Reward points : 0
      • Joined: 5/9/2005
      • Location: Europe
      • Status: offline
      Re: Find if a window is open. Friday, May 13, 2005 9:09 AM (permalink)
      0
      yes, AutiItX3 is a DLL that add all these function to VBS script. A must have, but the DLL must be installed and registered (regsrv32) on the computer before using the script.


      http://www.autoitscript.com/autoit3/downloads.php
       
      #3
        cshiers

        • Total Posts : 27
        • Scores: 0
        • Reward points : 0
        • Joined: 4/28/2005
        • Location:
        • Status: offline
        Re: Find if a window is open. Monday, May 16, 2005 4:09 AM (permalink)
        0
        Thanks for all the help, however I found a way to do it with just Windows Script. The AppActivate method returns a boolean value if the application if running. Here is the code to check if an app is running.

        --

        Set WshShell = WScript.CreateObject("WScript.Shell")

        a = WshShell.AppActivate("Application Title") 'this will still give focus to the application
        if a = true then
        msgbox "Application is running"
        else
        msgbox "Application is not running"
        End if
         
        #4
          didorno

          • Total Posts : 361
          • Scores: 0
          • Reward points : 0
          • Joined: 2/12/2005
          • Location:
          • Status: offline
          Re: Find if a window is open. Monday, May 16, 2005 8:55 AM (permalink)
          0
          In the beginning I tried to find all scripting solutions within VBScript,
          so without 3rd party software. But, I found that the VBScript window
          manipulation was not always reliable, leading to sometimes "surprising"
          results, especially in case of using the "sendkeys" command (dangerous).
          I started carefully with AutoItX support and the experience with it
          was very good.
          So I can recommend the use of AutoItX, for all kind of window manipulation.
          B.t.w.,Fredledingue, I mixed up AutoItX and AutoIt, I use versions 1.51 and
          3.0.102, respectively.

          Regards.
           
          #5

            Online Bookmarks Sharing: Share/Bookmark

            Jump to:

            Current active users

            There are 0 members and 1 guests.

            Icon Legend and Permission

            • New Messages
            • No New Messages
            • Hot Topic w/ New Messages
            • Hot Topic w/o New Messages
            • Locked w/ New Messages
            • Locked w/o New Messages
            • Read Message
            • Post New Thread
            • Reply to message
            • Post New Poll
            • Submit Vote
            • Post reward post
            • Delete my own posts
            • Delete my own threads
            • Rate post

            2000-2012 ASPPlayground.NET Forum Version 3.9