Επεξεργασία

Κοινή χρήση μέσω


ShellWindows._NewEnum method

Creates and returns a new ShellWindows object that is a copy of this ShellWindows object.

Syntax

retVal = ShellWindows._NewEnum()

Parameters

This method has no parameters.

Return value

Type: IUnknown**

An object reference to the ShellWindows object copy.

Examples

The following example shows _NewEnum in use. Proper usage is shown for VBScript and Visual Basic. This method cannot be used with JScript.

VBScript:

<script language="VBScript">
    function fnShellWindowsNewEnumVB()
        dim objShell
        dim objShellWindows
        
        set objShell = CreateObject("shell.application")
        set objShellWindows = objshell.Shell_Windows

        if (not objShellWindows is nothing) then
            dim objEnumItems
            
            for each objEnumItems in objShellWindows
                alert(objEnumItems.Type)
            next
        end if

        set objShellWindows = nothing
        set objShell = nothing
    end function
 </script>

Visual Basic:

Private Sub fnShellWindowsNewEnumVB()
    Dim objShell        As Shell
    Dim objShellWindows As ShellWindows
    
    Set objShell = New Shell
    Set objShellWindows = objshell.Shell_Windows

    If (Not objShellWindows Is Nothing) Then
        Dim vEnumItem As Variant
        
        For Each vEnumItem In objShellWindows
            Debug.Print vEnumItem.Type
        Next vEnumItem
    End If

    Set objShellWindows = Nothing
    Set objShell = Nothing
End Sub

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Exdisp.h
DLL
Shell32.dll (version 4.71 or later)