Announcement

Collapse

Forum Guidelines

This forum is for finished source code that is working properly. If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
See more
See less

Registry functions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Registry functions

    Having fun with the registry. Be carefull, easy to destroy valuable data!!!
    Thank to Balthasar Indermuehle, William Baugh and Greg Turgeon.

    Compilable with PB-Win and PB-CC

    Updated 2005-12-15

    Pierre

    Code:
     
    'What's in it...
     
    ' RegDataExpand          Expand data from a REG_EXPAND_SZ registry entry
    ' RegDataGet             Get any registry type, DWORD will be converted to string
    ' RegDataGetDword        Get DWORD registry data
    ' RegDataGetArray        Get an array of data from a value array
    ' RegDataGetType         Get data type
    ' RegDataSet             Create value if needed and set data of any type, DWORD converted from string
    ' RegDataSetIfNotFound   Create a value and set data if value doesn't exist
    ' RegDataSetDword        Create value if needed and set DWORD data
    ' RegKeyDel              Delete a key
    ' RegKeyDelTree          Delete all keys from a specific point
    ' RegKeyDelTreeRecursive Delete all keys from a specific point in a recursive way
    ' RegKeyExist            Check for the existence of a key
    ' RegKeyGetArray         Enumerate all keys from a specific point
    ' RegKeyGetInfo          Get count and maximum size to expect on key, value, class and data, etc
    ' RegKeySet              Create a key, creation can occur on multi level if necessary
    ' RegValueDel            Delete a value
    ' RegValueEnum           Enumerate values, data and registry type under a key
    ' RegValueExist          Check for the existence of a value
     
    'Organisation: %HKEY_MAIN\Key\SubKey\Value\Data
    'Example:      %HKEY_LOCAL_MACHINE\Software\A_registry_test\Value\SomeData (Type %REG_SZ)
    'Data type:    %REG_SZ, %REG_MULTI_SZ, %REG_EXPAND_SZ, REG_DWORD, REG_BINARY, REG_NONE
    '______________________________________________________________________________
     
     'Registry Element Size Limits
     'The following table identifies the size limits for the various registry elements.
     
     'Key name:    255 characters
     
     'Value name
     ' 95/98/Me    255 characters
     ' 2000        260 characters ANSI
     ' 2000     16,383 characters Unicode
     ' other    16,383 characters
     
     'Value
     ' Available memory (latest format)
     ' 1MB (standard format)
     ' Me/98/95: 16,300 bytes.
     
     'For Windows 95, there is a 64K limit for the total size of all values of a key.
    '______________________________________________________________________________
     
     'REG_NONE                No defined value type.(0)
     'REG_SZ                  A null-terminated string. It will be a Unicode or ANSI string,
     '                        depending on whether you use the Unicode or ANSI functions.(1)
     'REG_EXPAND_SZ           A null-terminated string that contains unexpanded references to
     '                        environment variables (for example, "%PATH%").
     '                        It will be a Unicode or ANSI string depending on whether you use
     '                        the Unicode or ANSI functions.(2)
     'REG_BINARY              Binary data in any form. (3)
     'REG_DWORD               A 32-bit number.(4)
     'REG_DWORD_LITTLE_ENDIAN A 32-bit number in little-endian format (same as REG_DWORD).
     '                        In little-endian format, the most significant byte of a word
     '                        is the high-order byte. This is the most common format for
     '                        computers running Windows NT and Windows 95.(4)
     'REG_DWORD_BIG_ENDIAN    A 32-bit number in big-endian format. In big-endian format,
     '                        the most significant byte of a word is the low-order byte.(5)
     'REG_LINK                A Unicode symbolic link.(6)
     'REG_MULTI_SZ            An array of null-terminated strings, terminated by two null characters.(7)
     'REG_RESOURCE_LIST       A device-driver resource list.(8)
    '______________________________________________________________________________
     
    'Note, many times unneeded detail can be skipped with the use of <BYVAL %NULL>
    'Ex: Retval = RegQueryInfoKey(hMainKey, BYVAL %NULL, BYVAL %NULL, BYVAL %NULL, BYVAL %NULL, BYVAL %NULL, _
    '                             BYVAL %NULL, ValueCount, BYVAL %NULL, BYVAL %NULL, BYVAL %NULL, BYVAL %NULL)
    '______________________________________________________________________________
     
    #COMPILE EXE '#Win 8.03# #CC 4.03#
    #REGISTER NONE
    #DIM ALL
    #INCLUDE "Win32Api.inc" '2005-01-14
     
    %MAX_REG = %MAX_PATH
     
    DECLARE FUNCTION SHDeleteKey(BYVAL hkey AS DWORD, SubKey AS ASCIIZ)AS LONG
     
    DECLARE FUNCTION RegQueryMultipleValuesA LIB "ADVAPI32.DLL" ALIAS "RegQueryMultipleValuesA"( _
                     BYVAL hKey AS DWORD, BYVAL pValList AS VALENT PTR, BYVAL NumVals AS DWORD, _
                     zValueBuf AS ASCIIZ, pDwTotSize AS DWORD) AS LONG
    '______________________________________________________________________________
     
    FUNCTION RegDataExpand(sToExpand AS STRING, sExpanded AS STRING) AS LONG
     'Expand data from a REG_EXPAND_SZ registry entry. Return %ERROR_SUCCESS (0) if no error.
     'RegDataExpand("%ProgramFiles%\MyFolder", sExpanded)
     LOCAL ByteNeeded AS LONG
     LOCAL Retval     AS LONG
     
     ByteNeeded = ExpandEnvironmentStrings(BYVAL STRPTR(sToExpand), BYVAL STRPTR(sExpanded), %NULL)
     sExpanded = STRING$(ByteNeeded, 0)
     Retval = ExpandEnvironmentStrings(BYVAL STRPTR(sToExpand), BYVAL STRPTR(sExpanded), ByteNeeded)
     IF Retval > ByteNeeded THEN 'Buffer to small
       FUNCTION = Retval
       sExpanded = ""
     END IF
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegDataGet(hMainKey AS DWORD, sKeyName AS STRING, sValueName AS STRING, _
                        sData AS STRING, dwRegType AS DWORD) AS LONG
     'Set sData and dwRegType. Return %ERROR_SUCCESS (0) if no error.
     'dwRegType can be set to NULL if not required.
     'sData can be set to NULL if not required.
     'RegDataGet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "Value REG_DWORD-1", sBuffer, dwRegType)
     'RegDataGet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "Value REG_SZ", sBuffer, dwRegType)
     'MsgBox "RegType: " & STR$(dwRegType) & $CRLF & "LEN: " & STR$(LEN(sBuffer)) & $CRLF &"Value: " & sBuffer
     LOCAL Retval AS LONG
     LOCAL dwSize AS DWORD
     LOCAL hKey   AS DWORD
     
     sData = ""
     dwRegType = 0
     
     Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %Null, %KEY_READ, hKey)
     IF Retval = %ERROR_SUCCESS THEN
       Retval = RegQueryValueEx(hKey, BYVAL STRPTR(sValueName), BYVAL %Null, _
                                BYVAL %Null, BYVAL %Null, dwSize)
       IF Retval = %ERROR_SUCCESS THEN
         sData = STRING$(dwSize, 0)
         Retval = RegQueryValueEx(hKey, BYVAL STRPTR(sValueName), BYVAL %Null, _
                                  dwRegType, BYVAL STRPTR(sData), dwSize)
         SELECT CASE dwRegType
           CASE %REG_SZ, %REG_EXPAND_SZ, %REG_MULTI_SZ
             sData = RTRIM$(sData, $NUL) 'Remove one or two ending $NUL
           'CASE %REG_SZ, %REG_EXPAND_SZ
           '  sData = LEFT$(sData, dwSize - 1) 'Remove ending $NUL
           CASE %REG_DWORD
             sData = FORMAT$(CVDWD(sData)) 'Convert dword to string
         END SELECT
       END IF
       RegCloseKey(hKey)
     END IF
     FUNCTION = Retval
     'MsgBox STR$(dwRegType) & $CRLF & STR$(dwSize) & $CRLF & sData
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegDataGetDword(hMainKey AS DWORD, sKeyName AS STRING, _
                             sValueName AS STRING, dwData AS DWORD) AS LONG
     'Set dwData. Return %ERROR_SUCCESS (0) if no error.
     'RegDataGetDword(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "Value REG_DWORD-1", dwData)
     LOCAL Retval AS LONG
     LOCAL hKey   AS DWORD
     
     Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %Null, %KEY_READ, hKey)
     IF Retval = %ERROR_SUCCESS THEN
       Retval = RegQueryValueEx(hKey, BYVAL STRPTR(sValueName), BYVAL %Null, %REG_DWORD, BYVAL VARPTR(dwData), 4)
       RegCloseKey(hKey)
     END IF
     FUNCTION = Retval
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegDataGetArray(hMainKey AS DWORD, sKeyName AS STRING, sValueArray()AS STRING, _
                             sDataArray()AS STRING, dwRegTypeArray()AS DWORD) AS LONG
     'Get multi data in one call from sValueArray and set sDataArray() and dwRegTypeArray().
     'Return %ERROR_SUCCESS (0) if no error.
     'RegDataGetArray(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", sValueArray(),sDataArray(), dwRegTypeArray())
     LOCAL hKey       AS DWORD
     LOCAL ValueCount AS DWORD
     LOCAL Counter    AS DWORD
     LOCAL Retval     AS LONG
     LOCAL sBuffer    AS STRING
     LOCAL BufferLen  AS DWORD
     
     RESET sDataArray()
     RESET dwRegTypeArray()
     ValueCount = UBOUND(sValueArray()) + 1
     DIM ValentArray(0 TO ValueCount) AS VALENT
     FOR Counter = 0 TO ValueCount - 1
       ValentArray(Counter).ve_valuename = STRPTR(sValueArray(Counter))
     NEXT
     
     Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %NULL, %KEY_QUERY_VALUE, hKey)
     IF Retval = %ERROR_SUCCESS THEN
       Retval = RegQueryMultipleValuesA(hKey, VARPTR(ValentArray(0)), ValueCount, BYVAL %NULL, BufferLen)
       sBuffer = STRING$(BufferLen, 0)
       Retval = RegQueryMultipleValuesA(hKey, VARPTR(ValentArray(0)), ValueCount, BYVAL STRPTR(sBuffer), BufferLen)
       IF Retval = %ERROR_SUCCESS THEN
         FOR Counter = 0 TO  ValueCount - 1
           SELECT CASE ValentArray(Counter).ve_type
             CASE %REG_SZ, %REG_EXPAND_SZ, %REG_MULTI_SZ
               sDataArray(Counter) = RTRIM$(PEEK$(ValentArray(Counter).ve_valuePtr, ValentArray(Counter).ve_valueLen - 1), $NUL) 'Remove one or two ending $NUL
             CASE %REG_DWORD
               sDataArray(Counter) = FORMAT$(CVDWD(PEEK$(ValentArray(Counter).ve_valuePtr, ValentArray(Counter).ve_valueLen)))
             CASE ELSE
               sDataArray(Counter) = PEEK$(ValentArray(Counter).ve_valuePtr, ValentArray(Counter).ve_valueLen)
           END SELECT
           dwRegTypeArray(Counter) = ValentArray(Counter).ve_type
         NEXT
       END IF
       RegCloseKey(hKey)
     END IF
     
     FUNCTION = Retval
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegKeySet(hMainKey AS DWORD, sKeyName AS STRING) AS LONG
     'Create one or many level of key. Return %ERROR_SUCCESS (0) if no error.
     'Retval = RegKeySet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test")
     LOCAL hKey   AS DWORD
     LOCAL dwDisp AS DWORD
     
     FUNCTION = RegCreateKeyEx(hMainKey, BYVAL STRPTR(SKeyName), BYVAL %NULL, "", %REG_OPTION_NON_VOLATILE, _
                               %KEY_ALL_ACCESS, BYVAL %Null, hKey, dwDisp)
     IF hKey THEN RegCloseKey(hKey)
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegDataSet(hMainKey AS DWORD, sKeyName AS STRING, sValueName AS STRING, _
                        sData AS STRING, BYVAL dwDataType AS DWORD) AS LONG
     'Create value if necessary and set data. Return %ERROR_SUCCESS (0) if no error.
     'RegDataSet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "", "DefaultData", %REG_SZ)
     'RegDataSet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "Value REG_SZ", "SomeData", %REG_SZ)
     'RegDataSet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "Value REG_MULTI_SZ", "SomeData" & $NUL & "MoreData" & $NUL & "NoMoreData", %REG_MULTI_SZ)
     'RegDataSet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "Value REG_EXPAND_SZ", "%ProgramFiles%\SomeFolder", %REG_EXPAND_SZ)
     'RegDataSet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "Value REG_DWORD", "1234567890", %REG_DWORD)
     LOCAL hKey    AS DWORD
     LOCAL DalaLen AS DWORD
     LOCAL dwData  AS DWORD
     LOCAL Retval  AS LONG
     LOCAL pData   AS DWORD
     
     Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %NULL, %KEY_ALL_ACCESS, hKey)
     IF Retval = %ERROR_FILE_NOT_FOUND THEN
       RegKeySet(hMainKey, sKeyName)
       Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %NULL, %KEY_ALL_ACCESS, hKey)
     END IF
     
     IF Retval = %ERROR_SUCCESS THEN
       IF dwDataType = %REG_DWORD THEN
         dwData = VAL(sData)
         pData = VARPTR(dwData)
         DalaLen = 4
       ELSE
         pData = STRPTR(sData)
         DalaLen = LEN(sData) 'Use LEN not SIZEOFF
       END IF
       Retval = RegSetValueEx(hKey, BYVAL STRPTR(sValueName), BYVAL %NULL, dwDataType, BYVAL pData, BYVAL DalaLen)
       RegCloseKey(hKey)
     END IF
     FUNCTION = Retval
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegDataSetDword(hMainKey AS DWORD, sKeyName AS STRING, _
                             sValueName AS STRING, dwData AS DWORD) AS LONG
     'Create value if necessary and set DWORD data. Return %ERROR_SUCCESS (0) if no error.
     'RegDataSetDword(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "Value REG_DWORD-2", 987654321)
     LOCAL hKey   AS DWORD
     LOCAL Retval AS LONG
     LOCAL pData  AS DWORD
     
     Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %NULL, %KEY_ALL_ACCESS, hKey)
     IF Retval = %ERROR_FILE_NOT_FOUND THEN
       RegKeySet(hMainKey, sKeyName)
       Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %NULL, %KEY_ALL_ACCESS, hKey)
     END IF
     IF Retval = %ERROR_SUCCESS THEN
       pData = VARPTR(dwData)
       Retval = RegSetValueEx(hKey, BYVAL STRPTR(sValueName), BYVAL %NULL, %REG_DWORD, BYVAL(pData), 4)
       RegCloseKey(hKey)
     END IF
     FUNCTION = Retval
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegDataGetType(hMainKey AS DWORD, sKeyName AS STRING, sValueName AS STRING, dwType AS DWORD) AS LONG
     LOCAL hKey   AS DWORD
     LOCAL Retval AS LONG
     
     Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %Null, %KEY_READ, hKey)
     IF Retval = %ERROR_SUCCESS THEN
       Retval = RegQueryValueEx(hKey, BYVAL STRPTR(sValueName), BYVAL %Null, _
                                dwType, BYVAL %Null, BYVAL %Null)
       RegCloseKey(hKey)
     END IF
     FUNCTION = Retval
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegKeyDel(hMainKey AS DWORD, sKeyName AS STRING) AS LONG
     'Delete a key. Return %ERROR_SUCCESS (0) if no error.
     'RegKeyDel(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test\SubKeyToDel")
     
     FUNCTION = RegDeleteKey(hMainKey, BYVAL STRPTR(sKeyName))
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegKeyDelTree(hMainKey AS DWORD, sKeyParent AS STRING, sKeyToDel AS STRING) AS LONG
     'Delete a key and and everything under. Return %ERROR_SUCCESS (0) if no error.
     'RegKeyDelTre(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test\Tmp", "KeyToDel")
     LOCAL hlib       AS DWORD
     LOCAL pfunction  AS DWORD
     LOCAL hKey       AS DWORD
     LOCAL Retval     AS DWORD
     
     Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyParent), BYVAL %NULL, %KEY_ALL_ACCESS, hKey)
     IF Retval = %ERROR_SUCCESS THEN
       hlib = LoadLibrary("SHLWAPI.DLL")
       IF hlib THEN
         pfunction = GetProcAddress(hlib, "SHDeleteKeyA") 'If Internet Explorer 4.0 or newer 
         CALL DWORD pfunction USING SHDeleteKey(hKey, BYVAL STRPTR(sKeyToDel)) TO Retval
         FreeLibrary(hlib)
       ELSE
         Retval = RegDeleteKey(hKey, BYVAL STRPTR(sKeyToDel)) 'If Windows 95 and IE is less than v4
       END IF
       RegCloseKey(hKey)
     END IF
     
     FUNCTION = Retval
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegKeyDelTreeRecursive(hMainKey AS DWORD, sKeyToDel AS STRING) AS LONG
     'Delete a key and and everything under recursively. Return %ERROR_SUCCESS (0) if no error.
     'RegKeyDelTreeRecursive(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test\KeyToDel")
     LOCAL  zBuffer    AS ASCIIZ * 16384
     LOCAL  zBufferLen AS DWORD
     LOCAL  hKey       AS DWORD
     STATIC dwDeep     AS DWORD
     STATIC ErrorCount AS LONG
     LOCAL  RetVal     AS LONG 
     
     IF dwDeep = 0 THEN ErrorCount = 0 'Reset ErrorCount
     INCR dwDeep 'Keep track of auto recursion deepness
     IF RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyToDel), 0, %KEY_ALL_ACCESS, hKey) = %ERROR_SUCCESS THEN
     
       DO 'Enumerate all values and delete each one
         zBufferLen = SIZEOF(zBuffer)
         Retval = RegEnumValue(hKey, BYVAL 0, zBuffer, zBufferLen, BYVAL %NULL, BYVAL %NULL, BYVAL %NULL, BYVAL %NULL)
         IF Retval <> %ERROR_SUCCESS THEN 
           IF Retval <> %ERROR_NO_MORE_ITEMS THEN INCR ErrorCount ': MsgBox "%ERROR_NO_MORE_ITEMS"
           EXIT DO 'No value found, so exit
         END IF  
         Retval = RegDeleteValue(hKey, BYVAL VARPTR(zBuffer)) 'Delete the value
         IF Retval Then INCR ErrorCount     
       LOOP
     
       DO 'Enumerate all key and delete each one
         zBufferLen = SIZEOF(zBuffer)
         Retval = RegEnumKeyEx(hKey, BYVAL 0, zBuffer, zBufferLen, 0, BYVAL %NULL, BYVAL %NULL, BYVAL %NULL)
         IF Retval <> %ERROR_SUCCESS THEN 
           IF Retval <> %ERROR_NO_MORE_ITEMS THEN INCR ErrorCount ': MsgBox "%ERROR_NO_MORE_ITEMS"
           EXIT DO 'No key found, so exit
         END IF  
         RegKeyDelTreeRecursive hMainKey, sKeyToDel & "\" & zBuffer 'The function call itself to go deeper doing a recursive action
         zBuffer = sKeyToDel & "\" & zBuffer
         Retval = RegDeleteKey(hMainKey, BYVAL VARPTR(zBuffer)) 'Delete founded keys 
         IF Retval THEN INCR ErrorCount
       LOOP
       RegCloseKey hKey
     ELSE
       INCR ErrorCount
     END IF
     
     DECR dwDeep 'Recursion is all done when dwDeep is back to zero
     IF dwDeep = 0 THEN
       'Job is almost done, still have to delete the sKeyToDel
       'that was set before any recursion occured
       Retval = RegDeleteKey(hMainKey, BYVAL STRPTR(sKeyToDel))
       IF Retval THEN INCR ErrorCount
     END IF
     
     FUNCTION = ErrorCount ': MsgBox Str$(ErrorCount)
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegKeyExist(hMainKey AS DWORD, sKeyName AS STRING)AS LONG
     'Return %TRUE if key exist.
     'Retval = RegKeyExist(hMainKey, sKeyName)
     LOCAL Retval AS LONG
     LOCAL hKey   AS DWORD
     
     Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %NULL, %KEY_READ, hKey)
     IF Retval = %ERROR_SUCCESS THEN
       RegCloseKey(hKey)
       FUNCTION = 1
     END IF
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegKeyGetArray(hMainKey AS DWORD, sKeyName AS STRING, sKeyArray() AS STRING, dwKeyCount AS DWORD)AS LONG
     'Set sKeyArray() and dwKeyCount. Return %ERROR_SUCCESS (0) if no error.
     'RegKeyGetArray(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", sKeyArray(), dwKeyCount)
     LOCAL Retval        AS LONG
     LOCAL hKey          AS DWORD
     LOCAL KeyLen        AS DWORD
     LOCAL ClassLen      AS DWORD
     LOCAL zKeyNameEnum  AS ASCIIZ * %MAX_REG
     LOCAL zClass        AS ASCIIZ * %MAX_REG
     LOCAL LastWriteTime AS FILETIME
     
     Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %NULL, %KEY_READ, hKey)
     IF Retval = %ERROR_SUCCESS THEN
       dwKeyCount = 0
       DO
         KeyLen   = %MAX_REG
         ClassLen = %MAX_REG
         Retval = RegEnumKeyEx(hKey, dwKeyCount, zKeyNameEnum, KeyLen, BYVAL %Null, zClass, ClassLen, LastWriteTime)
         'If any interset in LastWriteTime
         'LOCAL SysTime AS SYSTEMTIME
         'FileTimeToSystemTime LastWriteTime, SysTime
         'MSGBOX Format$(SysTime.wyear, "0000") & "/" & Format$(SysTime.wMonth,  "00") & "/" & _
         '       Format$(SysTime.wDay,    "00") & " " & Format$(SysTime.wHour,   "00") & ":" & _
         '       Format$(SysTime.wMinute, "00") & ":" & Format$(SysTime.wSecond, "00")
         IF Retval = %ERROR_NO_MORE_ITEMS THEN Retval = %ERROR_SUCCESS : EXIT DO
         REDIM PRESERVE sKeyArray(0 TO dwKeyCount)
         sKeyArray(dwKeyCount) = LEFT$(zKeyNameEnum, KeyLen)
         INCR dwKeyCount
       LOOP WHILE Retval = %ERROR_SUCCESS
       RegCloseKey(hKey)
     END IF
     FUNCTION = Retval
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegKeyGetInfo(hMainKey AS DWORD, sKeyName AS STRING, sQuery AS STRING) AS LONG
     'Show info from RegQueryInfoKey. Return %ERROR_SUCCESS (0) if no error.
     'RegKeyGetInfo(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test")
     LOCAL Retval          AS LONG
     LOCAL hKey            AS DWORD
     LOCAL zClassName      AS ASCIIZ * %MAX_REG
     LOCAL ClassNameLen    AS DWORD
     LOCAL KeyNameCount    AS DWORD
     LOCAL KeyNameMaxLen   AS DWORD
     LOCAL ClassNameMaxLen AS DWORD
     LOCAL ValueCount      AS DWORD
     LOCAL ValueNameMaxLen AS DWORD
     LOCAL DataMaxLen      AS DWORD
     LOCAL SecurityLen     AS DWORD
     LOCAL LastWriteTime   AS FILETIME
     LOCAL SysTime         AS SYSTEMTIME
     
     sQuery = ""
     Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %NULL, %KEY_QUERY_VALUE, hKey)
     IF Retval = %ERROR_SUCCESS THEN
       Retval = RegQueryInfoKey(hKey, zClassName, ClassNameLen, BYVAL %NULL, KeyNameCount, KeyNameMaxLen, _
                                ClassNameMaxLen, ValueCount, ValueNameMaxLen, DataMaxLen, SecurityLen, LastWriteTime)
       IF Retval = %ERROR_SUCCESS THEN
         'FileTimeToSystemTime LastWriteTime, SysTime
         'IF LEN(zClassName) = 0 THEN zClassName = "<NIL>"
         'sQuery = "Registry: "       & sKeyName              & $CRLF & _
         '         "ClassName:"       & zClassName            & $CRLF & _
         '         "ClassNameLen:"    & STR$(ClassNameLen)    & $CRLF & _
         '         "KeyNameCount:"    & STR$(KeyNameCount)    & $CRLF & _
         '         "KeyNameMaxLen:"   & STR$(KeyNameMaxLen)   & $CRLF & _
         '         "ClassNameMaxLen:" & STR$(ClassNameMaxLen) & $CRLF & _
         '         "ValueCount:"      & STR$(ValueCount)      & $CRLF & _
         '         "ValueNameMaxLen:" & Str$(ValueNameMaxLen) & $CRLF & _
         '         "DataMaxLen:"      & STR$(DataMaxLen)      & $CRLF & _
         '         "SecurityLen:"     & Str$(SecurityLen)     & $CRLF & _
         '         "LastWriteTime: "  & Format$(SysTime.wyear, "0000") & "/" & _
         '         Format$(SysTime.wMonth,  "00") & "/" & Format$(SysTime.wDay,    "00") & " " & _
         '         Format$(SysTime.wHour,   "00") & ":" & Format$(SysTime.wMinute, "00") & ":" & _
         '         Format$(SysTime.wSecond, "00")
         'MsgBox sQuery
         ''zClassName = "zNameClass" : ClassNameLen = LEN(zClassName)
     
         'Data offset of what is in sQuery...
         'sClassName = MID$(sQuery, 41)
         'dwInfo = CVDWD(sQuery, offset) See following lines for needed offset...
         '1=ClassNameLen, 5=KeyNameCount, 9=KeyNameMaxLen, 13=ClassNameMaxLen, 17=ValueCount,
         '21=ValueNameMaxLen, 25=DataMaxLen, 29=SecurityLen, 33=LastWriteTime.dwLowDateTime,
         '37=LastWriteTime.dwHighDateTime, 41=zClassName
         sQuery = MKDWD$(ClassNameLen) & MKDWD$(KeyNameCount) & MKDWD$(KeyNameMaxLen) & _
                  MKDWD$(ClassNameMaxLen) & MKDWD$(ValueCount) & _
                  MKDWD$(ValueNameMaxLen) & MKDWD$(DataMaxLen) & MKDWD$(SecurityLen) & _
                  MKDWD$(LastWriteTime.dwLowDateTime) & MKDWD$(LastWriteTime.dwHighDateTime) & _
                  LEFT$(zClassName, ClassNameLen)
       END IF
       RegCloseKey(hKey)
     END IF
     
     FUNCTION = Retval
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegValueDel(hMainKey AS DWORD, sKeyName AS STRING, sValueName AS STRING) AS LONG
     'Delete a value. Return %ERROR_SUCCESS (0) if no error.
     'RegValueDel(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "ValueToDel")
     LOCAL hKey   AS DWORD
     LOCAL Retval AS LONG
     
     Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %NULL, %KEY_ALL_ACCESS, hKey)
     IF Retval = %ERROR_SUCCESS THEN
       Retval = RegDeleteValue(hKey, BYVAL STRPTR(sValueName))
       RegCloseKey(hKey)
     END IF
     FUNCTION = Retval
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegValueEnum(hMainKey AS DWORD, sKeyName AS STRING, sValueArray() AS STRING, _
                          dwRegTypeArray() AS DWORD, sDataArray() AS STRING, dwValueCount AS DWORD)AS LONG
     'Set sValueArray(), dwRegTypeArray(), sDataArray() and dwValueCount. Return %ERROR_SUCCESS (0) if no error.
     'RegValueEnum(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", sValueArray(), dwValueCount)
     LOCAL Retval     AS LONG
     LOCAL hKey       AS DWORD
     LOCAL ValueLen   AS DWORD
     LOCAL DataLen    AS DWORD
     LOCAL dwRegType  AS DWORD
     LOCAL zValueName AS ASCIIZ * %MAX_REG
     LOCAL sData      AS STRING * %MAX_REG
     
     Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %NULL, %KEY_READ, hKey)
     IF Retval = %ERROR_SUCCESS THEN
       dwValueCount = 0
       DO
         ValueLen = %MAX_REG
         DataLen  = %MAX_REG
         Retval = RegEnumValue(hKey, dwValueCount, zValueName, ValueLen, BYVAL %Null, _
                               dwRegType, sData, DataLen)
         IF Retval = %ERROR_NO_MORE_ITEMS THEN Retval = %ERROR_SUCCESS : EXIT DO
         'MsgBox "ValueCount:" & Str$(dwValueCount) & $CRLF & "ValueName: " & zValueName & $CRLF & _
         '       "ValueLen:" & STR$(ValueLen) & $CRLF & "RegType:" &  STR$(dwRegType) & $CRLF & _
         '       "DataLen:" & STR$(DataLen - 1) & $CRLF & "Data: " & REMOVE$(LEFT$(sData, DataLen), ANY $NUL)
         '       '"Data: " & LEFT$(sData, DataLen - 1) & $CRLF & "DataLen:" & STR$(DataLen)
         '       '"DataLen:" & STR$(DataLen) & $CRLF & "Data: " & REMOVE$(LEFT$(sData, DataLen), ANY $NUL)
         REDIM PRESERVE sValueArray(0 TO dwValueCount)
         sValueArray(dwValueCount) = LEFT$(zValueName, ValueLen)
         REDIM PRESERVE dwRegTypeArray(0 TO dwValueCount)
         dwRegTypeArray(dwValueCount) = dwRegType
         REDIM PRESERVE sDataArray(0 TO dwValueCount)
         IF dwRegType = %REG_DWORD THEN
           'sData = FORMAT$(CVDWD(sData)) ': MsgBox STR$(dwRegType) & $CRLF & STR$(dwSize) & $CRLF & sData
           sDataArray(dwValueCount) = FORMAT$(CVDWD(sData)) ': MsgBox STR$(dwRegType) & $CRLF & STR$(dwSize) & $CRLF & sData
         ELSE
           sDataArray(dwValueCount) = LEFT$(sData, DataLen - 1) 'Rmove last $NUL
         END IF
         'IF Retval = %ERROR_NO_MORE_ITEMS THEN Retval = %ERROR_SUCCESS : EXIT DO
         INCR dwValueCount
       LOOP WHILE Retval = %ERROR_SUCCESS
       RegCloseKey(hKey)
     END IF
     FUNCTION = Retval
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegValueExist(hMainKey AS DWORD, sKeyName AS STRING, sValueName AS STRING)AS LONG
     'Return %TRUE if value exist.
     'Retval = RegValueExist(hMainKey, sKeyName, sValueName)
     LOCAL Retval AS LONG
     LOCAL hKey   AS DWORD
     
     Retval = RegOpenKeyEx(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %NULL, %KEY_READ, hKey)
     IF Retval = %ERROR_SUCCESS THEN
       Retval = RegQueryValueEx(hKey, BYVAL STRPTR(sValueName), BYVAL %Null, _
                                BYVAL %Null, BYVAL %Null, BYVAL %Null)
       IF Retval = %ERROR_SUCCESS THEN FUNCTION = 1
       RegCloseKey(hKey)
     END IF
     
    END FUNCTION
    '______________________________________________________________________________
     
    FUNCTION RegDataSetIfNotFound(hMainKey AS DWORD, sKeyName AS STRING, sValueName AS STRING, _
                                  sData AS STRING, BYVAL dwDataType AS DWORD) AS LONG
     'Create a value and set data if value doesn't exist. Return %ERROR_SUCCESS (0) if no error.
     'RegDataSetIfNotFound(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "Value REG_SZ", "SomeData", %REG_SZ)
     LOCAL Retval AS LONG
     
     Retval = RegValueExist(hMainKey, sKeyName, sValueName)
     IF Retval = 0 THEN
       RegDataSet(hMainKey, sKeyName, sValueName, sData, dwDataType)
     ELSE
       FUNCTION = 0
     END IF
     
    END FUNCTION
    '______________________________________________________________________________
     
    SUB MsgBx(sBuffer AS STRING, sCaption AS STRING)
     
     MessageBox %HWND_DESKTOP, BYCOPY sBuffer, BYCOPY sCaption, %MB_ICONINFORMATION OR %MB_OK
     
    END SUB
    '______________________________________________________________________________
     
    FUNCTION PBMAIN()AS LONG
     LOCAL LastWriteTime   AS FILETIME
     LOCAL SysTime         AS SYSTEMTIME
     LOCAL zBuffer         AS ASCIIZ * %MAX_REG
     LOCAL sBuffer         AS STRING
     LOCAL sQuery          AS STRING
     LOCAL dwRegType       AS DWORD
     LOCAL dwData          AS DWORD
     LOCAL Counter         AS LONG
     LOCAL dwKeyCount      AS DWORD
     LOCAL dwValueCount    AS DWORD
     DIM sKeyArray(0)      AS STRING
     DIM sValueArray(0)    AS STRING
     DIM sDataArray(0)     AS STRING
     DIM dwRegTypeArray(0) AS DWORD
     DIM sReg(0 TO 8)      AS STRING
     
     sReg(0) = "REG_NONE"
     sReg(1) = "REG_SZ"
     sReg(2) = "REG_EXPAND_SZ"
     sReg(3) = "REG_BINARY"
     sReg(4) = "REG_DWORD"
     sReg(5) = "REG_DWORD_BIG_ENDIAN"
     sReg(6) = "REG_LINK"
     sReg(7) = "REG_MULTI_SZ"
     sReg(8) = "REG_RESOURCE_LIST"
     
     'Organisation: %HKEY_MAIN\Key\SubKey\Value\Data
     'Data type:    %REG_SZ, %REG_MULTI_SZ, %REG_EXPAND_SZ, REG_DWORD, REG_BINARY, REG_NONE
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegKeySet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test")
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegKeySet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test\SubKey01")
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegDataSet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", _
                 "", "DefaultData", %REG_SZ)
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegDataSet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", _
                 "Value REG_SZ", "SomeData", %REG_SZ)
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegDataSet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", _
                 "Value REG_MULTI_SZ", "SomeData" & $NUL & "MoreData" & $NUL & "NoMoreData" & $NUL  & $NUL, %REG_MULTI_SZ)
     RegDataGet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", _
                 "Value REG_MULTI_SZ", sBuffer, dwRegType)
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegDataSet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", _
                 "Value REG_EXPAND_SZ", "%ProgramFiles%\SomeFolder", %REG_EXPAND_SZ)
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     'REG_EXPAND_SZ data can be expanded with ExpandEnvironmentStrings
     RegDataExpand("%ProgramFiles%\MyFolder", sBuffer)
     MsgBx "Expanding" & $CRLF & "%ProgramFiles%\MyFolder" & $CRLF & "to" & $CRLF & sBuffer, "ExpandEnvironmentStrings"
     
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegDataSet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", _
                 "Value REG_DWORD-1", "Changed this to REG_DWORD", %REG_SZ)
     RegDataSet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", _
                 "Value REG_DWORD-1", "&HFFFFFFFF", %REG_DWORD)
     '           "Value REG_DWORD-1", "4294967295", %REG_DWORD)
     '           "Value REG_DWORD-1", "123456789", %REG_DWORD)
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegDataGetType(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", _
                    "Value REG_DWORD-1", dwRegType)
     MsgBx "Value REG_DWORD-1 regType: " & sReg(dwRegType), "RegDataGetType"
     'EXIT FUNCTION
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegDataSet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", _
                 "Value REG_BINARY", CHR$(1 TO 15), %REG_BINARY)
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegDataSetDword(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", _
                     "Value REG_DWORD-2", 987654321)
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegKeySet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test\SubKeyToDel")
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegKeyDel(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test\SubKeyToDel")
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegDataSet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "ValueToDel", "1", %REG_DWORD)
     RegDataSet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "ValueToDel2", "1", 0)
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegValueDel(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "ValueToDel")
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegDataGet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "Value REG_DWORD-1", sBuffer, dwRegType)
     MsgBx "RegType: " & sReg(dwRegType) & $CRLF & "LEN: " & STR$(LEN(sBuffer)) & $CRLF &"Value: " & sBuffer, "RegDataGet"
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegDataGet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "Value REG_SZ", sBuffer, dwRegType)
     MsgBx "RegType: " & sReg(dwRegType) & $CRLF & "LEN: " & STR$(LEN(sBuffer)) & $CRLF & "Value: " & sBuffer, "RegDataGet"
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegDataGetDword(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", "Value REG_DWORD-1", dwData)
     MsgBx "RegType: REG_DWORD" & $CRLF & "Value: " & FORMAT$(dwData), "RegDataGetDword"
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegKeyGetArray(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", sKeyArray(), dwKeyCount)
     sBuffer = "KeyCount:" & STR$(dwKeyCount) & $CRLF & $CRLF
     FOR Counter = 1 TO dwKeyCount
       sBuffer = sBuffer & sKeyArray(Counter - 1) & $CRLF
     NEXT
     MsgBx sBuffer, "RegKeyGetArray"
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegValueEnum(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", sValueArray(), dwRegTypeArray(), sDataArray(), dwValueCount)
     sBuffer = "ValueCount:" & STR$(dwValueCount) & $CRLF & $CRLF
     FOR Counter = 0 TO dwValueCount - 1
       sBuffer = sBuffer & "ValueName: " & sValueArray(Counter) & $CRLF & _
                 "RegType: " & sReg(dwRegTypeArray(Counter)) & $CRLF & _
                 "Data: " & sDataArray(Counter) & $CRLF & $CRLF
     NEXT
     REPLACE ANY $NUL WITH CHR$(1) IN sBuffer
     MsgBx sBuffer, "RegValueEnum"
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegKeySet(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test\Subkey02\ToDel")
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegKeyDelTree(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test\Subkey02", "ToDel")
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     RegKeyGetInfo(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", sQuery)
     'Data offset of what is in sQuery...
     'sClassName = MID$(sQuery, 41)
     'dwInfo = CVDWD(sQuery, offset) See following lines for needed offset...
     '1=ClassNameLen, 5=KeyNameCount, 9=KeyNameMaxLen, 13=ClassNameMaxLen, 17=ValueCount,
     '21=ValueNameMaxLen, 25=DataMaxLen, 29=SecurityLen, 33=LastWriteTime.dwLowDateTime,
     '37=LastWriteTime.dwHighDateTime, 41=zClassName
     LastWriteTime.dwLowDateTime = CVDWD(sQuery, 33)
     LastWriteTime.dwHighDateTime = CVDWD(sQuery, 37)
     FileTimeToSystemTime LastWriteTime, SysTime
     sBuffer = "Registry: SOFTWARE\A_registry_test"         & $CRLF & _
               "ClassName:"       & MID$(sQuery, 41)        & $CRLF & _
               "ClassNameLen:"    & STR$(CVDWD(sQuery, 01)) & $CRLF & _
               "KeyNameCount:"    & STR$(CVDWD(sQuery, 05)) & $CRLF & _
               "KeyNameMaxLen:"   & STR$(CVDWD(sQuery, 09)) & $CRLF & _
               "ClassNameMaxLen:" & STR$(CVDWD(sQuery, 13)) & $CRLF & _
               "ValueCount:"      & STR$(CVDWD(sQuery, 17)) & $CRLF & _
               "ValueNameMaxLen:" & STR$(CVDWD(sQuery, 21)) & $CRLF & _
               "DataMaxLen:"      & STR$(CVDWD(sQuery, 25)) & $CRLF & _
               "SecurityLen:"     & STR$(CVDWD(sQuery, 29)) & $CRLF & _
               "LastWriteTime: "  & FORMAT$(SysTime.wyear, "0000") & "/" & _
               FORMAT$(SysTime.wMonth,  "00") & "/" & FORMAT$(SysTime.wDay,    "00") & " " & _
               FORMAT$(SysTime.wHour,   "00") & ":" & FORMAT$(SysTime.wMinute, "00") & ":" & _
               FORMAT$(SysTime.wSecond, "00")
     MsgBx sBuffer, "RegKeyGetInfo"
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     REDIM sValueArray(0 TO 2) AS STRING
     REDIM sDataArray(0 TO 2) AS STRING
     REDIM dwRegTypeArray(0 TO 2) AS DWORD
     sValueArray(0) = "Value REG_SZ"
     sValueArray(1) = "Value REG_DWORD-1"
     sValueArray(2) = "Value REG_MULTI_SZ"
     sBuffer = ""
     RegDataGetArray(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_test", sValueArray(),sDataArray(), dwRegTypeArray())
     FOR Counter = 0 TO 2
       sBuffer = sBuffer & _
                 "Array" & STR$(Counter) & $CRLF & _
                 sValueArray(Counter) & $CRLF & _
                 sDataArray(Counter) & $CRLF & _
                 sReg(dwRegTypeArray(Counter)) & $CRLF & $CRLF
     NEXT
     REPLACE ANY $NUL WITH CHR$(1) IN sBuffer
     MsgBx sBuffer, "RegDataGetArray"
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     MsgBx STR$(RegKeyExist(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_tesT\")), "RegKeyExist"
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
     MsgBx STR$(RegValueExist(%HKEY_LOCAL_MACHINE, "SOFTWARE\A_registry_tesT\","ValuE REG_DWORD-1")), "RegValueExist"
     '   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
    END FUNCTION
    '______________________________________________________________________________



    [This message has been edited by Pierre Bellisle (edited June 05, 2007).]
Working...
X