Unlocking the Secrets of the ShellDocVwCtl
ControlPanelItem
Sub ControlPanelItem(szDir As String)
This allows you to open a control panel applet on the default page. The possible ones are:
Accessibility Options (ACCESS.CPL)
Add/Remove Programs (APPWIZ.CPL)
Display Options (DESK.CPL)
Regional Settings (INTL.CPL)
Joystick Options (JOY.CPL)
Mouse/Keyboard/Printers/Fonts Options (MAIN.CPL)
Mail and Fax Options ( MLCFG32.CPL )
Multimedia/Sounds Options ( MMSYS.CPL )
Modem Options (MODEM.CPL)
Network Options (NETCPL.CPL)
Password Options (PASSWORD.CPL)
System/Add New Hardware Options (SYSDM.CPL)
Date and Time Options (TIMEDATE.CPL)
Microsoft Mail Postoffice Options (WGPOCPL.CPL)
Some of these may not be available on your computer, and you may have some extra 3rd party ones. For example:
ShellControl.ControlPanelItem("DESK.CPL")
Explore
Sub Explore(vDir)
This opens an explorer window for the directory specified on vDir. For example:
ShellControl.Explore("C:") ' will open an explorer window of C:
FileRun
Sub FileRun()
This opens up the run dialog, which you get from the start menu. For example:
ShellControl.FileRun ' will show the run dialog box
FindComputer, FindFiles
Sub FindComputer() Sub FindFiles()
These methods open up the find dialogs accessible from the start menu. For example:
ShellControl.FindFiles ' will open up the find files dialog box.
MinimizeAll, UndoMinimizeAll
Sub MinimizeAll() Sub UndoMinimizeALL()
These both do the same as clicking right button on the task bar, and selecting the respective item. 'MinimizeAll' minimizes all windows, and 'UndoMinimizeAll' will undo the previous MinimizeAll command. For example:
ShellControl.MinimizeAl
Open
Sub Open(vDir)
This opens the folder specified in vDir in a default window. For example:
Shell.Open("C:")
SetTime
Sub SetTime()
This opens the set time/date dialog box, the same as the one displayed by double clicking on the clock in the system tray. For example:
ShellControl.SetTime
ShutDownWindows
Sub ShutdownWindows()
This opens the shutdown windows dialog box, which you get by clicking on shutdown on the start menu. For example:
ShellControl.ShutDownWindows
Suspend
Sub Suspend()
This suspends the computer and goes into power saving mode. It may not work if you do not have power saving turned on. For example:
ShellControl.Suspend
Page 2 of 3
This article was originally published on November 20, 2002