Share via


ShellWindows._NewEnum メソッド

この ShellWindows オブジェクトのコピーである新しい ShellWindows オブジェクトを作成して返します。

構文

retVal = ShellWindows._NewEnum()

パラメーター

このメソッドにはパラメーターはありません。

戻り値

種類: IUnknown**

ShellWindows オブジェクト コピーへのオブジェクト参照。

次の例は、 使用中の_NewEnum を示しています。 VBScript と Visual Basic では、適切な使用方法が表示されます。 このメソッドは 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

必要条件

要件
サポートされている最小のクライアント
Windows 2000 Professional、Windows XP [デスクトップ アプリのみ]
サポートされている最小のサーバー
Windows 2000 Server [デスクトップ アプリのみ]
ヘッダー
Exdisp.h
[DLL]
Shell32.dll (バージョン 4.71 以降)