Control Panel Applet Execution Command Line Syntax

223 Views Asked by At

I'm trying to invoke Internet Options Control Panel applet through command line (Run dialogue). Specifically, the "Connections" tab.

I used the following syntax:

rundll32.exe shell32.dll,Control_RunDLL INETCPL.CPL,,4

Which worked fine. My question is 2-fold:

  1. For the "Control_RunDLL" function, what is the 2nd parameter it takes?

(In my cases, and in all the documentation I found, it's NULL or empty)

(1st parameter being the applet name, and the 3rd being the tab number)

  1. Where can I access Microsoft documentation that specifically mentions the 2nd parameter?
2

There are 2 best solutions below

0
On

Control_RunDLL is a private shell function, it is not documented. We still know its parameters because all rundll32 functions look like this:

void CALLBACK FunctionName(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow); 

This means it is something deeper inside shell32 that parses the command line parameters.

As you found out on your own, .cpl files can support more than one control panel "applet":

When Control Panel loads a .dll (or .cpl) file, it calls the CPlApplet function to get information such as the number of Control Panel items the file hosts, as well as information about each item.

Shell32 simply pretends to be the control panel when it "hosts" a .cpl file.

The 2nd parameter is known as the "The dialog box number" in the documentation and is represented by a icon in the classic/all control panel view. The 3rd parameter is parsed by the applet itself in response to CPL_STARTWPARMS and is often a name or number specifying a particular tab in a property sheet dialog.

The connections tab is documented as page 4 and the documented way to show it on Vista and later is

control.exe /name Microsoft.InternetOptions /page 4
0
On