Open a Control Panel dialog or wizard

Open a Control Panel dialog or wizard

Have you ever needed to open a Windows dialog such as Internet Properties, New Hardware, Modem Properties or any other dialog you can find in the Control Panel? Well, it’s very simple, onve you know the trick.

All these dialogs are implemented in files with the CPL extension. (They’re actually DLLs with their extension changed.) All you have to do is call the appropriate function in these DLLs. Windows provides an application called “rundll32.exe” – located in Windows main directory – that allows you to do that. For example, to open the Mouse Properties dialog you should write this line in the Run dialog:

rundll32.exe shell32.dll,Control_RunDLL main.cpl @0

If you know the correct syntax, you can open these dialogs from your applications as well. here is a routine that can open most of the Control Panel dialogs. It takes a value specified in a Enum list and uses it to determine the correct string to pass to “rundll32.exe”, then passes the full commnad line to the Shell function:

Public Enum mbDialogType    mbNewHardware    mbAddRemove    mbDateTimeProp    mbDisplayProp    mbInternetProp    mbGameProp    mbKeyboardProp    mbModemProp    mbMouseProp    mbMultimediaProp    mbNetworkProp    mbPasswordProp    mbInternationalProp    mbSoundProp    mbSystemPropEnd Enum         Sub OpenWindowsDialog(ByVal mbDialog As mbDialogType)    Dim s As String    Select Case mbDialog        Case mbNewHardware: s = "sysdm.cpl @1"        Case mbAddRemove: s = "appwiz.cpl,,1"        Case mbDateTimeProp: s = "timedate.cpl"        Case mbDisplayProp: s = "desk.cpl,,0"        Case mbInternetProp: s = "inetcpl.cpl,,0"        Case mbGameProp: s = "joy.cpl"        Case mbKeyboardProp: s = "main.cpl @1"        Case mbModemProp: s = "modem.cpl"        Case mbMouseProp: s = "main.cpl @0"        Case mbMultimediaProp: s = "mmsys.cpl,,0"        Case mbNetworkProp: s = "netcpl.cpl"        Case mbPasswordProp: s = "password.cpl"        Case mbInternationalProp: s = "intl.cpl,,0"        Case mbSoundProp: s = "mmsys.cpl @1"        Case mbSystemProp: s = "sysdm.cpl,,0"    End Select    Shell "rundll32.exe shell32.dll,Control_RunDLL " & s, 5End Sub

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes