Mega Code Archive

 
Categories / Delphi / Examples
 

Running Control Panel Applets

Title: Running Control Panel Applets Question: How can I run control panel applets that are inside a cpl? Answer: I was once asked how to run the 'hidden' control panel applets like the sound association panel and keyboard panel. As these are hidded inside cpl's. Well I found the answer from the windows information base. Below is a sample setup for running the sound pannel function RunControlPanelApplet(const sAppletFileName: string): integer; begin Result := WinExec(PChar('rundll32.exe shell32.dll,' + 'Control_RunDLL ' + sAppletFileName), SW_SHOWNORMAL); End; then call like this in a button click property RunControlPanelApplet('mmsys.cpl,Sounds'); To use the extended put a ',' straight after the cpl then the name of the panel you want eg Sounds bellow i list all the possabilitys telephon.cpl,Telephony ups.cpl,&UPS telephon.cpl,Telephony srvmgr.cpl,Ser&ver srvmgr.cpl,Servi&ces srvmgr.cpl,&Devices ncpa.cpl,Network main.cpl,Mouse main.cpl,Keyboard main.cpl,Printers main.cpl,Fonts odbccp32.cpl,OD&BC console.cpl,Console appwiz.cpl,Add/Remove Programs access.cpl,Accessibility Options inetcpl.cpl,Internet DESK.CPL,Display DEVAPPS.CPL,PC Card (PCMCIA) DEVAPPS.CPL,SCSI Adapters DEVAPPS.CPL,Tape Devices INTL.CPL,Regional Settings MMSYS.CPL,Multimedia MMSYS.CPL,Sounds MODEM.CPL,Modems PORTS.CPL,Ports SYSDM.CPL,System TIMEDATE.CPL,Date/Time NOTE not all cpl's are avalible on every machine, so you should do a call to see if they are there before using them!