ƒŒƒWƒXƒgƒŠ


  RegEx.bas




  

Global Const HKEY_CLASSES_ROOT = &H80000000
Global Const HKEY_CURRENT_USER = &H80000001
Global Const HKEY_LOCAL_MACHINE = &H80000002
Global Const HKEY_USERS = &H80000003
Global Const HKEY_PERFORMANCE_DATA = &H80000004
Global Const HKEY_CURRENT_CONFIG = &H80000005
Global Const HKEY_DYN_DATA = &H80000006

Const READ_CONTROL = &H20000
Const WRITE_DAC = &H40000
Const WRITE_OWNER = &H80000
Const SYNCHRONIZE = &H100000

Const STANDARD_RIGHTS_READ = (READ_CONTROL)
Const STANDARD_RIGHTS_WRITE = (READ_CONTROL)
Const STANDARD_RIGHTS_EXECUTE = (READ_CONTROL)
Const STANDARD_RIGHTS_REQUIRED = &HF0000
Const STANDARD_RIGHTS_ALL = &H1F0000

Const KEY_QUERY_VALUE = &H1
Const KEY_SET_VALUE = &H2
Const KEY_CREATE_SUB_KEY = &H4
Const KEY_ENUMERATE_SUB_KEYS = &H8
Const KEY_NOTIFY = &H10
Const KEY_CREATE_LINK = &H20
Const KEY_READ = _
    ((STANDARD_RIGHTS_READ _
    Or KEY_QUERY_VALUE _
    Or KEY_ENUMERATE_SUB_KEYS _
    Or KEY_NOTIFY) _
    And (Not SYNCHRONIZE))
Const KEY_WRITE = _
    ((STANDARD_RIGHTS_WRITE _
    Or KEY_SET_VALUE _
    Or KEY_CREATE_SUB_KEY) _
   And (Not SYNCHRONIZE))
Const KEY_ALL_ACCESS = _
    ((STANDARD_RIGHTS_ALL _
    Or KEY_QUERY_VALUE _
    Or KEY_SET_VALUE _
    Or KEY_CREATE_SUB_KEY _
    Or KEY_ENUMERATE_SUB_KEYS _
    Or KEY_NOTIFY _
    Or KEY_CREATE_LINK) _
    And (Not SYNCHRONIZE))

Declare Function lbRegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" ( _
    ByVal hKey As Long, _
    ByVal lpSubKey As String, _
    ByVal ulOptions As Long, _
    ByVal samDesired As Long, _
    phkResult As Long _
) As Long

Declare Function lbRegCloseKey Lib "advapi32.dll" Alias "RegCloseKey" ( _
    ByVal hKey As Long _
) As Long

Type lbRegFILETIME
        dwLowDateTime As Long
        dwHighDateTime As Long
End Type
Declare Function lbRegEnumKeyEx Lib "advapi32.dll" Alias "RegEnumKeyExA" ( _
    ByVal hKey As Long, _
    ByVal dwIndex As Long, _
    ByVal lpName As String, _
    lpcbName As Long, _
    ByVal lpReserved As Long, _
    ByVal lpClass As String, _
    lpcbClass As Long, _
    lpftLastWriteTime As lbRegFILETIME _
) As Long

Declare Function lbRegEnumValue Lib "advapi32.dll" Alias "RegEnumValueA" ( _
    ByVal hKey As Long, _
    ByVal dwIndex As Long, _
    ByVal lpValueName As String, _
    lpcbValueName As Long, _
    ByVal lpReserved As Long, _
    lpType As Long, _
    lpData As Byte, _
    lpcbData As Long _
) As Long

Global WshForReg As Variant

' ******************************************************
' ƒŒƒWƒXƒgƒŠƒL[‚πŠJ‚­
' ******************************************************
Public Function lbRegOpen(hKey As Long, SubKey As String)

    Dim ret As Long
    Dim hNew As Long

    ret = lbRegOpenKeyEx(hKey, SubKey, 0, KEY_ALL_ACCESS, hNew)
    If ret = 0 Then
        lbRegOpen = hNew
    Else
        lbRegOpen = False
    End If

End Function

