ShellWindows.Item 메서드

셸 창을 나타내는 InternetExplorer 개체를 검색합니다.

구문

retVal = ShellWindows.Item(
  [ iIndex ]
)

매개 변수

iIndex [in, optional]

형식: Variant

검색할 항목의 인덱스(0부터 시작)입니다. 이 값은 Count 속성 값보다 작아야 합니다. 이 값을 생략하면 기본값 0이 사용됩니다.

반환 값

형식: IDispatch**

셸 창을 나타내는 InternetExplorer 개체에 대한 개체 참조입니다.

예제

다음 예제에서는 Item 을 사용하여 첫 번째 셸 창 항목을 나타내는 InternetExplorer 개체를 검색합니다. JScript, VBScript 및 Visual Basic에 대한 적절한 사용법이 표시됩니다.

Jscript:

<script language="JScript">
    function fnShellWindowsItemJ()
    {
        var objShell = new ActiveXObject("shell.application");
        var objShellWindows;
        
        objShellWindows = objshell.Windows();
        if (objShellWindows != null)
        {
            var objIE;
            objIE = objShellWindows.Item();

            if (objIE != null)
            {
                alert(objIE.path());
            }
        }
    }
</script>

Vbscript:

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

        if (not objShellWindows is nothing) then
            dim objIE
            set objIE = objShellWindows.Item

            if (not objIE is nothing) then
                Wscript.Echo objIE.path
            end if

            set objIE = nothing
        end if

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

Visual Basic:

Private Sub fnShellWindowsItemVB()
    Dim objShell        As Shell
    Dim objShellWindows As ShellWindows
    
    Set objShell = New Shell
    Set objShellWindows = objshell.Windows()

    If (Not objShellWindows Is Nothing) Then
        Dim objIE As InternetExplorer
        Set objIE = objShellWindows.Item

        If (Not objIE Is Nothing) Then
            Debug.Print objIE.Path
        End If

        Set objIE = Nothing
    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 이상)