Sign in to follow this  
Followers 0
AcidCorps

Minimize unkown window

4 posts in this topic

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

if it lauches the installer couldnt you use [active] or [last]

Share this post


Link to post
Share on other sites

works perfect thank you

Share this post


Link to post
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
Sign in to follow this  
Followers 0