Application Property
Shell Objects

Application Property

Description

Contains the Application object of the object. This is a read-only property.

Syntax

object.Application

ParameterDescription
object Required. An object expression that evaluates to a FolderItemVerbs object.


Count Property

Description

Contains the number of items in the collection. This is a read-only property.

Syntax

object.Count

ParameterDescription
object Required. An object expression that evaluates to a FolderItemVerbs object.


Parent Property

Description

Contains the parent object of the object. This is a read-only property.

Syntax

object.Parent

ParameterDescription
object Required. An object expression that evaluates to a FolderItemVerbs object.


FolderItemVerbs object methods

The FolderItemVerbs object has the following methods:
Item
_NewEnum


Item Method

Description

Retrieves the FolderItemVerb object for a specified item in the collection.

Syntax

object.Item [index]

ParameterDescription
object Required. An object expression that evaluates to a FolderItemVerbs object.
index Optional. Specifies the zero-based index of the item to retrieve. This value must be less than the value of the Count property.


_NewEnum Method

Description

Creates and returns a new FolderItemVerbs object that is a copy of this FolderItemVerbs object.

Syntax

object._NewEnum

ParameterDescription
object Required. An object expression that evaluates to a FolderItemVerbs object.


Shell Object

The Shell object represents the objects in the shell. There are methods to control the shell and to execute commands within the shell. There are also methods to obtain other shell-related objects.
Properties
Methods
Constants


Shell object properties

The Shell object has the following properties:
Application
Parent


Application Property

Description

Contains the Application object of the object. This is a read-only property.

Syntax

object.Application

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


Parent Property

Description

Contains the parent object of the object. This is a read-only property.

Syntax

object.Parent

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


Shell object methods

The Shell object has the following methods:
BrowseForFolder
CascadeWindows
ControlPanelItem
EjectPC
Explore
FileRun
FindComputer
FindFiles
Help
MinimizeAll
NameSpace
Open
RefreshMenu
SetTime
ShutdownWindows
Suspend
TileHorizontally
TileVertically
TrayProperties
UndoMinimizeALL
Windows


BrowseForFolder Method

Description

Creates a dialog box that allows the user to select a folder and then returns a Folder object that represents the selected folder.

Syntax

object.BrowseForFolder Hwnd, Title, Options, [RootFolder]

ParameterDescription
object Required. An object expression that evaluates to a Shell object.
Hwnd Required. The handle to the window that will be the parent of the browse dialog box. This value can be zero.
Title Required. A string value that represents the title that will be displayed inside the browse dialog box.
Options Required. A long value that contains the options for the method. This can be zero or a combination of the values listed under the ulFlags member of the BROWSEINFO structure.
RootFolder Optional. Specifies the root of the browse dialog. The user cannot browse higher in the folder architecture than this folder. If this value is not specified, the root of the browse dialog is the desktop. This value can be a string that specifies the path of the folder or one of the ShellSpecialFolderConstants values.


CascadeWindows Method

Description

Causes all of the windows on the desktop to be cascaded. This is the same as right-clicking on the taskbar and selecting Cascade Windows.

Syntax

object.CascadeWindows

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


ControlPanelItem Method

Description

Runs the specified Control Panel application. If the application is already open, it will activate the running instance.

Syntax

object.ControlPanelItem szDir

ParameterDescription
object Required. An object expression that evaluates to a Shell object.
szDir Required. Specifies the Control Panel application's file name. All Control Panel applications have the .cpl extension.


EjectPC Method

Description

Causes the computer to be ejected from its docking station. This is the same as clicking on the Start menu and selecting Eject PC, if your computer supports this command.

Syntax

object.EjectPC

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


Explore Method

Description

Explores a folder.

Syntax

object.Explore vDir

ParameterDescription
object Required. An object expression that evaluates to a Shell object.
vDir Required. Specifies the folder to be explored. This can be a string that specifies the path of the folder or one of the ShellSpecialFolderConstants values.


FileRun Method

Description

Causes the Run dialog to be displayed to the user. This is the same as clicking on the Start Menu and selecting Run.

Syntax

object.FileRun

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


FindComputer Method

Description

Causes the Find: Computer dialog to be displayed to the user. This is the same as clicking on the Start Menu, selecting Find, and then selecting Computer.

Syntax

object.FindComputer

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


FindFiles Method

Description

Causes the Find: All Files dialog to be displayed to the user. This is the same as clicking on the Start Menu, selecting Find, and then selecting Files or Folders.

Syntax

object.FindFiles

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


Help Method

Description

Causes Microsoft® Windows® Help to be displayed to the user. This is the same as clicking on the Start Menu and selecting Help.

Syntax

object.Help

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


MinimizeAll Method

Description

Causes all of the windows on the desktop to be minimized. This is the same as right-clicking on the taskbar and selecting Minimize All Windows.

Syntax

object.MinimizeAll

ParameterDescription
object Required. An object expression that evaluates to a Shell object.

See Also

UndoMinimizeALL


NameSpace Method

Description

Creates and returns a Folder object for the specified folder.

Syntax

object.NameSpace vDir

ParameterDescription
object Required. An object expression that evaluates to a Shell object.
vDir Required. Specifies the folder for which to create the Folder object. This can be a string that specifies the path of the folder or one of the ShellSpecialFolderConstants values.


Open Method

Description

Opens a folder.

Syntax

object.Open vDir

ParameterDescription
object Required. An object expression that evaluates to a Shell object.
vDir Required. This can be a string that specifies the path of the folder or one of the ShellSpecialFolderConstants values.


RefreshMenu Method

Description

Causes the Start Menu to refresh its contents.

Syntax

object.RefreshMenu

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


SetTime Method

Description

Causes the Date/Time Properties dialog to be displayed to the user. This is the same as right-clicking on the clock in the tray and selecting Adjust Date/Time.

Syntax

object.SetTime

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


ShutdownWindows Method

Description

Causes the Shut Down Windows dialog to be displayed to the user. This is the same as clicking on the Start menu and selecting Shut Down.

Syntax

object.ShutdownWindows

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


Suspend Method

Description

Causes the computer to be suspended. This is the same as clicking on the Start menu and selecting Suspend (for computers that support suspending).

Syntax

object.Suspend

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


TileHorizontally Method

Description

Causes all of the windows on the desktop to be tiled horizontally. This is the same as right-clicking on the taskbar and selecting Tile Windows Horizontally.

Syntax

object.TileHorizontally

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


TileVertically Method

Description

Causes all of the windows on the desktop to be tiled vertically. This is the same as right-clicking on the taskbar and selecting Tile Windows Vertically.

Syntax

object.TileVertically

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


TrayProperties Method

Description

Causes the Taskbar Properties dialog to be displayed to the user. This is the same as right-clicking on the taskbar and selecting Properties.

Syntax

object.TrayProperties

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


UndoMinimizeALL Method

Description

Causes all of the windows on the desktop to be restored to the same state they were in before the last MinimizeAll command. This is the same as right-clicking on the taskbar and selecting Undo Minimize All Windows.

Syntax

object.UndoMinimizeALL

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


Windows Method

Description

Creates and returns a ShellWindows object that represents a collection of all of the open windows that belong to the shell.

Syntax

object.Windows

ParameterDescription
object Required. An object expression that evaluates to a Shell object.


Shell object constants

The Shell object uses the following set of constants:
ShellSpecialFolderConstants


ShellSpecialFolderConstants Enumeration

Description

A set of values that specify special folders in the shell.

Syntax
enum ShellSpecialFolderConstants{
    ssfDESKTOP = 0x0000,
    ssfPROGRAMS = 0x0002,
    ssfCONTROLS = 0x0003,
    ssfPRINTERS = 0x0004,
    ssfPERSONAL = 0x0005,
    ssfFAVORITES = 0x0006,
    ssfSTARTUP = 0x0007,
    ssfRECENT = 0x0008,
    ssfSENDTO = 0x0009,
    ssfBITBUCKET = 0x000a,
    ssfSTARTMENU = 0x000b,
    ssfDESKTOPDIRECTORY = 0x0010,
    ssfDRIVES = 0x0011,
    ssfNETWORK = 0x0012,
    ssfNETHOOD = 0x0013,
    ssfFONTS = 0x0014,
    ssfTEMPLATES = 0x0015,
} ShellSpecialFolderConstants;

ParameterDescription
ssfDESKTOP Specifies the desktop folder.
ssfPROGRAMS Specifies the file system folder that contains the items in the Programs folder on the Start menu.
ssfCONTROLS Specifies the Control Panel folder.
ssfPRINTERS Specifies the Printers folder.
ssfPERSONAL Specifies the file system folder that contains the user's documents.
ssfFAVORITES Specifies the Favorites folder.
ssfSTARTUP Specifies the Startup folder on the Start menu.
ssfRECENT Specifies the folder that contains shortcuts to the user's most recently used documents.
ssfSENDTO Specifies the folder that contains the items that are added to the Send To menu.
ssfBITBUCKET Specifies the Recycle Bin.
ssfSTARTMENU Specifies the folder that contains the items that are displayed on the Start menu.
ssfDESKTOPDIRECTORY Specifies the file system folder that contains the items on the desktop.
ssfDRIVES Specifies My Computer.
ssfNETWORK Specifies the Network Neighborhood.
ssfNETHOOD Specifies the file system folder that contains items displayed inside the Network Neighborhood.
ssfFONTS Specifies the folder that contains the installed fonts.
ssfTEMPLATES Specifies the file system folder that contains document templates.


ShellFolderView Object

The ShellFolderView object represents the objects in a view. There are properties and methods used to obtain information about the contents of the view.
Properties
Methods
Events
Constants


ShellFolderView object properties

The ShellFolderView object has the following properties:
Application
FocusedItem
Folder
Parent
Script
ViewOptions


Application Property

Description

Contains the Application object of the object. This is a read-only property.

Syntax

object.Application

ParameterDescription
object Required. An object expression that evaluates to a ShellFolderView object.


FocusedItem Property

Description

Contains a FolderItem object that represents the item that has the input focus. This is a read-only property.

Syntax

object.FocusedItem

ParameterDescription
object Required. An object expression that evaluates to a ShellFolderView object.


Folder Property

Description

Contains a Folder object that represents the view. This is a read-only property.

Syntax

object.Folder

ParameterDescription
object Required. An object expression that evaluates to a ShellFolderView object.


Parent Property

Description

Contains the parent object of the object. This is a read-only property.

Syntax

object.Parent

ParameterDescription
object Required. An object expression that evaluates to a ShellFolderView object.


Script Property

Description

Contains the scripting object for the view. This is a read-only property.

Syntax

object.Script

ParameterDescription
object Required. An object expression that evaluates to a ShellFolderView object.


ViewOptions Property

Description

Contains a set of ShellFolderViewOptions flags that indicate the current options of the view. This is a read-only property.

Syntax

object.ViewOptions

ParameterDescription
object Required. An object expression that evaluates to a ShellFolderView object.


ShellFolderView object methods

The ShellFolderView object has the following methods:
PopupItemMenu
SelectedItems
SelectItem


PopupItemMenu Method

Description

Creates a context menu for the specified item and returns the selected command string.

Syntax

object.PopupItemMenu vItem, [vx], [vy]

ParameterDescription
object Required. An object expression that evaluates to a ShellFolderView object.
vItem Required. The FolderItem object for which the context menu will be created.
vx Optional. The horizontal position of the menu, in screen coordinates.
vy Optional. The vertical position of the menu, in screen coordinates.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.