|
|
Title | List shell windows |
Description | This example shows how to List shell windows in Visual Basic 6 by looping through a ShellWindows collection object. |
Keywords | shell windows |
Categories | Windows, 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
|
|
|
|
|
|