HOWTO: Start a Control Panel Applet in Windows 95, 98, or WinNT

ID: Q135068

The information in this article applies to:

SUMMARY

Applications running under Windows 95, Windows 98, or Windows NT 4.0 can start a Control Panel applet by using the RUNDLL32 utility.

MORE INFORMATION

RUNDLL32 is a utility included with Windows 95, Windows 98, and Windows NT 4.0 that allows you to start a function that is exported from a DLL from a command-line. The shell uses RUNDLL32 to call the Control_RunDLL function in Shell32.dll to start a Control Panel applet. Applications can use the following command line to start a Control Panel applet:

   rundll32.exe shell32.dll,Control_RunDLL mycontrol.cpl

NOTE: The command "Control_RunDLL" is case sensitive and must exactly match the case shown.

This starts the first control panel applet in Mycontrol.cpl. If you have multiple control panel applets in Mycontrol.cpl, you need to add to the following line exactly as shown:

   rundll32.exe shell32.dll,Control_RunDLL mycontrol.cpl,@1

@1 specifies the second (zero-based) applet in the .cpl file. If you don't specify this parameter, @0 is used by default.

The final (optional) parameter serves as the command line parameters passed to the Control Panel applet in the CPL_STARTWPARM notification. For example, some of the system's Control Panel applets take the page number (one based, not zero based) as the command line parameter. For example, if you wan to start the Add/Remove Programs applet from the Windows Setup page so you can instruct the user to add extra system components, you can use this code:

   rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,@0,2

NOTE: If you put a space after the comma in the commands above, the following error message will appear:

   Error in shell32.dll
   Missing entry.

REFERENCES

For additional information, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q166168
   TITLE     : HOWTO: Use RUNDLL32 to Debug Control Panel Applets

   ARTICLE-ID: Q164787
   TITLE     : INFO: The Windows 95 Rundll and Rundll32 Interface

Additional query words: Windows 95 debug CPL Keywords : kbhw kbCPApplet kbCtrl kbNTOS400 kbGrpUser kbWinOS95 kbWinOS98

Last Reviewed: January 2, 1999