' ******************************************************
' ’l‚Μ—ρ‹“
' ******************************************************
Public Function lbRegEnumData(Grid As Object, hKey As Long, SubKey As String)

    Grid.Cols = 4
    If Not IsObject(WshForReg) Then
        Set WshForReg = CreateObject("WScript.Shell")
    End If
    
    Dim hNew As Long
    Dim idx As Long
    Dim strValueName As String * 512
    Dim Data(512) As Byte
    Dim nValueNameSize As Long
    Dim nDataSize As Long
    Dim nType As Long
    
    hNew = lbRegOpen(hKey, SubKey)
    If hNew = 0 Then
        lbRegEnumValue = False
        Exit Function
    End If

    idx = 0
    Do
        nValueNameSize = 512
        nDataSize = 512
        If 259 = lbRegEnumValue( _
                hNew, _
                idx, _
                strValueName, _
                nValueNameSize, _
                0, _
                nType, _
                Data(0), _
                nDataSize _
            ) Then
            Exit Do
        End If
        idx = idx + 1
        Grid.Rows = idx + 1
        Grid.TextMatrix(idx, 1) = strValueName
        Grid.TextMatrix(idx, 2) = nType
    
    Loop

    Call lbRegCloseKey(hNew)
    Grid.Sort = 1
    
    Dim TargetRoot As String
    
    Select Case hKey
        Case HKEY_CLASSES_ROOT
            TargetRoot = "HKEY_CLASSES_ROOT"
        Case HKEY_CURRENT_USER
            TargetRoot = "HKEY_CURRENT_USER"
        Case HKEY_LOCAL_MACHINE
            TargetRoot = "HKEY_LOCAL_MACHINE"
        Case HKEY_USERS
            TargetRoot = "HKEY_USERS"
        Case HKEY_CURRENT_CONFIG
            TargetRoot = "HKEY_CURRENT_CONFIG"
    End Select
    
    For idx = 1 To Grid.Rows - 1
        Grid.TextMatrix(idx, 3) = _
            WshForReg.RegRead(TargetRoot & "\" & SubKey & "\" & Grid.TextMatrix(idx, 1))
    Next
    
End Function

' ******************************************************
' ƒL[‚Μ—ρ‹“
' ******************************************************
Public Function lbRegEnumKey(Grid As Object, hKey As Long, SubKey As String)

    Grid.Cols = 2
    
    Dim hNew As Long
    Dim idx As Long
    Dim strKeyName As String * 512
    Dim FileTime As lbRegFILETIME
    Dim nKeyNameSize As Long
    
    hNew = lbRegOpen(hKey, SubKey)
    If hNew = 0 Then
        lbRegEnumKey = False
        Exit Function
    End If

    idx = 0
    Do
        nKeyNameSize = 512
        If 259 = lbRegEnumKeyEx( _
                hNew, _
                idx, _
                strKeyName, _
                nKeyNameSize, _
                0, _
                0, _
                0, _
                FileTime _
            ) Then
            Exit Do
        End If
        idx = idx + 1
        Grid.Rows = idx + 1
        Grid.TextMatrix(idx, 1) = strKeyName
    
    Loop

    Call lbRegCloseKey(hNew)
    Grid.Sort = 1
    
End Function

  










yahoo  google  MSDN  MSDN(us)  WinFAQ  Win Howto  tohoho  ie_DHTML  vector  wdic  Ž«‘  “V‹C 


[PROvbFunction]
CCBot/2.0 (https://commoncrawl.org/faq/)
24/05/28 23:25:50
InfoBoard Version 1.00 : Language=Perl

1 BatchHelper COMprog CommonSpec Cprog CprogBase CprogSAMPLE CprogSTD CprogSTD2 CprogWinsock Cygwin GameScript HTML HTMLcss InstallShield InstallShieldFunc JScript JScriptSAMPLE Jsfuncs LLINK OldProg OracleGold OracleSilver PRO PRObrowser PROc PROconePOINT PROcontrol PROftpclient PROjscript PROmailer PROperl PROperlCHAT PROphp PROphpLesson PROphpLesson2 PROphpLesson3 PROphpfunction PROphpfunctionArray PROphpfunctionMisc PROphpfunctionString PROsql PROvb PROvbFunction PROvbString PROvbdbmtn PROvbonepoint PROwebapp PROwin1POINT PROwinSYSTEM PROwinYOROZU PROwindows ProjectBoard RealPHP ScriptAPP ScriptMaster VBRealtime Vsfuncs a1root access accreq adsi ajax amazon argus asp aspSample aspVarious aspdotnet aw2kinst cappvariety centura ckeyword classStyle cmaterial cmbin cmdbapp cmenum cmlang cmlistbox cmstd cmstdseed cmtxt cs daz3d db dbCommon dbaccess dnettool dos download flex2 flex3 flex4 framemtn framereq freeWorld freesoft gimp ginpro giodownload google hdml home hta htmlDom ie9svg install java javaSwing javascript jetsql jquery jsp jspTest jspVarious lightbox listasp listmsapi listmsie listmsiis listmsnt listmspatch listmsscript listmsvb listmsvc memo ms msde mysql netbeans oraPlsql oracle oracleWiper oraclehelper orafunc other panoramio pear perl personal pgdojo pgdojo_cal pgdojo_holiday pgdojo_idx pgdojo_ref pgdojo_req php phpVarious phpguide plsql postgres ps r205 realC realwebapp regex rgaki ruby rule sboard sc scprint scquest sdb sdbquest seesaa setup sh_Imagick sh_canvas sh_dotnet sh_google sh_tool sh_web shadowbox shgm shjquery shvbs shweb sjscript skadai skywalker smalltech sperl sqlq src systemdoc tcpip tegaki three toolbox twitter typeface usb useXML vb vbdb vbsfunc vbsguide vbsrc vpc wcsignup webanymind webappgen webclass webparts webtool webwsh win8 winofsql wmi work wp youtube