home *** CD-ROM | disk | FTP | other *** search
/ BUG 11 / BUGCD1998_02.ISO / util / time2win / t2w32500.exe / _REGISTR.FRM < prev    next >
Text File  |  1997-12-25  |  14KB  |  359 lines

  1. VERSION 5.00
  2. Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0"; "THREED32.OCX"
  3. Begin VB.Form frmRegistry 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Registry"
  6.    ClientHeight    =   4845
  7.    ClientLeft      =   1890
  8.    ClientTop       =   3270
  9.    ClientWidth     =   7485
  10.    MaxButton       =   0   'False
  11.    MDIChild        =   -1  'True
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   4845
  14.    ScaleWidth      =   7485
  15.    ShowInTaskbar   =   0   'False
  16.    Begin VB.TextBox txt_Result 
  17.       BackColor       =   &H00C0C0C0&
  18.       BorderStyle     =   0  'None
  19.       Height          =   4110
  20.       Left            =   105
  21.       Locked          =   -1  'True
  22.       MultiLine       =   -1  'True
  23.       ScrollBars      =   2  'Vertical
  24.       TabIndex        =   6
  25.       Top             =   630
  26.       Width           =   7260
  27.    End
  28.    Begin Threed.SSPanel SSPanel1 
  29.       Align           =   1  'Align Top
  30.       Height          =   480
  31.       Left            =   0
  32.       TabIndex        =   0
  33.       Top             =   0
  34.       Width           =   7485
  35.       _Version        =   65536
  36.       _ExtentX        =   13203
  37.       _ExtentY        =   847
  38.       _StockProps     =   15
  39.       ForeColor       =   -2147483640
  40.       BackColor       =   12632256
  41.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  42.          Name            =   "MS Sans Serif"
  43.          Size            =   8.25
  44.          Charset         =   0
  45.          Weight          =   400
  46.          Underline       =   0   'False
  47.          Italic          =   0   'False
  48.          Strikethrough   =   0   'False
  49.       EndProperty
  50.       Begin VB.ComboBox cmb_Function 
  51.          Height          =   315
  52.          Left            =   1365
  53.          TabIndex        =   1
  54.          Top             =   90
  55.          Width           =   4785
  56.       End
  57.       Begin Threed.SSCommand cmdNP 
  58.          Height          =   300
  59.          Index           =   1
  60.          Left            =   7140
  61.          TabIndex        =   5
  62.          Top             =   90
  63.          Width           =   255
  64.          _Version        =   65536
  65.          _ExtentX        =   450
  66.          _ExtentY        =   529
  67.          _StockProps     =   78
  68.          Caption         =   ">"
  69.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  70.             Name            =   "MS Sans Serif"
  71.             Size            =   8.25
  72.             Charset         =   0
  73.             Weight          =   400
  74.             Underline       =   0   'False
  75.             Italic          =   0   'False
  76.             Strikethrough   =   0   'False
  77.          EndProperty
  78.          BevelWidth      =   1
  79.          Font3D          =   3
  80.          RoundedCorners  =   0   'False
  81.          Outline         =   0   'False
  82.       End
  83.       Begin Threed.SSCommand cmdNP 
  84.          Height          =   300
  85.          Index           =   0
  86.          Left            =   6300
  87.          TabIndex        =   4
  88.          Top             =   90
  89.          Width           =   255
  90.          _Version        =   65536
  91.          _ExtentX        =   450
  92.          _ExtentY        =   529
  93.          _StockProps     =   78
  94.          Caption         =   "<"
  95.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  96.             Name            =   "MS Sans Serif"
  97.             Size            =   8.25
  98.             Charset         =   0
  99.             Weight          =   400
  100.             Underline       =   0   'False
  101.             Italic          =   0   'False
  102.             Strikethrough   =   0   'False
  103.          EndProperty
  104.          BevelWidth      =   1
  105.          Font3D          =   3
  106.          RoundedCorners  =   0   'False
  107.          Outline         =   0   'False
  108.       End
  109.       Begin Threed.SSCommand SSCommand1 
  110.          Default         =   -1  'True
  111.          Height          =   300
  112.          Left            =   6615
  113.          TabIndex        =   2
  114.          Top             =   90
  115.          Width           =   465
  116.          _Version        =   65536
  117.          _ExtentX        =   820
  118.          _ExtentY        =   529
  119.          _StockProps     =   78
  120.          Caption         =   "&Go"
  121.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  122.             Name            =   "MS Sans Serif"
  123.             Size            =   8.25
  124.             Charset         =   0
  125.             Weight          =   400
  126.             Underline       =   0   'False
  127.             Italic          =   0   'False
  128.             Strikethrough   =   0   'False
  129.          EndProperty
  130.          BevelWidth      =   1
  131.          RoundedCorners  =   0   'False
  132.          Outline         =   0   'False
  133.       End
  134.       Begin VB.Label Label2 
  135.          Caption         =   "&Select a function"
  136.          Height          =   255
  137.          Left            =   90
  138.          TabIndex        =   3
  139.          Top             =   120
  140.          Width           =   1275
  141.       End
  142.    End
  143. End
  144. Attribute VB_Name = "frmRegistry"
  145. Attribute VB_GlobalNameSpace = False
  146. Attribute VB_Creatable = False
  147. Attribute VB_PredeclaredId = True
  148. Attribute VB_Exposed = False
  149. Option Explicit
  150. Option Base 1
  151.  
  152. Private Const Iteration = 250
  153.  
  154. Dim IsLoaded         As Integer
  155.  
  156. Dim TimerStartOk     As Integer
  157. Dim TimerCloseOk     As Integer
  158.  
  159. Dim TimerHandle      As Integer
  160. Dim TimerValue       As Long
  161.  
  162. Private Sub cmdNP_Click(Index As Integer)
  163.  
  164.    Call sub_NextPrev(cmb_Function, Index)
  165.  
  166. End Sub
  167.  
  168.  
  169. Private Sub cmb_Function_Click()
  170.    
  171.    If (IsLoaded = False) Then Exit Sub
  172.    
  173.    Call cDisableFI(mdiT2W.Picture1)
  174.    
  175.    txt_Result = ""
  176.    
  177.    DoEvents
  178.    
  179.    Select Case cmb_Function.ListIndex
  180.       Case 0
  181.          Call TestRegistry
  182.       Case 1
  183.          Call TestRegistryExt
  184.    End Select
  185.  
  186.    DoEvents
  187.    Call cEnableFI(mdiT2W.Picture1)
  188.    
  189. End Sub
  190.  
  191.  
  192. Private Sub Form_Activate()
  193.  
  194.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  195.  
  196. End Sub
  197.  
  198. Private Sub Form_Load()
  199.  
  200.    IsLoaded = False
  201.    
  202.    Show
  203.  
  204.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_registr.t2w")
  205.    
  206.    IsLoaded = True
  207.    
  208. End Sub
  209.  
  210.  
  211. Private Sub SSCommand1_Click()
  212.    
  213.    Call cmb_Function_Click
  214.    
  215. End Sub
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223. Private Sub TestRegistry()
  224.  
  225.    Dim intResult        As Integer
  226.    Dim strResult        As String
  227.    Dim strDisplay       As String
  228.    
  229.    Dim Section1         As String
  230.    Dim Section2         As String
  231.    
  232.    Dim i                As Integer
  233.    
  234.    strResult = ""
  235.    strDisplay = ""
  236.    
  237.    strDisplay = strDisplay & "HKEY_CURRENT_USER" & vbCrLf & vbCrLf
  238.    
  239.    Section1 = "under the fox"
  240.    Section2 = "software\The MCR Company\TIME TO WIN for VB 4.0"
  241.    
  242.    strDisplay = strDisplay & "Use section '" & Section1 & "'" & vbCrLf & vbCrLf
  243.    
  244.    strDisplay = strDisplay & "Setting default value to 'no key' is '" & cPutRegistry(Section1, "", "no key") & "'" & vbCrLf
  245.    strDisplay = strDisplay & "Setting value of key 'key1' to 'test key 1' is '" & cPutRegistry(Section1, "key1", "test key 1") & "'" & vbCrLf
  246.    strDisplay = strDisplay & "Setting value of key 'key2' to 'test key 2' is '" & cPutRegistry(Section1, "key2", "test key 2") & "'" & vbCrLf & vbCrLf
  247.    
  248.    strDisplay = strDisplay & "Getting default value is '" & cGetRegistry(Section1, "", "?") & "'" & vbCrLf
  249.    strDisplay = strDisplay & "Getting value of key 'key2' is '" & cGetRegistry(Section1, "key2", "?") & "'" & vbCrLf
  250.    strDisplay = strDisplay & "Getting value of key 'key1' is '" & cGetRegistry(Section1, "key1", "?") & "'" & vbCrLf & vbCrLf
  251.    
  252.    strDisplay = strDisplay & "Use section '" & Section2 & "'" & vbCrLf & vbCrLf
  253.    
  254.    strDisplay = strDisplay & "Setting default value to 'License information' is '" & cPutRegistry(Section2, "", "License information") & "'" & vbCrLf
  255.    strDisplay = strDisplay & "Setting value of key 'Name' to 'James' is '" & cPutRegistry(Section2, "Name", "James") & "'" & vbCrLf
  256.    strDisplay = strDisplay & "Setting value of key 'Id' to 'Donb' is '" & cPutRegistry(Section2, "Id", "Donb") & "'" & vbCrLf
  257.    strDisplay = strDisplay & "Setting value of key 'N░' to '007' is '" & cPutRegistry(Section2, "N░", "007") & "'" & vbCrLf & vbCrLf
  258.    
  259.    strDisplay = strDisplay & "Getting default value is '" & cGetRegistry(Section2, "", "?") & "'" & vbCrLf
  260.    strDisplay = strDisplay & "Getting value of key 'Name' is '" & cGetRegistry(Section2, "Name", "?") & "'" & vbCrLf
  261.    strDisplay = strDisplay & "Getting value of key 'Id' is '" & cGetRegistry(Section2, "Id", "?") & "'" & vbCrLf
  262.    strDisplay = strDisplay & "Getting value of key 'N░' is '" & cGetRegistry(Section2, "N░", "?") & "'" & vbCrLf & vbCrLf
  263.    
  264.    strDisplay = strDisplay & "Kill Section 'under the fox' is '" & cKillRegistry(Section1, "") & "'" & vbCrLf & vbCrLf
  265.    strDisplay = strDisplay & "Kill Section 'software\The MCR Company' is '" & cKillRegistry("software\The MCR Company", "") & "'" & vbCrLf & vbCrLf
  266.    strDisplay = strDisplay & "Kill Section 'software\The MCR Company\TIME TO WIN for VB 4.0' is '" & cKillRegistry("software\The MCR Company\TIME TO WIN for VB 4.0", "") & "'" & vbCrLf & vbCrLf
  267.    
  268.    txt_Result = strDisplay
  269.    
  270.    'time the function
  271.  
  272.    intResult = cPutRegistry(Section2, "Name", "James")
  273.  
  274.    TimerHandle = cTimerOpen()
  275.    TimerStartOk = cTimerStart(TimerHandle)
  276.    
  277.    For i = 1 To Iteration
  278.       strResult = cGetRegistry(Section2, "", "?1")
  279.    Next i
  280.    
  281.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  282.    
  283.    TimerCloseOk = cTimerClose(TimerHandle)
  284.    
  285.    intResult = cKillRegistry("software\The MCR Company", "")
  286.  
  287. End Sub
  288.  
  289.  
  290.  
  291. Private Sub TestRegistryExt()
  292.  
  293.    Dim intResult        As Integer
  294.    Dim strResult        As String
  295.    Dim strDisplay       As String
  296.    
  297.    Dim Section1         As String
  298.    Dim Section2         As String
  299.    
  300.    Dim i                As Integer
  301.    
  302.    strResult = ""
  303.    strDisplay = ""
  304.    
  305.    strDisplay = strDisplay & "HKEY_LOCAL_MACHINE" & vbCrLf & vbCrLf
  306.    
  307.    strDisplay = strDisplay & "   (" & cGetRegistryExt(RK_HKEY_LOCAL_MACHINE, "HARDWARE\DESCRIPTION\System\CentralProcessor\0", "Identifier", "?") & ")" & vbCrLf
  308.    strDisplay = strDisplay & "   (" & cGetRegistryExt(RK_HKEY_LOCAL_MACHINE, "HARDWARE\DESCRIPTION\System\CentralProcessor\0", "VendorIdentifier", "?") & ")" & vbCrLf & vbCrLf
  309.    
  310.    Section1 = "under the fox"
  311.    Section2 = "software\The MCR Company\TIME TO WIN for VB 4.0"
  312.    
  313.    strDisplay = strDisplay & "Use section '" & Section1 & "'" & vbCrLf & vbCrLf
  314.    
  315.    strDisplay = strDisplay & "Setting default value to 'no key' is '" & cPutRegistryExt(RK_HKEY_LOCAL_MACHINE, Section1, "", "no key") & "'" & vbCrLf
  316.    strDisplay = strDisplay & "Setting value of key 'key1' to 'test key 1' is '" & cPutRegistryExt(RK_HKEY_LOCAL_MACHINE, Section1, "key1", "test key 1") & "'" & vbCrLf
  317.    strDisplay = strDisplay & "Setting value of key 'key2' to 'test key 2' is '" & cPutRegistryExt(RK_HKEY_LOCAL_MACHINE, Section1, "key2", "test key 2") & "'" & vbCrLf & vbCrLf
  318.    
  319.    strDisplay = strDisplay & "Getting default value is '" & cGetRegistryExt(RK_HKEY_LOCAL_MACHINE, Section1, "", "?") & "'" & vbCrLf
  320.    strDisplay = strDisplay & "Getting value of key 'key2' is '" & cGetRegistryExt(RK_HKEY_LOCAL_MACHINE, Section1, "key2", "?") & "'" & vbCrLf
  321.    strDisplay = strDisplay & "Getting value of key 'key1' is '" & cGetRegistryExt(RK_HKEY_LOCAL_MACHINE, Section1, "key1", "?") & "'" & vbCrLf & vbCrLf
  322.    
  323.    strDisplay = strDisplay & "Use section '" & Section2 & "'" & vbCrLf & vbCrLf
  324.    
  325.    strDisplay = strDisplay & "Setting default value to 'License information' is '" & cPutRegistryExt(RK_HKEY_LOCAL_MACHINE, Section2, "", "License information") & "'" & vbCrLf
  326.    strDisplay = strDisplay & "Setting value of key 'Name' to 'James' is '" & cPutRegistryExt(RK_HKEY_LOCAL_MACHINE, Section2, "Name", "James") & "'" & vbCrLf
  327.    strDisplay = strDisplay & "Setting value of key 'Id' to 'Donb' is '" & cPutRegistryExt(RK_HKEY_LOCAL_MACHINE, Section2, "Id", "Donb") & "'" & vbCrLf
  328.    strDisplay = strDisplay & "Setting value of key 'N░' to '007' is '" & cPutRegistryExt(RK_HKEY_LOCAL_MACHINE, Section2, "N░", "007") & "'" & vbCrLf & vbCrLf
  329.    
  330.    strDisplay = strDisplay & "Getting default value is '" & cGetRegistryExt(RK_HKEY_LOCAL_MACHINE, Section2, "", "?") & "'" & vbCrLf
  331.    strDisplay = strDisplay & "Getting value of key 'Name' is '" & cGetRegistryExt(RK_HKEY_LOCAL_MACHINE, Section2, "Name", "?") & "'" & vbCrLf
  332.    strDisplay = strDisplay & "Getting value of key 'Id' is '" & cGetRegistryExt(RK_HKEY_LOCAL_MACHINE, Section2, "Id", "?") & "'" & vbCrLf
  333.    strDisplay = strDisplay & "Getting value of key 'N░' is '" & cGetRegistryExt(RK_HKEY_LOCAL_MACHINE, Section2, "N░", "?") & "'" & vbCrLf & vbCrLf
  334.    
  335.    strDisplay = strDisplay & "Kill Section 'under the fox' is '" & cKillRegistryExt(RK_HKEY_LOCAL_MACHINE, Section1, "") & "'" & vbCrLf & vbCrLf
  336.    strDisplay = strDisplay & "Kill Section 'software\The MCR Company' is '" & cKillRegistryExt(RK_HKEY_LOCAL_MACHINE, "software\The MCR Company", "") & "'" & vbCrLf & vbCrLf
  337.    strDisplay = strDisplay & "Kill Section 'software\The MCR Company\TIME TO WIN for VB 4.0' is '" & cKillRegistryExt(RK_HKEY_LOCAL_MACHINE, "software\The MCR Company\TIME TO WIN for VB 4.0", "") & "'" & vbCrLf & vbCrLf
  338.    
  339.    txt_Result = strDisplay
  340.    
  341.    'time the function
  342.  
  343.    intResult = cPutRegistryExt(RK_HKEY_LOCAL_MACHINE, Section2, "Name", "James")
  344.  
  345.    TimerHandle = cTimerOpen()
  346.    TimerStartOk = cTimerStart(TimerHandle)
  347.    
  348.    For i = 1 To Iteration
  349.       strResult = cGetRegistryExt(RK_HKEY_LOCAL_MACHINE, Section2, "", "?1")
  350.    Next i
  351.    
  352.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  353.    
  354.    TimerCloseOk = cTimerClose(TimerHandle)
  355.    
  356.    intResult = cKillRegistryExt(RK_HKEY_LOCAL_MACHINE, "software\The MCR Company", "")
  357.  
  358. End Sub
  359.