Shell object

Represents the objects in the Shell. Methods are provided to control the Shell and to execute commands within the Shell. There are also methods to obtain other Shell-related objects.

Members

The Shell object has these types of members:

Methods

The Shell object has these methods.

Method Description
[AddToRecent](https://msdn.microsoft.com/en-us/library/Gg537735(v=VS.85).aspx) Adds a file to the most recently used (MRU) list.
[BrowseForFolder](shell-browseforfolder.md) Creates a dialog box that enables the user to select a folder and then returns the selected folder's [Folder](folder.md) object.
[CanStartStopService](https://msdn.microsoft.com/en-us/library/Gg537736(v=VS.85).aspx) Determines if the current user can start and stop the named service.
[CascadeWindows](shell-cascadewindows.md) Cascades all of the windows on the desktop. This method has the same effect as right-clicking the taskbar and selecting Cascade Windows.
[ControlPanelItem](shell-controlpanelitem.md) Runs the specified Control Panel (*.cpl) application. If the application is already open, it will activate the running instance.

[!Note]
As of Windows Vista, most Control Panel applications are Shell items and cannot be opened with this function. To open those Control Panel applications, pass the canonical name to control.exe. For example:

control.exe /name Microsoft.Personalization

[EjectPC](shell-ejectpc.md) Ejects the computer from its docking station. This is the same as clicking the Start menu and selecting Eject PC, if your computer supports this command.
[Explore](shell-explore.md) Opens a specified folder in a Windows Explorer window.
[ExplorerPolicy](shell-explorerpolicy.md) Gets the value for a specified Internet Explorer policy.
[FileRun](shell-filerun.md) Displays the Run dialog to the user. This method has the same effect as clicking the Start menu and selecting Run.
[FindComputer](shell-findcomputer.md) Displays the Search Results: Computers dialog box. The dialog box shows the result of the search for a specified computer.
[FindFiles](shell-findfiles.md) Displays the Find: All Files dialog box. This is the same as clicking the Start menu and then selecting Search (or its equivalent under systems earlier than Windows XP.
[FindPrinter](https://msdn.microsoft.com/en-us/library/Gg537738(v=VS.85).aspx) Displays the Find Printer dialog box.
[GetSetting](https://msdn.microsoft.com/en-us/library/Gg537739(v=VS.85).aspx) Retrieves a global Shell setting.
[GetSystemInformation](https://msdn.microsoft.com/en-us/library/Gg537740(v=VS.85).aspx) Retrieves system information.
[Help](shell-help.md) Displays the Windows Help and Support Center. This method has the same effect as clicking the Start menu and selecting Help and Support.
[IsRestricted](https://msdn.microsoft.com/en-us/library/Gg537741(v=VS.85).aspx) Retrieves a group's restriction setting from the registry.
[IsServiceRunning](https://msdn.microsoft.com/en-us/library/Gg537742(v=VS.85).aspx) Returns a value that indicates whether a particular service is running.
[MinimizeAll](shell-minimizeall.md) Minimizes all of the windows on the desktop. This method has the same effect as right-clicking the taskbar and selecting Minimize All Windows on older systems or clicking the Show Desktop icon in the Quick Launch area of the taskbar in Windows 2000 or Windows XP.
[NameSpace](shell-namespace.md) Creates and returns a [Folder](folder.md) object for the specified folder.
[Open](shell-open.md) Opens the specified folder.
[RefreshMenu](shell-refreshmenu.md) Refreshes the contents of the Start menu. Used only with systems preceding Windows XP.
[SearchCommand](shell-searchcommand.md) Displays the Apps Search pane.
[ServiceStart](https://msdn.microsoft.com/en-us/library/Gg537743(v=VS.85).aspx) Starts a named service.
[ServiceStop](https://msdn.microsoft.com/en-us/library/Gg537744(v=VS.85).aspx) Stops a named service.
[SetTime](shell-settime.md) Displays the Date and Time Properties dialog box. This method has the same effect as right-clicking the clock in the taskbar status area and selecting Adjust Date/Time.
[ShellExecute](https://msdn.microsoft.com/en-us/library/Gg537745(v=VS.85).aspx) Performs a specified operation on a specified file.
[ShowBrowserBar](https://msdn.microsoft.com/en-us/library/Gg537746(v=VS.85).aspx) Displays a browser bar.
[ShutdownWindows](shell-shutdownwindows.md) Displays the Shut Down Windows dialog box. This is the same as clicking the Start menu and selecting Shut Down.
[Suspend](shell-suspend.md)
[TileHorizontally](shell-tilehorizontally.md) Tiles all of the windows on the desktop horizontally. This method has the same effect as right-clicking the taskbar and selecting Tile Windows Horizontally.
[TileVertically](shell-tilevertically.md) Tiles all of the windows on the desktop vertically. This method has the same effect as right-clicking the taskbar and selecting Tile Windows Vertically.
[ToggleDesktop](shell-toggledesktop.md) Displays or hides the desktop.
[TrayProperties](shell-trayproperties.md) Displays the Taskbar and Start Menu Properties dialog box. This method has the same effect as right-clicking the taskbar and selecting Properties.
[UndoMinimizeALL](shell-undominimizeall.md) Restores all desktop windows to the same state they were in before the last [MinimizeAll](shell-minimizeall.md) command. This method has the same effect as right-clicking the taskbar and selecting Undo Minimize All Windows on older systems or a second clicking of the Show Desktop icon in the Quick Launch area of the taskbar in Windows 2000 or Windows XP.
[Windows](shell-windows.md) Creates and returns a [ShellWindows](shellwindows.md) object. This object represents a collection of all of the open windows that belong to the Shell.
[WindowsSecurity](shell-windowssecurity.md) Displays the Windows Security dialog box.
[WindowSwitcher](shell-windowswitcher.md) Displays your open windows in a 3D stack that you can flip through.

 

Properties

The Shell object has these properties.

Property Access type Description
Application
Read-only
Contains the object's Application object.
Parent
Read-only
Gets an object that represents the parent of the current object.

 

Requirements

Minimum supported client
Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Shldisp.h
IDL
Shldisp.idl
DLL
Shell32.dll (version 4.71 or later)