//TH-Header //***************************************************************************************** // Copyright (c) 2003 Antwise Solutions // All rights reserved. // // $FileName : cControlPanel.pkg // $ProjectName : For fun and pleasure // $Authors : Wil van Antwerpen // $Created : 04.08.2003 22:48 // $Type : LGPL // // Contents: A little library to start the control panel // applets //***************************************************************************************** //TH-RevisionStart //TH-RevisionEnd Enum_List Define C_RunBackground Define C_RunWait Define C_RunNormal End_Enum_List Enum_List Define C_RunDLL Define C_RunDLLDefault Define C_RunDLLHelpShortcuts Define C_RunDLLControl End_Enum_List // The regional settings panel Define CPL_RegionalSettings For "intl.cpl,," // The odbc administrator Define CPL_OdbcAdministrator For "odbccp32.cpl" // The odbc instal //Define CPL_OdbcInst For "odbcinst.dll" // The Add New Hardware wizard Define CPL_AddNewHardware For "sysdm.cpl,Add New Hardware" // The accessibility settings Define CPL_Accessibility For "access.cpl" // Add/Remove Programs wizard Define CPL_AddRemovePrograms For "appwiz.cpl" // Create a new briefcase on the desktop Define CPL_NewBriefcase For "syncui.dll,Briefcase_Create" // Show DateTime Define CPL_DateTime For "timedate.cpl" // Copy Disk Dialog for removable media Define CPL_CopyDiskDialog For "diskcopy.dll,DiskCopyRunDll" // Display the desktop Define CPL_DisplayDesktop For "desk.cpl" // Display the Appearance tabpage on the Display Properties Panel Define CPL_DisplayAppearance For "color" // Dialup Network Wizard Define CPL_DialupNetworkWiz For " rnaui.dll,RnaWizard" // Fonts Define CPL_Fonts For "main.cpl,Fonts" // Keyboard Define CPL_Keyboard For "main.cpl,Keyboard" // Internet Properties Define CPL_InternetProperties For "INETCPL.CPL" // Mail and Fax Define CPL_MailAndFax For "mlcfg32.cpl" // Microsoft Mail Postoffice Define CPL_MSMailPostoffice For "wgpocpl.cpl" // Modems Define CPL_Modems For "modem.cpl" // Mouse Define CPL_Mouse For "mouse" // Multimedia Define CPL_Multimedia For "mmsys.cpl" // Windows 95 Network Define CPL_Win95Network For "netcpl.cpl" // Windows NT Network Define CPL_WinNTNetwork For "ncpa.cpl" // Password Define CPL_Password For "password.cpl" // Printers Define CPL_Printers For "Printers" // Sounds Define CPL_Sounds For "mmsys.cpl,Sounds" // System Define CPL_System For "sysdm.cpl" // Add New Printer Wizard Define CPL_AddPrinter For "AddPrinter" // Map Network Drive Define CPL_MapNetworkDrive For "Connect" // Disconnect Network Drive Define CPL_DisconnectNetworkDrive For "Disconnect" // Format Drive Define CPL_FormatDrive For "shell32.dll,SHFormatDrive" //*** NT Specific (and later) applets *** // Console Define CPL_Console For "console.cpl,Console" // PCMCIA Define CPL_PCMCIA For "devapps.cpl,@0" // Devices Define CPL_Devices For "srvmgr.cpl,Devices" // Ports Define CPL_Ports For "ports.cpl" // SCSI Define CPL_SCSI For "devapps.cpl,@1" // Server Define CPL_Server For "srvmgr.cpl,Server" // Services Define CPL_Services For "srvmgr.cpl,Services" // Tape Devices Define CPL_Tape For "devapps.cpl,@2" // Telephony Define CPL_Telephony For "telephon.cpl" // UPS Define CPL_UPS For "ups.cpl,UPS" //*** Windows 2000 and later // Folder settings Control Panel Define CPL_Folders For "folders" // Novell Netware Control Panel Define CPL_Netware For "netware" // Administratie Tools Folders Define CPL_AdminTools For "admintools" // Scheduled Tasks Define CPL_ScheduledTasks For "schedtasks" // Network and dialup connections Define CPL_NetworkDialup For "netconnections" // Infrared Define CPL_Infrared For "infrared" // Users and Passwords Control Panel Define CPL_UsersAndPasswords For "userpasswords" //*** Windows XP and later Define CPL_NetConnectWizard For "netshell,startNcw" Class cControlPanel Is a DfObject //Insert your Properties here. Procedure Construct_Object Forward Send Construct_Object Property Integer peRunMode Public C_RunBackground Property Integer peRunDLL Public C_RunDLLDefault End_Procedure // Start the actual panel. // // You are not supposed to call this method directly Procedure StartPanel String sParam Integer iRunMode iRunDLL String sRunDLL String sCommand Get peRunMode To iRunMode Get peRunDLL To iRunDLL If (iRunDLL = C_RunDLLDefault) Begin Move ("shell32.dll,Control_RunDLL "+sParam) To sParam Move "rundll32.exe" To sCommand End Else If (iRunDLL = C_RunDLLHelpShortcuts) Begin Move ("shell32.dll,SHHelpShortcuts_RunDLL "+sParam) To sParam Move "rundll32.exe" To sCommand End Else If (iRunDLL = C_RunDLL) Begin Move "rundll32.exe" To sCommand End Else If (iRunDLL = C_RunDLLControl) Begin Move "control.exe" To sCommand End //Showln sCommand " [" sParam "]" If (iRunMode = C_RunBackground) Begin // We cannot use the runprogram command here as that command // lowercases the parameters. This does not work because the // rundll commands are case-sensitive. Send vShellExecute "OPEN" sCommand sParam "" End Else If (iRunMode = C_RunWait) Begin Runprogram Wait sParam End Else If (iRunMode = C_RunNormal) Begin Runprogram sParam End End_Procedure // StartPanel // Opens the Regional Settings Control Panel // // module: INTL.CPL // // Where iPage is optional // iPage = 0 // Displays the Regional Settings Property page // // iPage = 1 // Displays the Numbers Property page // // iPage = 2 // Displays the Currency Property page // // iPage = 3 // Displays the Time Property page // // iPage = 4 // Displays the Date Property page // Procedure OpenRegionalSettings Integer iPage String sPage Set peRunDLL To C_RunDLLDefault If (Num_Arguments=0) Move "0" To sPage Else If ((iPage<0) Or (iPage>4)) Begin Move "0" To sPage End Else Move (String(iPage)) To sPage Send StartPanel (CPL_RegionalSettings+sPage) End_Procedure // OpenRegionalSettings Procedure OpenOdbcAdministrator Integer iPage String sPage Set peRunDLL To C_RunDLLDefault If (Num_Arguments=0) Move "0" To sPage Else If ((iPage<0) Or (iPage>6)) Begin Move "0" To sPage End Else Move (String(iPage)) To sPage Send StartPanel CPL_OdbcAdministrator End_Procedure // OpenOdbcAdministrator Procedure OpenCopyDiskDialog Set peRunDLL To C_RunDLL Send StartPanel CPL_CopyDiskDialog End_Procedure // OpenCopyDiskDialog Procedure OpenDialupNetworkWizard Set peRunDLL To C_RunDLL Send StartPanel CPL_DialupNetworkWiz End_Procedure // OpenDialupNetworkWizard Procedure OpenFonts Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_Fonts End_Procedure // OpenFonts Procedure OpenKeyboard Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_Keyboard End_Procedure // OpenKeyboard Procedure OpenInternetProperties Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_InternetProperties End_Procedure // OpenInternetProperties Procedure OpenMailAndFax Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_MailAndFax End_Procedure // OpenMailAndFax Procedure OpenMailPostOffice Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_MSMailPostoffice End_Procedure // OpenMailPostOffice Procedure OpenModems Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_Modems End_Procedure // OpenModems Procedure OpenMouse Set peRunDLL To C_RunDLLControl Send StartPanel CPL_Mouse End_Procedure // OpenMouse Procedure OpenMultiMedia Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_Multimedia End_Procedure // OpenMultiMedia Procedure OpenWindows95Network Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_Win95Network End_Procedure // OpenWindows95Network Procedure OpenWindowsNTNetwork Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_WinNTNetwork End_Procedure // OpenWindowsNTNetwork // Procedure OpenOdbcInst // Set peRunDLL To C_RunDLLDefault // Send StartPanel CPL_OdbcInst // End_Procedure // OpenOdbcInst // Procedure OpenPassword Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_Password End_Procedure // OpenPassword Procedure OpenPrinters Set peRunDLL To C_RunDLLControl Send StartPanel CPL_Printers End_Procedure // OpenPrinters Procedure OpenSounds Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_Sounds End_Procedure // OpenSounds Procedure OpenSystem Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_System End_Procedure // OpenSystem Procedure OpenAddNewPrinter Set peRunDLL To C_RunDLLHelpShortcuts Send StartPanel CPL_AddPrinter End_Procedure // OpenAddNewPrinter Procedure OpenMapNetworkDrive Set peRunDLL To C_RunDLLHelpShortcuts Send StartPanel CPL_MapNetworkDrive End_Procedure // OpenMapNetworkDrive Procedure OpenDisconnectNetworkDrive Set peRunDLL To C_RunDLLHelpShortcuts Send StartPanel CPL_DisconnectNetworkDrive End_Procedure // OpenDisconnectNetworkDrive Procedure OpenFormatDrive Set peRunDLL To C_RunDLL Send StartPanel CPL_FormatDrive End_Procedure // OpenFormatDrive Procedure OpenConsole Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_Console End_Procedure // OpenConsole Procedure OpenPCMCIA Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_PCMCIA End_Procedure // OpenPCMCIA Procedure OpenDevices Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_Devices End_Procedure // OpenDevices Procedure OpenPorts Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_Ports End_Procedure // OpenPorts Procedure OpenSCSI Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_SCSI End_Procedure // OpenSCSI Procedure OpenServer Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_Server End_Procedure // OpenServer Procedure OpenServices Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_Services End_Procedure // OpenServices Procedure OpenTelephony Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_Telephony End_Procedure // OpenTelephony Procedure OpenUPS Set peRunDLL To C_RunDLLDefault Send StartPanel CPL_UPS End_Procedure // OpenUPS Procedure OpenFolderSettings Set peRunDLL To C_RunDLLControl Send StartPanel CPL_Folders End_Procedure // OpenFolderSettings Procedure OpenNetware Set peRunDLL To C_RunDLLControl Send StartPanel CPL_Netware End_Procedure // OpenNetware Procedure OpenAdminTools Set peRunDLL To C_RunDLLControl Send StartPanel CPL_AdminTools End_Procedure // OpenAdminTools Procedure OpenScheduledTasks Set peRunDLL To C_RunDLLControl Send StartPanel CPL_ScheduledTasks End_Procedure // OpenScheduledTasks Procedure OpenNetworkDialup Set peRunDLL To C_RunDLLControl Send StartPanel CPL_NetworkDialup End_Procedure // OpenNetworkDialup Procedure OpenInfrared Set peRunDLL To C_RunDLLControl Send StartPanel CPL_Infrared End_Procedure // OpenInfrared Procedure OpenUsersAndPasswords Set peRunDLL To C_RunDLLControl Send StartPanel CPL_UsersAndPasswords End_Procedure // OpenUsersAndPasswords Procedure OpenNetConnectWizard Set peRunDLL To C_RunDLL Send StartPanel CPL_NetConnectWizard End_Procedure // OpenNetConnectWizard End_Class // cControlPanel