home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / lcocxweb / samples.exe / Registry / frmRegistry.frm (.txt) next >
Encoding:
Visual Basic Form  |  1998-08-04  |  7.5 KB  |  226 lines

  1. VERSION 5.00
  2. Object = "{B190576C-254A-11D2-B61E-C80424DEEF17}#45.0#0"; "LCocx.ocx"
  3. Begin VB.Form frmRegistry 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Registry"
  6.    ClientHeight    =   5700
  7.    ClientLeft      =   36
  8.    ClientTop       =   324
  9.    ClientWidth     =   9492
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   5700
  14.    ScaleWidth      =   9492
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin LCocx98.LCocx LCocx1 
  17.       Left            =   4560
  18.       Top             =   2640
  19.       _ExtentX        =   656
  20.       _ExtentY        =   656
  21.    End
  22.    Begin VB.CommandButton Command9 
  23.       Caption         =   "DeleteKey HKEY_CURRENT_USER, ""SAMPLEKEY"""
  24.       Height          =   492
  25.       Left            =   120
  26.       TabIndex        =   8
  27.       Top             =   4920
  28.       Width           =   5412
  29.    End
  30.    Begin VB.CommandButton Command8 
  31.       Caption         =   "DeleteValue HKEY_CURRENT_USER, ""SAMPLEKEY"", ""SAMPLE2"""
  32.       Height          =   492
  33.       Left            =   120
  34.       TabIndex        =   7
  35.       Top             =   4320
  36.       Width           =   5412
  37.    End
  38.    Begin VB.CommandButton Command7 
  39.       Caption         =   "ret4 = QueryValue(HKEY_LOCAL_MACHINE, ""SOFTWARE\Microsoft\Windows\CurrentVersion\Setup"", ""SysDir"")"
  40.       Height          =   492
  41.       Left            =   120
  42.       TabIndex        =   6
  43.       Top             =   3720
  44.       Width           =   5412
  45.    End
  46.    Begin VB.CommandButton Command6 
  47.       Caption         =   "ret3 = ValueCount(HKEY_LOCAL_MACHINE, ""SOFTWARE\Microsoft\Windows\CurrentVersion\Setup"")"
  48.       Height          =   492
  49.       Left            =   120
  50.       TabIndex        =   5
  51.       Top             =   3120
  52.       Width           =   5412
  53.    End
  54.    Begin VB.CommandButton Command5 
  55.       Caption         =   "Ret2 = KeyExists(HKEY_CURRENT_USER, ""SAMPLEKEY"")"
  56.       Height          =   492
  57.       Left            =   120
  58.       TabIndex        =   4
  59.       Top             =   2520
  60.       Width           =   5412
  61.    End
  62.    Begin VB.CommandButton Command4 
  63.       Caption         =   "Ret1 = KeyCount(HKEY_LOCAL_MACHINE, ""SOFTWARE\Microsoft\Windows\CurrentVersion\Setup"")"
  64.       Height          =   492
  65.       Left            =   120
  66.       TabIndex        =   3
  67.       Top             =   1920
  68.       Width           =   5412
  69.    End
  70.    Begin VB.CommandButton Command3 
  71.       Caption         =   "SetKeyValue HKEY_CURRENT_USER, ""SAMPLEKEY"", ""SAMPLE2"", 123456, ""Binary"""
  72.       Height          =   492
  73.       Left            =   120
  74.       TabIndex        =   2
  75.       Top             =   1320
  76.       Width           =   5412
  77.    End
  78.    Begin VB.CommandButton Command2 
  79.       Caption         =   "SetKeyValue HKEY_CURRENT_USER, ""SAMPLEKEY"", """", ""HELLO WORLD"", ""String"""
  80.       Height          =   492
  81.       Left            =   120
  82.       TabIndex        =   1
  83.       Top             =   720
  84.       Width           =   5412
  85.    End
  86.    Begin VB.CommandButton Command1 
  87.       Caption         =   "CreateNewKey HKEY_CURRENT_USER, ""SAMPLEKEY"""
  88.       Height          =   492
  89.       Left            =   120
  90.       TabIndex        =   0
  91.       Top             =   120
  92.       Width           =   5412
  93.    End
  94.    Begin VB.Label Label9 
  95.       AutoSize        =   -1  'True
  96.       Caption         =   "Return:"
  97.       Height          =   192
  98.       Left            =   6240
  99.       TabIndex        =   17
  100.       Top             =   5160
  101.       Width           =   504
  102.    End
  103.    Begin VB.Label Label8 
  104.       AutoSize        =   -1  'True
  105.       Caption         =   "Return:"
  106.       Height          =   192
  107.       Left            =   6240
  108.       TabIndex        =   16
  109.       Top             =   4560
  110.       Width           =   504
  111.    End
  112.    Begin VB.Label Label7 
  113.       AutoSize        =   -1  'True
  114.       Caption         =   "Return:"
  115.       Height          =   192
  116.       Left            =   6240
  117.       TabIndex        =   15
  118.       Top             =   3960
  119.       Width           =   504
  120.    End
  121.    Begin VB.Label Label6 
  122.       AutoSize        =   -1  'True
  123.       Caption         =   "Return:"
  124.       Height          =   192
  125.       Left            =   6240
  126.       TabIndex        =   14
  127.       Top             =   3360
  128.       Width           =   504
  129.    End
  130.    Begin VB.Label Label5 
  131.       AutoSize        =   -1  'True
  132.       Caption         =   "Return:"
  133.       Height          =   192
  134.       Left            =   6240
  135.       TabIndex        =   13
  136.       Top             =   2760
  137.       Width           =   504
  138.    End
  139.    Begin VB.Label Label4 
  140.       AutoSize        =   -1  'True
  141.       Caption         =   "Return:"
  142.       Height          =   192
  143.       Left            =   6240
  144.       TabIndex        =   12
  145.       Top             =   2160
  146.       Width           =   504
  147.    End
  148.    Begin VB.Label Label3 
  149.       AutoSize        =   -1  'True
  150.       Caption         =   "Return:"
  151.       Height          =   192
  152.       Left            =   6240
  153.       TabIndex        =   11
  154.       Top             =   1560
  155.       Width           =   504
  156.    End
  157.    Begin VB.Label Label2 
  158.       AutoSize        =   -1  'True
  159.       Caption         =   "Return:"
  160.       Height          =   192
  161.       Left            =   6240
  162.       TabIndex        =   10
  163.       Top             =   960
  164.       Width           =   504
  165.    End
  166.    Begin VB.Label Label1 
  167.       AutoSize        =   -1  'True
  168.       Caption         =   "Return:"
  169.       Height          =   192
  170.       Left            =   6240
  171.       TabIndex        =   9
  172.       Top             =   360
  173.       Width           =   504
  174.    End
  175. Attribute VB_Name = "frmRegistry"
  176. Attribute VB_GlobalNameSpace = False
  177. Attribute VB_Creatable = False
  178. Attribute VB_PredeclaredId = True
  179. Attribute VB_Exposed = False
  180. Private Sub Command1_Click()
  181. LCocx1.CreateNewKey HKEY_CURRENT_USER, "SAMPLEKEY"
  182. Label1 = "Return: Nothing"
  183. End Sub
  184. Private Sub Command2_Click()
  185. LCocx1.SetKeyValue HKEY_CURRENT_USER, "SAMPLEKEY", "", "HELLO WORLD", "String"
  186. 'It sets "HELLO WORLD" to the "Default Value"
  187. 'When setting a value, if you don't specify "String" or "Binary"
  188. 'it will be treated as "String"
  189. Label2 = "Return: Nothing"
  190. End Sub
  191. Private Sub Command3_Click()
  192. LCocx1.SetKeyValue HKEY_CURRENT_USER, "SAMPLEKEY", "SAMPLE2", 123456, "Binary"
  193. 'It sets "123456" to the "SAMPLE2 Value" in binary format
  194. 'When setting a value, if you don't specify "String" or "Binary"
  195. 'it will be treated as "String"
  196. Label3 = "Return: Nothing"
  197. End Sub
  198. Private Sub Command4_Click()
  199. Ret1 = LCocx1.KeyCount(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Setup")
  200. 'Counts number of keys under the specified key
  201. Label4 = "Return: " & Ret1
  202. End Sub
  203. Private Sub Command5_Click()
  204. Ret2 = LCocx1.KeyExists(HKEY_CURRENT_USER, "SAMPLEKEY")
  205. 'Checks if a Key exists
  206. Label5 = "Return: " & Ret2
  207. End Sub
  208. Private Sub Command6_Click()
  209. ret3 = LCocx1.ValueCount(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Setup")
  210. 'Counts number of values under the specified key
  211. Label6 = "Return: " & ret3
  212. End Sub
  213. Private Sub Command7_Click()
  214. ret4 = LCocx1.QueryValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Setup", "SysDir")
  215. 'Returns the "Setting" of the "SysDir Value" under the specified key
  216. Label7 = "Return: " & ret4
  217. End Sub
  218. Private Sub Command8_Click()
  219. LCocx1.DeleteValue HKEY_CURRENT_USER, "SAMPLEKEY", "SAMPLE2"
  220. Label8 = "Return: Nothing"
  221. End Sub
  222. Private Sub Command9_Click()
  223. LCocx1.DeleteKey HKEY_CURRENT_USER, "SAMPLEKEY"
  224. Label9 = "Return: Nothing"
  225. End Sub
  226.