Click here to Skip to main content
16,017,788 members
Articles / Programming Languages / Visual Basic

Access Control Panel Applications With Just 2 Clicks

,
Rate me:
Please Sign up or sign in to vote.
4.85/5 (19 votes)
5 Oct 2009CPOL8 min read 95.8K   29   40
A solution to extensive mouse clicking

Updated Version

ControlPanelApps now has WindowsXP Control Panel Applets added. I am looking for some XP users to try this out and let me know of any errors, incompatibilities, and applets that won't start. I do not have an XP machine so I need some help. You can download it here. NOTE: This is for 32 bit Vista and XP users ONLY. If you just want the Vista application, download it here. C# users can get it here. The CHM file is here. The C-Sharp version was converted with SharpDevelop 3.1.

Image 1

Introduction

After creating Vista_Command_Utilities, which can be seen here, and the great response I received, I decided to create a full application that accessed the control panel with as little as 2 clicks per control panel item. This one has a better Interface and looks a lot better. I also put the most commonly used items in categories which will be easier to get at. The program itself is too big to upload to The Code Project (9.23 MB in size). If you would like to see and use it, click Vista_XP_ControlPanelApps.zip. I am currently adding Windows 7 Control Panel Applets.

This little insert is from an MSDN article on the control panel items. NOTE: (Not all Control Panel items are available on all varieties of Windows Vista and XP. Some Control Panel items may appear only when appropriate hardware is detected). Also this is for Vista 32bit users and XP users. I am not sure about the Vista 64bit commands and their arguments.

In the picture above, on the left, the control panel favorites is selected in the list box. On the right, a group box displays the most commonly used items for this category. By moving your mouse over a pictured item, you will get the item and the command used to access that particular item displayed in the text boxes. By clicking on a pictured item, it displays that item. Just two clicks.

cpa2.gif

Using the Code

The code that was used is the WinExec function which is found in the kernel32.dll library. I am not sure if this is the correct way of going about this, but, it seems to work. I also used the Process control to access some of the commands because the WinExec function would not take the ‘/s’ argument. Therefore, the Process control was the way to go. Here is the code for the two styles that I just described:

VB.NET
Private Sub PictureBox31_Click(ByVal sender As System.Object,_ 
ByVal e As System.EventArgs) Handles PictureBox31.Click 
'Windows Defender 
WinExec(strSysPath&"\control.exe /name _ Microsoft.WindowsDefender", SW_NORMAL) 
End Sub
 
Private Sub PictureBox31_MouseEnter(ByVal sender As System.Object, _ 
ByVal e As System.EventArgs) Handles PictureBox31.MouseEnter 
txtWindows.Text = strSysPath & "\control.exe /name _ Microsoft.WindowsDefender" 
txtInfo5.Text = "Windows Defender." 
End Sub
 
Private Sub PictureBox31_MouseLeave(ByVal sender As System.Object, _ 
ByVal e As System.EventArgs) Handles PictureBox31.MouseLeave 
txtWindows.Text = "" 
txtInfo5.Text = "" 
End Sub 

Private Sub PictureBox34_Click(ByVal sender As System.Object, _ 
ByVal e As System.EventArgs) Handles PictureBox34.Click 
'Computer Management 
pRun.StartInfo.Arguments = "/s" 
pRun.StartInfo.WorkingDirectory = strSysPath 
pRun.StartInfo.FileName = "compmgmt.msc" 
pRun.Start() 
pRun.WaitForExit() 
End Sub 

Private Sub PictureBox34_MouseEnter(ByVal sender As System.Object, _ 
ByVal e As System.EventArgs) Handles PictureBox34.MouseEnter 
txtInfo7.Text = "Computer Management" 
txtCmdSys.Text = strSysPath & "\compmgmt.msc /s" 
End Sub 

Private Sub PictureBox34_MouseLeave(ByVal sender As System.Object, _ 
ByVal e As System.EventArgs) Handles PictureBox34.MouseLeave 
txtInfo7.Text = "" 
txtCmdSys.Text = "" 
End Sub

Here is a list of pictures that show the next 5 categories:

cpa3.gif

cpa4.gif

cpa5.gif

cpa6.gif

cpa7.gif

All the commands are basically the same for items 1 – 6. Item 7 is CP Complete List. Selecting this brings up the last picture above. In the combo box is a complete list of the control panel items. The command used for this was WinExec function and the canonical names of the control panel items. Below is an insert from MSDN that sums up what canonical names are.

Windows Vista Canonical Names

