Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleList shell windows
DescriptionThis example shows how to List shell windows in Visual Basic 6 by looping through a ShellWindows collection object.
Keywordsshell windows
CategoriesWindows, Utilities
 
(This may only work in Windows 98 and Windows 2000)

This program contains a reference to the Microsoft Internet Controls library. It creates a ShellWindows collection object and loops through it examining the Internet Explorer processes it contains. These include desktop folders, Windows Explorer, and actual Internet Explorer processes.

 
Private Sub Form_Load()
Dim tabs(1 To 2) As Long
Dim shell_windows As SHDocVw.ShellWindows
Dim ie As SHDocVw.InternetExplorer
Dim txt As String

    tabs(1) = 100
    tabs(2) = 200

    ' Set the tabs.
    SendMessage List1.hwnd, LB_SETTABSTOPS, 2, tabs(1)
    List1.AddItem "Application" & vbTab & "Location" & _
        vbTab & "URL"

    ' List the shell windows.
    Set shell_windows = New SHDocVw.ShellWindows
    For Each ie In shell_windows
        txt = ie.Application & vbTab & _
              ie.LocationName
        If ie.Application = "Microsoft Internet Explorer" _
            Then
            txt = txt & vbTab & ie.LocationURL
        End If
        List1.AddItem txt
    Next
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated