IShellDispatch. Parent, propriété

Récupère un objet qui représente le parent de l’objet actuel.

Cette propriété est en lecture seule.

Syntaxe

objParent = IShellDispatch.Parent

Property Parent As Object

Valeur de la propriété

Variable de type IDispatch qui reçoit l’objet parent.

Remarques

Cette propriété est implémentée et accessible via la propriété Shell. parent .

Exemples

les exemples suivants illustrent l’utilisation du Parent dans JScript, VBScript et 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

Configuration requise

Condition requise Valeur
Client minimal pris en charge
Windows 2000 Professional, Windows XP [ desktop apps uniquement]
Serveur minimal pris en charge
Windows 2000 Server - [Applications de bureau uniquement]
En-tête
Shldisp. h
MIDL
Shldisp. idl
DLL
Shell32.dll (version 4,71 ou ultérieure)