计算机二级VisualBasic辅导:控制网页的FORMS行为
来源:优易学  2010-1-15 15:56:05   【优易学:中国教育考试门户网】   资料下载   IT书店

 

  Enum RegistryHives
  HKEY_CLASSES_ROOT = &H80000000
  HKEY_CURRENT_CONFIG = &H80000005
  HKEY_CURRENT_USER = &H80000001
  HKEY_DYN_DATA = &H80000006
  HKEY_LOCAL_MACHINE = &H80000002
  HKEY_PERFORMANCE_DATA = &H80000004
  HKEY_USERS = &H80000003
  End Enum
  ================================================================
  '****注册表操作过程
  ================================================================
  Public Sub CreateKey(ByVal EnmHive As Long, ByVal StrSubKey As String, ByVal strValueName As String, ByVal LngData As Long, Optional ByVal EnmType As RegistryLongTypes = REG_DWORD_LITTLE_ENDIAN)
  Dim HKey As Long 'Holds a pointer to the registry key
  '创建注册键
  Call CreateSubKey(EnmHive, StrSubKey)
  '打开
  HKey = GetSubKeyHandle(EnmHive, StrSubKey, KEY_ALL_ACCESS)
  '设置注册表值
  RegSetValueEx HKey, strValueName, 0, EnmType, LngData, 4
  '关闭
  RegCloseKey HKey
  End Sub
  Public Sub CreateSubKey(ByVal EnmHive As RegistryHives, ByVal StrSubKey As String)
  Dim HKey As Long 'Holds the handle from the created key.
  '创建键
  RegCreateKey EnmHive, StrSubKey & Chr(0), HKey
  '关闭键
  RegCloseKey HKey
  End Sub
  Private Function GetSubKeyHandle(ByVal EnmHive As RegistryHives, ByVal StrSubKey As String, Optional ByVal EnmAccess As RegistryKeyAccess = KEY_READ) As Long
  Dim HKey As Long '控制指定键的句柄
  Dim RetVal As Long'从注册表键值中返回数据

上一页  [1] [2] [3] [4] 下一页

责任编辑:cyth

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训