Shellwindows

This example prints the name and and pathes of the open windows (Tip: You can get the CLSID with makepy in Pythonwin):

import win32com.client
# look in the makepy output for IE for the 'CLSIDToClassMap'
# dictionary, and find the entry for 'ShellWindows'
clsid='{9BA05972-F6A8-11CF-A442-00A0C90A8F39}'
ShellWindows=win32com.client.Dispatch(clsid)
for i in range(ShellWindows.Count):
    print i
    # this is the titlebar value
    print ShellWindows[i].LocationName
    # this is the current URL
    print ShellWindows[i].LocationURL
print

Leave a Reply

Your email address will not be published. Required fields are marked *