Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
You can use the shell command to open the Control Panel.
You can also run individual Control Panel dialogs. Many of these are cpls in the C:\Windows\system32 directory
Examples of cpl programs:
appwiz.cpl Add/Remove Programs Applet
hdwwiz.cpl Hardware Wizard Applet
main.cpl Mouse and Keyboard Applet
modem.cpl Modem and Phone Applet
ncpa.cpl Network and connectivity AppletExamples using VB6:
' Open Control Panel
Private Sub ControlPanelButton_Click()
Dim Command As String
Command = "rundll32.exe shell32.dll,Control_RunDLL"
result = Shell(Command, vbNormalFocus)
End Sub' Open Add Printer Dialog
Private Sub AddPrinterButton_Click()
Dim Command As String
Command = "rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL
AddPrinter"
result = Shell(Command, vbNormalFocus)
End Sub' Open Keyboard Dialog
Private Sub KeyboardButton_Click()
Dim Command As String
Command = "rundll32.exe shell32.dll,Control_RunDLL
main.cpl @1,,2"
result = Shell(Command, vbNormalFocus)
End SubReferences:
VBnet Visual Basic Developers Resource Centre
http://www.mvps.org/vbnet/welcome.htmAdding Control Panel Functions to a VB Application
http://www.mvps.org/vbnet/index.html?code/system/controlpnl.htmThe Win32 Rundll and Rundll32 Interface
http://www.mvps.org/vbnet/index.html?code/system/rundll32.htmHide Control Panel Applets
http://www.winguides.com/registry/display.php/909/

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |