Méthode Shell.ControlPanelItem

Exécute l’application Panneau de configuration (*.cpl) spécifiée. Si l’application est déjà ouverte, elle active le instance en cours d’exécution.

Notes

À partir de Windows Vista, la plupart des applications Panneau de configuration sont des éléments Shell et ne peuvent pas être ouvertes avec cette fonction. Pour ouvrir ces applications Panneau de configuration, transmettez le nom canonique à control.exe. Par exemple :

control.exe /name Microsoft.Personalization

 

Syntaxe

Shell.ControlPanelItem(
  bstrDir
)

Shell.ControlPanelItem( _
  ByVal bstrDir As BSTR _
)

Paramètres

bstrDir [in]

Type : BSTR

Nom de fichier de l’application Panneau de configuration. Toutes les applications Panneau de configuration ont l’extension .cpl.

Valeur retournée

JScript

Cette méthode ne retourne pas de valeur.

VB

Cette méthode ne retourne pas de valeur.

Exemples

L’exemple suivant utilise ControlPanelItem pour exécuter l’élément Propriétés d’affichage du Panneau de configuration. Une utilisation correcte est indiquée pour JScript, VBScript et Visual Basic.

Jscript:

<script language="JScript">
    function fnShellControlPanelItemJ()
    {
        var objShell = new ActiveXObject("shell.application");
        
        objShell.ControlPanelItem("desk.cpl");
    }
</script>

Vbscript:

<script language="VBScript">
    function fnShellControlPanelItemVB()
        dim objShell
        
        set objShell = CreateObject("shell.application")
        objShell.ControlPanelItem("desk.cpl")
       
        set objShell = nothing
    end function
 </script>

Visual Basic :

Private Sub fnShellControlPanelItemVB()
    Dim objShell As Shell
    
    Set objShell = New Shell
    objShell.ControlPanelItem ("desk.cpl")
    
    Set objShell = Nothing
End Sub

Spécifications

Condition requise Valeur
Client minimal pris en charge
Windows 2000 Professionnel, Windows XP [applications de bureau uniquement]
Serveur minimal pris en charge
Windows 2000 Server [applications de bureau uniquement]
En-tête
Shldisp.h
IDL
Shldisp.idl
DLL
Shell32.dll (version 4.71 ou ultérieure)