Running Control Panel Applets

- Alyce Alyce Nov 17, 2011 http://alycesrestaurant.com/
Running Control Panel Applets | Example Program | The Command List
Windows computers come with several management functions in the form of small programs . We can invoke these applets with our Liberty BASIC code. We can cause things like the control panel, desktop settings, and accessibility options applets to run.

The control panel looks like this:

controlpanel.jpg

The desktop properties dialog looks like this:

displayproperties.jpg

The following commands show how to use rundll32.exe to invoke these applets. Control panel applets have the extension *.cpl. Most of the examples come from the shell32.dll, but there are a few other goodies in the list.

These commands simply call up dialogs. They do not cause any changes to be made to the user's computer. The user can make changes in the dialogs, or cancel them.

Example Program


The example runs the display settings dialog. The applet is "desk.cpl".

Print "Showing Display Settings Properties."
 
'To Show the Display Settings Properties
run "rundll32.exe shell32.dll Control_RunDLL desk.cpl"
 
Print "Done"

The Command List

The following RUN commands are meant to be used individually. Do not attempt to run the entire code below as is. Extract the commands you need and insert them into your code in appropriate places, one at a time. The comments accompanying each RUN command explain the functions.

' To Display the Control Panel
run "rundll32.exe shell32.dll Control_RunDLL"
 
' To Display Add/Remove Programs
run "rundll32.exe shell32.dll Control_RunDLL appwiz.cpl"
 
'To Display System Properties
run "rundll32.exe shell32.dll Control_RunDLL sysdm.cpl"  
 
' To Display the Accessibility Properties
run "rundll32.exe shell32.dll Control_RunDLL access.cpl"
 
'To Show the Display Settings Properties
run "rundll32.exe shell32.dll Control_RunDLL desk.cpl"
 
'To Display Internet Explorer Control Panet
run "rundll32.exe shell32.dll Control_RunDLL inetcpl.cpl"  
 
'To Display Regional Settings
run "rundll32.exe shell32.dll Control_RunDLL intl.cpl"  
 
'To Display the Mouse Settings
run "rundll32.exe shell32.dll Control_RunDLL main.cpl @0"  
 
'To Display the Keyboard Settings
run "rundll32.exe shell32.dll Control_RunDLL main.cpl @1"  
 
'To Display the Joystick Settings
run "rundll32.exe shell32.dll Control_RunDLL joy.cpl"  
 
'To Display Multimedia Settings
run "rundll32.exe shell32.dll Control_RunDLL mmsys.cpl"  
 
'To Display Modem Settings
run "rundll32.exe shell32.dll Control_RunDLL modem.cpl"  
 
'To Display 'Add New Printer' Wizard 
run "rundll32.exe shell32.dll SHHelpShortcuts_RunDLL AddPrinter"  
 
'To Display Time/Date Settings
run "rundll32.exe shell32.dll Control_RunDLL timedate.cpl"  
 
'To display the Copy Disk dialog for removable media
run "rundll32.exe diskcopy.dll DiskCopyRunDll"
 
'To Display the floppy disk Format Drive dialog.
run "rundll32.exe shell32.dll SHFormatDrive"
 
'To create a new Briefcase on the desktop
run "rundll32.exe syncui.dll,Briefcase_Create "
 
'To Display Fonts Folder
run "rundll32.exe shell32.dll SHHelpShortcuts_RunDLL FontsFolder"
 
'To Display the Printers Folder
run "rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL PrintersFolder"  
 
'To Display the Application/File "Open With" dialog 
'--passing the full file drive, path and name as a parameter will 
'--cause the dialog to display the line 
'"Click the program you want to use to open the file '{filename}'". 
'--note that the filename given as the last argument MUST be the name
'--of an existing file on disk
run "rundll32.exe shell32.dll,OpenAs_RunDLL c:\my documents\test.bas"
 
'To Display Themes Applet, if installed
run "rundll32.exe shell32.dll,Control_RunDLL themes.cpl" 
 
'To Display Telephony Properties
run "rundll32.exe shell32.dll,Control_RunDLL telephon.cpl"
 
'To Display Office FindFast, if installed
run "rundll32.exe shell32.dll Control_RunDLL findfast.cpl"       


Running Control Panel Applets | Example Program | The Command List