Jump to content
Sign in to follow this  

WinList GuiList Update

Recommended Posts

hello all i need help ... this script gets a list of all the windows at puts them in a list .. its all good... if u close a window and click update it updates the list.. and its all good .. the problem is if i close a window click update then reopen the window again and click update it doesnt come up ???? am i doing sumting wrong ?


#include <GUIConstants.au3>
GUICreate("My GUI Button") ; will create a dialog box that when displayed is centered

$update = GUICtrlCreateButton ("Update",  10, 30, 50)
$windowlist =GUICtrlCreateList ("", 30,50,121,97)

GUISetState ()    ; will display an  dialog box with 2 button

$list = WinList()

While 1
    $msg = GUIGetMsg()
       Case $msg = $GUI_EVENT_CLOSE
       Case $msg = $update

Func GetWindows()
  GUICtrlSetData ($windowlist, "")
  For $i = 1 to $list[0][0]
     If $list[$i][0] <> "" AND IsVisible($list[$i][1]) Then
     GUICtrlSetData ($windowlist, $list[$i][0] & "|")

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
    Return 0


Share this post

Link to post
Share on other sites

It would be extremely helpful if you actually called WinList() again so that you have fresh data instead of the old, stale data.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...