In Windows Vista, the preferred method of launching a Control Panel item from a command line is to use the Control Panel item's canonical name. A canonical name is a non-localized string that the Control Panel item declares in the registry. The value of using a canonical name is that it abstracts the module name of the Control Panel item. An item can be implemented in a *.dll and later be reimplemented as a *.exe or change its module name. As long as the canonical name remains the same, any program that opens it by using that canonical name does not need to be updated to account for the changes. By convention, the canonical name is "CorporationName.ControlPanelItemName".

The following example shows how an application can start the Control Panel item Windows Update with WinExec.

VB.NET
WinExec("%systemroot%\system32\control.exe /name Microsoft.WindowsUpdate", SW_NORMAL);

To start a Control Panel item with its canonical name, use: "%systemroot%\system32\control.exe /name canonicalName". To open a specific sub-page in an item, or to open it with additional parameters, use: "%systemroot%\system32\control.exe /name canonicalName /page pageName".

An application can also implement the IOpenControlPanel interface to start Control Panel items, including the ability to open a specific sub-page, through the IOpenControlPanel::Open method. The following canonical names are defined for Control Panel items on Windows Vista. These canonical names do not change for different languages. They are always in English, even if the system's language is non-English.

  • Microsoft.AddHardware
  • Microsoft.AdministrativeTools
  • Microsoft.AudioDevicesAndSoundThemes
  • Microsoft.AutoPlay
  • Microsoft.BackupAndRestoreCenter
  • Microsoft.BitLockerDriveEncryption
  • Microsoft.Bluetooth
  • Microsoft.CardSpace
  • Microsoft.ColorManagement
  • Microsoft.DateAndTime
  • Microsoft.DefaultPrograms
  • Microsoft.DeviceManager
  • Microsoft.EaseOfAccessCenter
  • Microsoft.FolderOptions
  • Microsoft.Fonts
  • Microsoft.GameControllers
  • Microsoft.GetPrograms
  • Microsoft.GetProgramsOnline
  • Microsoft.IndexingOptions
  • Microsoft.Infrared
  • Microsoft.InternetOptions
  • Microsoft.iSCSIInitiator
  • Microsoft.Keyboard
  • Microsoft.MobilityCenter
  • Microsoft.Mouse
  • Microsoft.NetworkAndSharingCenter
  • Microsoft.OfflineFiles
  • Microsoft.ParentalControls
  • Microsoft.PenAndInputDevices
  • Microsoft.PeopleNearMe
  • Microsoft.PerformaceInformationAndTools
  • Microsoft.Personalization
  • Microsoft.PhoneAndModemOptions
  • Microsoft.PowerOptions
  • Microsoft.Printers
  • Microsoft.ProblemReportsAndSolutions
  • Microsoft.ProgramsAndFeatures
  • Microsoft.RegionalAndLanguageOptions
  • Microsoft.ScannersAndCameras
  • Microsoft.SecurityCenter
  • Microsoft.SpeechRecognitionOptions
  • Microsoft.SyncCenter
  • Microsoft.System
  • Microsoft.TabletPCSettings
  • Microsoft.TaskbarAndStartMenu
  • Microsoft.TextToSpeech
  • Microsoft.UserAccounts
  • Microsoft.WelcomeCenter
  • Microsoft.WindowsAnytimeUpgrade
  • Microsoft.WindowsDefender
  • Microsoft.WindowsFirewall
  • Microsoft.WindowsSideShow
  • Microsoft.WindowsSidebarProperties
  • Microsoft.WindowsUpdate

Windows 7 Control Panel Canonical Names

The following canonical names are defined for Control Panel items in Windows 7. All names are also valid on Windows Vista unless specified otherwise. Not all Control Panel items are available on all varieties of Microsoft Windows and some Control Panel items might appear only when appropriate hardware is detected. These canonical names do not change for different languages. They are always in English, even if the system's language is non-English.

