Bagikan melalui


Properti IShellDispatch.Parent

Mengambil objek yang mewakili induk objek saat ini.

Properti ini bersifat hanya baca.

Sintaks

objParent = IShellDispatch.Parent

Property Parent As Object

Nilai properti

Variabel jenis IDispatch yang menerima objek induk.

Keterangan

Properti ini diimplementasikan dan diakses melalui properti Shell.Parent .

Contoh

Contoh berikut menunjukkan penggunaan Induk di JScript, VBScript, dan Visual Basic.

Jscript:

<script language="JScript">
    function fnShellParentJ()
    {
        var objShell = new ActiveXObject("shell.application");
        var objParent;

        objParent = objshell.Shell_Parent;
        if (objParent != null)
        {
            alert("Got parent property");
        }
    }
</script>

Vbscript:

<script language="VBScript">
    function fnShellParentVB()
        dim objShell
        
        set objShell = CreateObject("shell.application")
            if (not objShell is nothing) then
                dim objParent

                set objParent = objshell.Parent
                    if (not objParent is nothing) then
                        alert("Got parent property")
                    end if
                set objParent = nothing
            end if
        set objShell = nothing
    end function
 </script>

Visual Basic:

Private Sub fnShellParentVB()
    Dim objShell As Shell
    
    Set objShell = New Shell
        If (Not objShell Is Nothing) Then
            Dim objParent As Object
            
            Set objParent = objshell.Parent
                If (Not objParent Is Nothing) Then
                    Debug.Print "Got parent object"
                End If
            Set objParent = Nothing
        End If
    Set objShell = Nothing
End Sub

Persyaratan

Persyaratan Nilai
Klien minimum yang didukung
Windows 2000 Professional, Windows XP [hanya aplikasi desktop]
Server minimum yang didukung
Windows 2000 Server [hanya aplikasi desktop]
Header
Shldisp.h
IDL
Shldisp.idl
DLL
Shell32.dll (versi 4.71 atau yang lebih baru)