Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleRun control panel applets in Visual Basic 2005
DescriptionThis example shows how to run control panel applets in Visual Basic 2005.
Keywordscontrol panel, applet, control panel applet, VB 2005
CategoriesWindows, Miscellany, Utilities
 
This program displays a list of nice applet names in a ListBox. The array m_CommandStrings contains the corresponding names by which the system knows the applets.

When you click the Go button, the program builds a command string and uses the Shell command to execute it. The command statement has the form:

    Shell("rundll32.exe shell32.dll,Control_RunDLL XXX,,#")

Where XXX is the name of the applet's control string and # is the index of the applet tab you want to display. For example, this statement displays the first tab in the Accessibility Options applet:

    Shell("rundll32.exe shell32.dll,Control_RunDLL access.cpl,,1")

Not all of these will work on all systems because you may not have every applet installed.

 
' Display the applet.
Private Sub btnGo_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles btnGo.Click
    Dim cmd As String = _
        "rundll32.exe shell32.dll,Control_RunDLL " & _
        m_CommandStrings(lstApplet.SelectedIndex + 1) & _
        ",," & txtTab.Text.ToString()

    Try
        Shell(cmd)
    Catch ex As Exception
        MessageBox.Show(ex.Message)
    End Try
End Sub
 
 
Copyright © 1997-2006 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated