Home COM GDI+ WebBrowser Data Access

Shell Object

 

PROGID

"Shell.Application.1"

CLSID_Shell

{13709620-C279-11CE-A49E-444553540000}

CLSID_ShellDispatchInProc

{0A89A860-D7B1-11CE-8350-444553540000}

IID_IShellDispatch

{D8F015C0-C278-11CE-A49E-444553540000}

IID_IShellDispatch2

{A4C6892C-3BA9-11D2-9DEA-00C04FB16162}

IID_IShellDIspatch3

{177160CA-BB5A-411C-841D-BD38FACDEAA0}

IID_IShellDispatch4

{EFD84B2D-4BCF-4298-BE25-EB542A59FBDA}

 

 

The 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.

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IDispatch Methods

Description

GetTypeInfoCount

Retrieves the number of type information interfaces that an object provides (either 0 or 1).

GetTypeInfo

Gets the type information for an object.

GetIDsOfNames

Maps a single member and an optional set of argument names to a corresponding set of integer DISPIDs.

Invoke

Provides access to properties and methods exposed by an object.

IShellDispatch Methods and Properties

Description

Application

Contains the object's Application object.

Parent

Contains the object's parent object.

NameSpace

Creates and returns a Folder object for the specified folder.

BrowseForFolder

Creates a dialog box that enables the user to select a folder and then returns the selected folder's Folder object.

Windows

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

Open

Opens the specified folder.

Explore

Opens a specified folder in a Microsoft Windows Explorer window.

MinimizeAll

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.

UndoMinimizeAll

Restores all of the windows on the desktop to the same state they were in before the last MinimizeAll 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.

FileRun

Displays the Run dialog to the user. This method has the same effect as clicking the Start menu and selecting Run.

CascadeWindows

Cascades all of the windows on the desktop. This method has the same effect as right-clicking the taskbar and selecting Cascade Windows.

TileVertically

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.

TileHorizontally

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.

ShutdownWindows

Displays the Shut Down Windows dialog box. This is the same as clicking the Start menu and selecting Shut Down.

Suspend

Not currently implemented.

EjectPC

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.

SetTime

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.

TrayProperties

Displays the Taskbar and Start Menu Properties dialog box. This method has the same effect as right-clicking the taskbar and selecting Properties.

Help

Displays the Windows Help and Support Center. This method has same effect as clicking the Start menu and selecting Help and Support.

FindFiles

Displays the Find: All Files dialog box. This is the same as clicking the Start menu, selecting Find, and then selecting Files or Folders.

FindComputer

Displays the Search Results - Computers dialog box. The dialog box shows the result of the search for a specified computer.

RefreshMenu

Refreshes the contents of the Start menu. Used only with systems preceeding Windows XP.

ControlPanelItem

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

IShellDispatch2 Methods and Properties

Description

IsRestricted

Retrieves the registry's data value for a given group's restriction value.

ShellExecute

Performs a specified operation on a specified file.

FindPrinter

Displays the Find Printer dialog box to allow the user to find a printer.

GetSystemInformation

Retrieves system information.

ServiceStart

Starts a named service.

ServiceStop

Stops a named service.

IsServiceRunning

Returns a value that indicates whether a named service is running.

CanStartStopService

Determines if the current user can start and stop the named service.

ShowBrowserBar

Displays a browser bar.

IShellDispatch3 Methods and Properties

Description

AddToRecent

Adds an object to the list of recently used documents.

IShellDispatch4 Methods and Properties

Description

WindowsSecurity

Displays the Windows Security dialog box.

ToggleDesktop

Raises and lowers the desktop.

ExplorerPolicy

Retrieves the value of a Microsoft Internet Explorer policy.

GetSetting

Retrieves a Shell global setting.

 

Application

 

FUNCTION IShellDispatch_get_Application ( _
  BYVAL pthis AS DWORD PTR _
, BYREF ppid AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[7] USING IShellDispatch_get_Application (pthis, ppid) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Parent

 

FUNCTION IShellDispatch_get_Parent ( _
  BYVAL pthis AS DWORD PTR _
, BYREF ppid AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[8] USING IShellDispatch_get_Parent (pthis, ppid) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

NameSpace

 

FUNCTION IShellDispatch_NameSpace ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL vDir AS VARIANT _
, BYREF ppsdf AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[9] USING IShellDispatch_NameSpace (pthis, vDir, ppsdf) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

BrowseForFolder

 

FUNCTION IShellDispatch_BrowseForFolder ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL Hwnd AS LONG _
, BYVAL Title AS STRING _
, BYVAL Options AS LONG _
, BYVAL RootFolder AS VARIANT _
, BYREF ppsdf AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  Title = UCODE$(Title)
  CALL DWORD @@pthis[10] USING IShellDispatch_BrowseForFolder (pthis, Hwnd, Title, Options, RootFolder, ppsdf) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Windows

 

FUNCTION IShellDispatch_Windows ( _
  BYVAL pthis AS DWORD PTR _
, BYREF ppid AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[11] USING IShellDispatch_Windows (pthis, ppid) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Open

 

FUNCTION IShellDispatch_Open ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL vDir AS VARIANT _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[12] USING IShellDispatch_Open (pthis, vDir) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Explore

 

FUNCTION IShellDispatch_Explore ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL vDir AS VARIANT _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[13] USING IShellDispatch_Explore (pthis, vDir) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

MinimizeAll

 

FUNCTION IShellDispatch_MinimizeAll ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[14] USING IShellDispatch_MinimizeAll (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

UndoMinimizeAll

 

FUNCTION IShellDispatch_UndoMinimizeAll ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[15] USING IShellDispatch_UndoMinimizeALL (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

FileRun

 

FUNCTION IShellDispatch_FileRun ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[16] USING IShellDispatch_FileRun (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

CascadeWindows

 

FUNCTION IShellDispatch_CascadeWindows ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[17] USING IShellDispatch_CascadeWindows (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

TileVertically

 

FUNCTION IShellDispatch_TileVertically ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[18] USING IShellDispatch_TileVertically (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

TileHorizontally

 

FUNCTION IShellDispatch_TileHorizontally ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[19] USING IShellDispatch_TileHorizontally (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

ShutdownWindows

 

FUNCTION IShellDispatch_ShutdownWindows ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[20] USING IShellDispatch_ShutdownWindows (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Suspend

 

FUNCTION IShellDispatch_Suspend ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[21] USING IShellDispatch_Suspend (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

EjectPC

 

FUNCTION IShellDispatch_EjectPC ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[22] USING IShellDispatch_EjectPC (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

SetTime

 

FUNCTION IShellDispatch_SetTime ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[23] USING IShellDispatch_SetTime (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

TrayProperties

 

FUNCTION IShellDispatch_TrayProperties ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[24] USING IShellDispatch_TrayProperties (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Help

 

FUNCTION IShellDispatch_Help ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[25] USING IShellDispatch_Help (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

FindFiles

 

FUNCTION IShellDispatch_FindFiles ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[26] USING IShellDispatch_FindFiles (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

FindComputer

 

FUNCTION IShellDispatch_FindComputer ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[27] USING IShellDispatch_FindComputer (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

RefreshMenu

 

FUNCTION IShellDispatch_RefreshMenu ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[28] USING IShellDispatch_RefreshMenu (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

ControlPanelItem

 

FUNCTION IShellDispatch_ControlPanelItem ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL szDir AS STRING _
  ) AS LONG

  LOCAL HRESULT AS LONG
  szDir = UCODE$(szDir)
  CALL DWORD @@pthis[29] USING IShellDispatch_ControlPanelItem (pthis, szDir) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

IsRestricted

 

FUNCTION IShellDispatch2_IsRestricted ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL Group AS STRING _
, BYVAL Restriction AS STRING _
, BYREF plRestrictValue AS LONG _
  ) AS LONG

  LOCAL HRESULT AS LONG
  Group = UCODE$(Group)
  Restriction = UCODE$(Restriction)
  CALL DWORD @@pthis[30] USING IShellDispatch2_IsRestricted (pthis, Group, Restriction, plRestrictValue) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

ShellExecute

 

FUNCTION IShellDispatch2_ShellExecute ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL File AS STRING _
, BYVAL vArgs AS VARIANT _
, BYVAL vDir AS VARIANT _
, BYVAL vOperation AS VARIANT _
, BYVAL vShow AS VARIANT _
  ) AS LONG

  LOCAL HRESULT AS LONG
  File = UCODE$(File)
  CALL DWORD @@pthis[31] USING IShellDispatch2_ShellExecute (pthis, File, vArgs, vDir, vOperation, vShow) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

FindPrinter

 

FUNCTION IShellDispatch2_FindPrinter ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL pbstrName AS STRING _
, BYVAL location AS STRING _
, BYVAL model AS STRING _
  ) AS LONG

  LOCAL HRESULT AS LONG
  pbstrName = UCODE$(pbstrName)
  location = UCODE$(location)
  model = UCODE$(model)
  CALL DWORD @@pthis[32] USING IShellDispatch2_FindPrinter (pthis, pbstrName, location, model) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetSystemInformation

 

FUNCTION IShellDispatch2_GetSystemInformation ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL pbstrName AS STRING _
, BYREF pv AS VARIANT _
  ) AS LONG

  LOCAL HRESULT AS LONG
  pbstrName = UCODE$(pbstrName)
  CALL DWORD @@pthis[33] USING IShellDispatch2_GetSystemInformation (pthis, pbstrName, prm_pv) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

ServiceStart

 

FUNCTION IShellDispatch2_ServiceStart ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL ServiceName AS STRING _
, BYVAL Persistent AS VARIANT _
, BYREF pSuccess AS VARIANT _
  ) AS LONG

  LOCAL HRESULT AS LONG
  ServiceName = UCODE$(ServiceName)
  CALL DWORD @@pthis[34] USING IShellDispatch2_ServiceStart (pthis, ServiceName, Persistent, pSuccess) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

ServiceStop

 

FUNCTION IShellDispatch2_ServiceStop ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL ServiceName AS STRING _
, BYVAL Persistent AS VARIANT _
, BYREF pSuccess AS VARIANT _
  ) AS LONG

  LOCAL HRESULT AS LONG
  ServiceName = UCODE$(ServiceName)
  CALL DWORD @@pthis[35] USING IShellDispatch2_ServiceStop (pthis, ServiceName, Persistent, pSuccess) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

IsServiceRunning

 

FUNCTION IShellDispatch2_IsServiceRunning ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL ServiceName AS STRING _
, BYREF pRunning AS VARIANT _
  ) AS LONG

  LOCAL HRESULT AS LONG
  ServiceName = UCODE$(ServiceName)
  CALL DWORD @@pthis[36] USING IShellDispatch2_IsServiceRunning (pthis, ServiceName, pRunning) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

CanStartStopService

 

FUNCTION IShellDispatch2_CanStartStopService ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL ServiceName AS STRING _
, BYREF pCanStartStop AS VARIANT _
  ) AS LONG

  LOCAL HRESULT AS LONG
  ServiceName = UCODE$(ServiceName)
  CALL DWORD @@pthis[37] USING IShellDispatch2_CanStartStopService (pthis, ServiceName, pCanStartStop) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

ShowBrowseBar

 

FUNCTION IShellDispatch2_ShowBrowserBar ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL bstrClsid AS STRING _
, BYVAL bShow AS VARIANT _
, BYREF pSuccess AS VARIANT _
  ) AS LONG

  LOCAL HRESULT AS LONG
  bstrClsid = UCODE$(bstrClsid)
  CALL DWORD @@pthis[38] USING IShellDispatch2_ShowBrowserBar (pthis, bstrClsid, bShow, pSuccess) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

AddToRecent

 

FUNCTION IShellDispatch3_AddToRecent ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL varFile AS VARIANT _
, BYVAL bstrCategory AS STRING _
  ) AS LONG

  LOCAL HRESULT AS LONG
  bstrCategory = UCODE$(bstrCategory)
  CALL DWORD @@pthis[39] USING IShellDispatch3_AddToRecent (pthis, varFile, bstrCategory) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

WindowsSecurity

 

FUNCTION IShellDispatch4_WindowsSecurity ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[40] USING IShellDispatch4_WindowsSecurity (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

ToggleDesktop

 

FUNCTION IShellDispatch4_ToggleDesktop ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[41] USING IShellDispatch4_ToggleDesktop (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

ExplorerPolicy

 

FUNCTION IShellDispatch4_ExplorerPolicy ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL bstrPolicyName AS STRING _
, BYREF pValue AS VARIANT _
  ) AS LONG

  LOCAL HRESULT AS LONG
  bstrPolicyName = UCODE$(bstrPolicyName)
  CALL DWORD @@pthis[42] USING IShellDispatch4_ExplorerPolicy (pthis, bstrPolicyName, pValue) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetSetting

 

FUNCTION IShellDispatch4_GetSetting ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL lSetting AS LONG _
, BYREF pResult AS INTEGER _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[43] USING IShellDispatch4_GetSetting (pthis, lSetting, pResult) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Page last updated on Tuesday, 04 April 2006 11:30:12 +0200