Jump to content

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


Recommended Posts

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
Link to comment
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
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...