ControlPanelItem, CanonicalName, GUID

  • Action Center, Microsoft.ActionCenter (Windows 7), {BB64F8A7-BEE7-4E1A-AB8D-7D8273F7FDB6}
  • Administrative Tools, Microsoft.AdministrativeTools, {D20EA4E1-3957-11d2-A40B-0C5020524153}
  • AutoPlay, Microsoft.AutoPlay, {9C60DE1E-E5FC-40f4-A487-460851A8D915}
  • Backup and Restore, Microsoft.BackupAndRestore (Windows 7), {B98A2BEA-7D42-4558-8BD1-832F41BAC6FD}
  • Biometric Devices, Microsoft.BiometricDevices (Windows 7), {0142e4d0-fb7a-11dc-ba4a-000ffe7ab428}
  • BitLocker Drive Encryption, Microsoft.BitLockerDriveEncryption, {D9EF8727-CAC2-4e60-809E-86F80A666C91}
  • Color Management, Microsoft.ColorManagement, {B2C761C6-29BC-4f19-9251-E6195265BAF1}
  • Credential Manager, Microsoft.CredentialManager (Windows 7), {1206F5F1-0569-412C-8FEC-3204630DFB70}
  • Date and Time, Microsoft.DateAndTime, {E2E7934B-DCE5-43C4-9576-7FE4F75E7480}
  • Default Location, Microsoft.DefaultLocation (Windows 7), {00C6D95F-329C-409a-81D7-C46C66EA7F33}
  • Default Programs, Microsoft.DefaultPrograms, {17cd9488-1228-4b2f-88ce-4298e93e0966}
  • Desktop Gadgets, Microsoft.DesktopGadgets (Windows 7), {37efd44d-ef8d-41b1-940d-96973a50e9e0}
  • Device Manager, Microsoft.DeviceManager, {74246bfc-4c96-11d0-abef-0020af6b0b7a}
  • Devices and Printers, Microsoft.DevicesAndPrinters (Windows 7), {A8A91A66-3A7D-4424-8D24-04E180695C7A}
  • Display, Microsoft.Display (Windows 7), {C555438B-3C23-4769-A71F-B6D3D9B6053A}
  • Ease of Access Center, Microsoft.EaseOfAccessCenter, {D555645E-D4F8-4c29-A827-D93C859C4F2A}
  • Folder Options, Microsoft.FolderOptions, {6DFD7C5C-2451-11d3-A299-00C04F8EF6AF}
  • Fonts, Microsoft.Fonts, {93412589-74D4-4E4E-AD0E-E0CB621440FD}
  • Game Controllers, Microsoft.GameControllers, {259EF4B1-E6C9-4176-B574-481532C9BCE8}
  • Get Programs, Microsoft.GetPrograms, {15eae92e-f17a-4431-9f28-805e482dafd4}
  • Getting Started, Microsoft.GettingStarted (Windows 7), {CB1B7F8C-C50A-4176-B604-9E24DEE8D4D1}
  • HomeGroup, Microsoft.HomeGroup (Windows 7), {67CA7650-96E6-4FDD-BB43-A8E774F73A57}
  • Indexing Options, Microsoft.IndexingOptions, {87D66A43-7B11-4A28-9811-C86EE395ACF7}
  • Infrared, Microsoft.Infrared (Windows 7), {A0275511-0E86-4ECA-97C2-ECD8F1221D08}
  • Internet Options, Microsoft.InternetOptions, {A3DD4F92-658A-410F-84FD-6FBBBEF2FFFE}
  • iSCSI Initiator, Microsoft.iSCSIInitiator, {A304259D-52B8-4526-8B1A-A1D6CECC8243}
  • Keyboard, Microsoft.Keyboard, {725BE8F7-668E-4C7B-8F90-46BDB0936430}
  • Location and Other Sensors, Microsoft.LocationAndOtherSensors (Windows 7), {E9950154-C418-419e-A90A-20C5287AE24B}
  • Mouse, Microsoft.Mouse, {6C8EEC18-8D75-41B2-A177-8831D59D2D50}
  • Network and Sharing Center, Microsoft.NetworkAndSharingCenter, {8E908FC9-BECC-40f6-915B-F4CA0E70D03D}
  • Notification Area Icons, Microsoft.NotificationAreaIcons (Windows 7), {05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}
  • Offline Files, Microsoft.OfflineFiles, {D24F75AA-4F2B-4D07-A3C4-469B3D9030C4}
  • Parental Controls, Microsoft.ParentalControls, {96AE8D84-A250-4520-95A5-A47A7E3C548B}
  • Pen and Touch, Microsoft.PenAndTouch (Windows 7), {F82DF8F7-8B9F-442E-A48C-818EA735FF9B}
  • People Near Me, Microsoft.PeopleNearMe, {5224F545-A443-4859-BA23-7B5A95BDC8EF}
  • Performance Information, Microsoft.PerformanceInformationAndTools, {78F3955E-3B90-4184-BD14-5397C15F1EFC}
  • Personalization, Microsoft.Personalization, {ED834ED6-4B5A-4bfe-8F11-A626DCB6A921}
  • Phone and Modem, Microsoft.PhoneAndModem (Windows 7), {40419485-C444-4567-851A-2DD7BFA1684D}
  • Power Options, Microsoft.PowerOptions, {025A5937-A6BE-4686-A844-36FE4BEC8B6D}
  • Programs and Features, Microsoft.ProgramsAndFeatures, {7b81be6a-ce2b-4676-a29e-eb907a5126c5}
  • Recovery, Microsoft.Recovery (Windows 7), {9FE63AFD-59CF-4419-9775-ABCC3849F861}
  • Region and Language, Microsoft.RegionAndLanguage (Windows 7), {62D8ED13-C9D0-4CE8-A914-47DD628FB1B0}
  • RemoteApp, Microsoft.RemoteAppAndDesktopConnections (Windows 7), {241D7C96-F8BF-4F85-B01F-E2B043341A4B}
  • Scanners and Cameras, Microsoft.ScannersAndCameras, {00f2886f-cd64-4fc9-8ec5-30ef6cdbe8c3}
  • Sound, Microsoft.Sound (Windows 7), {F2DDFC82-8F12-4CDD-B7DC-D4FE1425AA4D}
  • Speech Recognition, Microsoft.SpeechRecognition (Windows 7), {58E3C745-D971-4081-9034-86E34B30836A}
  • Sync Center, Microsoft.SyncCenter, {9C73F5E5-7AE7-4E32-A8E8-8D23B85255BF}
  • System, Microsoft.System, {BB06C0E4-D293-4f75-8A90-CB05B6477EEE}
  • Tablet PC Settings, Microsoft.TabletPCSettings, {80F3F1D5-FECA-45F3-BC32-752C152E456E}
  • Taskbar and Start Menu, Microsoft.TaskbarAndStartMenu, {0DF44EAA-FF21-4412-828E-260A8728E7F1}
  • Text to Speech, Microsoft.TextToSpeech, {D17D1D6D-CC3F-4815-8FE3-607E7D5D10B3}
  • Troubleshooting, Microsoft.Troubleshooting (Windows 7), {C58C4893-3BE0-4B45-ABB5-A63E4B8C8651}
  • User Accounts, Microsoft.UserAccounts, {60632754-c523-4b62-b45c-4172da012619}
  • Windows Anytime Upgrade, Microsoft.WindowsAnytimeUpgrade, {BE122A0E-4503-11DA-8BDE-F66BAD1E3F3A}
  • Windows CardSpace, Microsoft.CardSpace, {78CB147A-98EA-4AA6-B0DF-C8681F69341C}
  • Windows Defender, Microsoft.WindowsDefender, {D8559EB9-20C0-410E-BEDA-7ED416AECC2A}
  • Windows Firewall, Microsoft.WindowsFirewall, {4026492F-2F69-46B8-B9BF-5654FC07E423}
  • Windows Mobility Center, Microsoft.MobilityCenter, {5ea4f148-308c-46d7-98a9-49041b1dd468}
  • Windows SideShow, Microsoft.WindowsSideShow, {E95A4861-D57A-4be1-AD0F-35267E261739}
  • Windows Update, Microsoft.WindowsUpdate, {36eef7db-88ad-4e81-ad49-0e313f0c35f8}

