ToggleDesktop Method

Displays or hides the desktop.

Syntax

IShellDispatch4.ToggleDesktop()

Return Value

No return value.

Remarks

This method has the same effect as the Show Desktop button in the Quick Launch area of the Taskbar. It either hides all open windows and shows the desktop, or it hides the desktop and shows all open windows. The ToggleDesktop method does not display any user interface, it just invokes the toggle action.

Examples

The following example shows the proper usage of ToggleDesktop for Microsoft JScript, Microsoft Visual Basic Scripting Edition (VBScript), and Visual Basic.

JScript:

<script language="JScript">
    function fnIShellDispatch4ToggleDesktopJ()
    {
        var objShell = new ActiveXObject("Shell.Application");
        
        objShell.ToggleDesktop();
    }
</script>

VBScript:

<script language="VBScript">
    function fnIShellDispatch4ToggleDesktopVB()
        dim objShell
        
        set objShell = CreateObject("Shell.Application")
            objShell.ToggleDesktop
        set objShell = nothing
    end function
 </script>

Visual Basic:

Private Sub fnIShellDispatch4ToggleDesktopVB()
    Dim objShell As Shell
            
    Set objShell = New Shell
        objShell.ToggleDesktop
    Set objShell = Nothing
End Sub

Applies To

IShellDispatch4
Tags :


Page view tracker