Guidance
指路人
g.yi.org
software / rapidq / Examples / Memory Process Thread Message / shell / control.inc

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
' Control panel library for Rapid-Q!!!
' Version 1.0
' 3/25/01
' The name goes with the shell program name: control.exe
' I found out the arguments required to run the control panel applets!!!
' use: rundll32 <library (Shell32)>,Control_RunDLL <cplfile>
' (@)<which dialog>
' optional comma and index to display the desired tab on the dialog!

' NOTE: if you have a cpl file that dosen't take any arguments and you would like
' to display it's tabbed index, use @0, comma, <index>
' else, just use the above usage on lines 4-5.
' Not all dialogs of the Control Panel have arguments.

' If you see a sub/function that is prefixed with an 'n', it indicates that
' that dialog (applet) of the Control Panel has tabs, and the argument of the sub/function
' is the index of the tab (I think that indexing of any tab starts at 1).

' Thanks to Rudy Elyn (email: Rudy@vt4.net) for his Config program (and source);
' it served as a base to help me out in "cracking the command line".

' If you have any questions, comments, or just want to say hello, please email me at b_j0@yahoo.com :)

' It would be nice to email me if you like the library ;)

' It may not be all of them, but I did my best ;)

' The Control_RunDLL code in the shell command points out to me that there is an undocumented API
' sub/function called Control_RunDLL hiding in Shell32.dll and that it's argument(s) is/are:
'
' 1: the cpl file (located in the Windows System directory)
'
' 2: the number (tag) of the applet located in the cpl file that you wish to run (prefixed with an "@" (at) sign);
'     the "tags" of each applet start at zero (I think!)
'
' 3:  the tab to display when the applet is shown (if the applet has one)
'
'
' Oh yeah:
' - not all of the subs load applets, they can load folders too.
' - you need Windows in order for this library to work
' - I will refer to all of the applets that have tabs, as dialogs,
'   so all of them will be suffixed with Dlg
'
' - more libraries are coming soon :)

     SUB nOpenMouseDlg(index%)
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL main.cpl @0,"+STR$(index), 5)
     END SUB

     SUB nOpenKeyboardDlg(index%)
      IF index%>1 THEN index%=0
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL _
            main.cpl @1,"+STR$(index%), 5)
     END SUB

     SUB OpenPrintersFolder
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL main.cpl @2", 5)
     END SUB

     SUB OpenFontsFolder
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL main.cpl @3", 5)
     END SUB

     SUB nOpenDisplayDlg(index%)
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL desk.cpl @0,"+STR$(index%), 5)
     END SUB

     SUB OpenTimeDlg
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL timedate.cpl @0", 5)
     END SUB

     SUB nOpenDialingDlg(index%)
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL telephon.cpl @0,"+STR$(index%), 5)
     END SUB

     SUB nOpenSystemDialog(index%)
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl @0"+STR$(index%), 5)
     END SUB

     SUB OpenAddNewHardwareDlg
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl @1", 5)
     END SUB

     SUB nOpenScannerDlg(index%)
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL sticpl.cpl @0", 5)
     END SUB

     SUB OpenThemesDlg
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL themes.cpl @0", 5)
     END SUB

     SUB nOpenAddRemoveProgramsDlg(index%)
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl @0,"+STR$(index%), 5)
     END SUB

     SUB nOpenPowerMgmtDlg(index%)
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL powercfg.cpl @0,"+STR$(index%), 5)
     END SUB

     SUB nOpenPasswordsDlg(index%)
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL password.cpl @0,"+STR$(index%), 5)
     END SUB

     SUB nOpenModemDlg(index%)
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL modem.cpl @0,"+STR$(index%), 5)
     END SUB

     SUB nOpenMMDeviceDlg(index%)
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl @0,"+STR$(index), 5)
     END SUB

     SUB OpenSoundsDlg
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl @1", 5)
     END SUB

     SUB nOpenGamesDlg(index%)
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL joy.cpl @0,"+STR$(index%), 5)
     END SUB

     SUB nOpenRegionalDlg(index%)
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL intl.cpl @0,"+STR$(index%), 5)
     END SUB

     SUB nOpenInternetDlg(index%)
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl @0,"+STR$(index%), 5)
     END SUB

     SUB nOpenUsersDlg(index%)
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl @1,"+STR$(index%), 5)
     END SUB

' Only if one has TweakUI98 (or greater?) installed
' this one is not configured to accept arguments to display tabs at index%
     SUB OpenTweakUIDlg
      PID = SHELL("rundll32.exe shell32.dll,Control_RunDLL tweakui.cpl @0", 5)
     END SUB
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2019-7-20  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-02-20 21:42:08