Some of the canonical names in Windows 7 differ from those in Vista and some have been removed. {e.g.: Windows 7, Microsoft.RegionAndLanguage is different from Vista, Microsoft.RegionalAndLanguageOptions}. One that has been removed is {Windows Marketplace Microsoft.GetProgramsOnline}. The ones that differ in Vista are mapped to their counterparts in Windows 7. You might have somewhat of a different experience though.

XP and VISTA RUNDLL32.exe Commands

There are over 200 commands that you can use. I will display only a few of them. The rest will be included in a text file that will be included in the zip file.

  • Accessibility Settings: Display
    • Opens the accessibility control panel applet to the Display tab
    • RUNDLL32.EXE shell32.dll,Control_RunDLL access.cpl,,3
  • Accessibility Settings: General
    • Opens the accessibility control panel applet to the General tab
    • RUNDLL32.EXE shell32.dll,Control_RunDLL access.cpl,,5
  • Accessibility Settings: Keyboard
    • Opens the accessibility control panel applet to the keyboard tab
    • RUNDLL32.EXE shell32.dll,Control_RunDLL access.cpl,,1
  • Accessibility Settings: Mouse
    • Opens the accessibility control panel applet to the Mouse tab
    • RUNDLL32.EXE shell32.dll,Control_RunDLL access.cpl,,4
  • Accessibility Settings: Sound
    • Opens the accessibility control panel applet to the Sound tab
    • RUNDLL32.EXE shell32.dll,Control_RunDLL access.cpl,,2

