Bringinmg an application window back into focus

Discussion in 'Scripting' started by Spin, Aug 25, 2008.

  1. Spin

    Spin Guest

    Gurus,

    I have a desktop application that I launch via script. But for a process
    inside of it to complete I need the application window to be open but AND
    active. Does anyone know of a script which can bring say for instance, a
    single application window that is open on the desktop back into "focus".
    You can easily distinguish the active window because it's title bar is dark
    blue versus the pale gray of an inactive window.
     
    Spin, Aug 25, 2008
    #1
    1. Advertisements

  2. Spin

    J Ford Guest

    Well it is not very efficient, however it works... you will need to know the
    "title" of application window that is running.

    Set oShell = WScript.CreateObject("WScript.Shell")
    oShell.Run "notepad"
    oShell.AppActivate "Untitled - Notepad"

    This sample launches Notepad and the AppActivate brings focus to it
    referencing the application title.
     
    J Ford, Aug 25, 2008
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.