Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Windows Shell
Shell Reference
IShellDispatch4
Methods
 ToggleDesktop Method
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 What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker