Sign in to follow this  
Followers 0
LuigiMario

Easy way to know when a new window has been opened?

4 posts in this topic

#1 ·  Posted (edited)

Is there an easy way to know that if new window has been opened (doesn't matter window name/hwnd) than getting the winlist and comparing with a previously stored winlist? I need this to make any window opened transparent.

Q: Why don't you use a software to do this? There are tons of those exes!

A: Because I would like to have many grafic functions into one exe, instead than 4 or 5 programs running to do small things.

Any idea? :\

Edited by LuigiMario

Share this post


Link to post
Share on other sites

Is there an easy way to know that if new window has been opened (doesn't matter window name/hwnd) than getting the winlist and comparing with a previously stored winlist? I need this to make any window opened transparent.

Q: Why don't you use a software to do this? There are tons of those exes!

A: Because I would like to have many grafic functions into one exe, instead than 4 or 5 programs running to do small things.

Any idea? :\

Check this out....thanx to "cameronsdad"

#include<array.au3>
$thelist = WinList()
$count = $thelist[0][0]
While 1
$tmp = WinList()
$newCount = $tmp[0][0]
If $newCount > $count Then
    For $i = 1 to $newCount
        $found = 0
        For $j = 1 to $count
        If $thelist[$j][0] = $tmp[$i][0] Then
            $found = 1
            ExitLoop
        EndIf
        Next
        If Not $found Then 
            MsgBox(0,"New Window",$tmp[$i][0] & @CRLF & "is a new window")
            ExitLoop
        EndIf
    Next
    $thelist = $tmp
    $count = $newCount
EndIf
If $newCount < $count Then
    $thelist = $tmp
    $count = $newCount
EndIf   
Sleep(250)
ConsoleWrite(@CRLF & $count & " :: " & $newCount & @CRLF)
WEnd

Share this post


Link to post
Share on other sites

Works perfectly, thanks a lot ;)

Thanks to JamesB too. :)

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