From: mayayana on
It's not part of VBScript. See here for a component:

http://www.jsware.net/jsware/scripts.php3#jssys

There's also a component named "AutoItX"
that's popular. both are free.


> To spy on myself (to help keep time-usage logs) I'd like to write the
> name of the active window to a logfile every minute or so.
>
> I've done a fair amount of scripting so I know how to do everything
> except get the name of the active window. I looked online at the
> script center but didn't find anything.
>
> How can I get the active window's name via VBS under XP?
>
> Clark




From: Its me Earnest T. on
Depends on what your looking for really. I would imagine WMI exposes some
things but if your looking for something like give me all open internet
explorer windows for example:

Dim obj_Shell, obj_ShellWindows, obj_ShellWindow
set obj_Shell = CreateObject("Shell.Application")
set obj_ShellWindows = obj_Shell.Windows

if (not obj_ShellWindows is nothing) then
for each obj_ShellWindow in obj_ShellWindows
msgBox obj_ShellWindow.LocationUrl & vbcrlf &
obj_ShellWindow.LocationName
MsgBox obj_ShellWindow.Active
Next
End If

Bryan


"Clark Wilson" <mt1016b-msnews(a)yahoo.com> wrote in message
news:O8iQOtG%23GHA.748(a)TK2MSFTNGP02.phx.gbl...
> To spy on myself (to help keep time-usage logs) I'd like to write the
> name of the active window to a logfile every minute or so.
>
> I've done a fair amount of scripting so I know how to do everything
> except get the name of the active window. I looked online at the
> script center but didn't find anything.
>
> How can I get the active window's name via VBS under XP?
>
> Clark