In Windows XP, there are no Canonical Names. I used the WinExec command for all the XP Control Panel items. The command looks like this...

VB.NET
WinExec("RUNDLL32.EXE shell32.dll,Control_RunDLL access.cpl,,4", SW_NORMAL)

There is a multitude of different variations of this command as you will see through-out the program.

About/Help

cpa8.gif

Clicking the About/Help button brings up the CHM program pictured above. It describes what is in this article and much more in detail.

History

  • Version 1.0.0.0

Updates as of 10/10/09

  • Added Operating System detection function at startup
  • Added Windows XP Control Panel Applets and frmXP
  • Added frmWin7, work in progress

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Retired
United States United States
I am currently retired.
I have no degree but I have some programming experience
when I was in college(Cobol, Pascal).

My accomplishments thus far are;
Best VB.Net article for January(2009)
Best VB.Net article for July(2009)

Written By
Other
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralSource file Pin
drago1125-Mar-17 13:21
drago1125-Mar-17 13:21 
QuestionC# Code Pin
HELFFERCOM25-Aug-16 20:58
HELFFERCOM25-Aug-16 20:58 
GeneralMy vote of 5 Pin
Sergio Andrés Gutiérrez Rojas22-May-12 13:37
Sergio Andrés Gutiérrez Rojas22-May-12 13:37 
GeneralMy vote of 5 Pin
Manoj Kumar Choubey24-Feb-12 2:06
professionalManoj Kumar Choubey24-Feb-12 2:06 
GeneralEmail Address Pin
Euhemerus1-Mar-10 4:45
Euhemerus1-Mar-10 4:45 
GeneralRe: Email Address Pin
rspercy651-Mar-10 6:25
rspercy651-Mar-10 6:25 
QuestionCan you send me the code please? Pin
EDICON9-Jan-10 4:13
EDICON9-Jan-10 4:13 
AnswerRe: Can you send me the code please? Pin
rspercy659-Jan-10 6:54
rspercy659-Jan-10 6:54 
GeneralRe: Can you send me the code please? Pin
EDICON9-Jan-10 18:24
EDICON9-Jan-10 18:24 
GeneralRe: Can you send me the code please? Pin
Gabee827-Aug-14 23:26
Gabee827-Aug-14 23:26 
GeneralRe: Can you send me the code please? Pin
rspercy6527-Aug-14 23:54
rspercy6527-Aug-14 23:54 
GeneralRe: Can you send me the code please? Pin
Gabee84-Sep-14 19:36
Gabee84-Sep-14 19:36 
GeneralPotential solution for the code downloading problem Pin
Oleg Shilo2-Oct-09 15:11
Oleg Shilo2-Oct-09 15:11 
GeneralRe: Potential solution for the code downloading problem Pin
rspercy653-Oct-09 5:33
rspercy653-Oct-09 5:33 
QuestionCould you send me the codes in C#, please? Pin
BigWCat2-Oct-09 8:02
professionalBigWCat2-Oct-09 8:02 
Please send me the codes to giang.nguyen@dms.net. My vote of 5+.

Thanks,
AnswerRe: Could you send me the codes in C#, please? Pin
rspercy653-Oct-09 5:35
rspercy653-Oct-09 5:35 
GeneralDownload Control Panel Here [modified] Pin
rspercy6530-Sep-09 11:32
rspercy6530-Sep-09 11:32 
GeneralMy Vote of 5 Pin
Hasbi Allah30-Sep-09 3:02
Hasbi Allah30-Sep-09 3:02 
GeneralCode wanted ;-) Pin
dherrmann27-Aug-09 7:41
dherrmann27-Aug-09 7:41 
GeneralDownload file from here [modified] Pin
rspercy6518-Feb-09 13:02
rspercy6518-Feb-09 13:02 
GeneralRe: Download file from here Pin
Montoyafan14-Mar-09 6:56
Montoyafan14-Mar-09 6:56 
GeneralRe: Download file from here Pin
rspercy6514-Mar-09 11:21
rspercy6514-Mar-09 11:21 
QuestionCan you send me the code please? Pin
borchanii17-Feb-09 0:00
borchanii17-Feb-09 0:00 
AnswerRe: Can you send me the code please? Pin
rspercy6517-Feb-09 11:12
rspercy6517-Feb-09 11:12 
GeneralRe: Can you send me the code please? Pin
borchanii18-Feb-09 9:46
borchanii18-Feb-09 9:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.