Sign in to follow this  
Followers 0
bourny

List Open Windows

3 posts in this topic

Can anyone help with a script to do the following..

Read in title and text of each open or active window into a variable so I can output each window details to a text file ..

Thanks

Bournym

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Can anyone help with a script to do the following..

Read in title and text of each open or active window into a variable so I can output each window details to a text file ..

The FM says:

WinList

--------------------------------------------------------------------------------

Retrieves a list of windows.

WinList ( ["title" [, "text"]] )

Parameters

title [optional] The title of the window to read.

text [optional] The text of the window to read.

Return Value

Returns an array of matching window titles and handles.

Remarks

If no title and text is given then all top-level windows are returned.

The array returned is two-dimensional and is made up as follows:

$array[0][0] = Number of windows returned

$array[1][0] = 1st window title

$array[1][1] = 1st window handle (HWND)

$array[2][0] = 2nd window title

$array[2][1] = 2nd window handle (HWND)

...

$array[n][0] = nth window title

$array[n][1] = nth window handle (HWND)

Related

WinGetHandle

Example

$var = WinList()

For $i = 1 to $var[0][0]

; Only display visble windows that have a title

If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then

MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])

EndIf

Next

Func IsVisible($handle)

If BitAnd( WinGetState($handle), 2 ) Then

Return 1

Else

Return 0

EndIf

EndFunc

Edited by jefhal

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

Thanks....

Getting a stronger perscription in the glasses department... Couldnt see it for looking...

Bourny

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