Jump to content

Minimize unkown window


Recommended Posts

Ok I have a script that launches a setup to and then sleeps while it starts, I need a script that will minimize the window that pops up without knowing what the title to the window is called

for the sake of showing a script here is it though it's kinda pointless to show so little

Run($sFilename)
Sleep(10000)

so it launces $sFilename which is an unkown installer then sleeps for 10 seconds then minimizes the window that pops up.

Link to comment
Share on other sites

Download http://www.autoitscript.com/fileman/users/Helge/udfs/_ProcessGetHWnd.au3 and then run this script in the same directory...

#include "_ProcessGetWin.au3"

$iPid = Run("calc.exe")
$hWnd = _ProcessGetWin($iPid)

If NOT @error Then
    MsgBox(64, "", "PID : " & @TAB & $iPid & @CRLF & "HWND : " & @TAB & $hWnd)
    WinClose($hWnd)
Else
    MsgBox(16, "ProcessGetWin", "Couldn't find any matching windows !")
    ProcessClose($iPid)
EndIf
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...