Jump to content

Search the Community

Showing results for tags 'regreadtoarray'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. good morning everybody. today i liked to share an small example with you which it an function to read the registry values as an array the result array is 2d array witch $a_array[n][0] = value name $a_array[n][1] = value Data $a_array[0][0] = values count here's the function #include <Array.au3> #include <WinAPIReg.au3> #include <APIRegConstants.au3> Local $a_array = _RegReadToArray("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run") If @error Then MsgBox(16, "error", @error) Exit EndIf _ArrayDisplay($a_array) Func _RegReadToArray($s_RegKey) Local $a_KeySplitInfo = StringSplit($s_RegKey, "\\", 2) If UBound($a_KeySplitInfo) <= 1 Then $a_KeySplitInfo = StringSplit($s_RegKey, "\", 2) If UBound($a_KeySplitInfo) <= 1 Then Return (1, 1, 0) EndIf Local $H_KeyInfo = "", $s_RegKeyInfo = "" Switch $a_KeySplitInfo[0] Case "hklm", "HKEY_LOCAL_MACHINE", "hklm64", "HKEY_LOCAL_MACHINE64" $H_KeyInfo = $HKEY_LOCAL_MACHINE Case "hkCu", "HKEY_CURRENT_USER", "hkCU64", "HKEY_CURRENT_USER64" $H_KeyInfo = $HKEY_CURRENT_USER Case "hkCr", "HKEY_CLASSES_ROOT", "HKCR64", "HKEY_CLASSES_ROOT64" $H_KeyInfo = $HKEY_CLASSES_ROOT Case "HKU", "HKEY_USERS", "HKU64", "HKEY_USERS64" $H_KeyInfo = $HKEY_USERS Case Else Return SetError(2, 2, 0) EndSwitch _ArrayDelete($a_KeySplitInfo, 0) $s_RegKeyInfo = _ArrayToString($a_KeySplitInfo, "\") Local $H_KeyInfoOpen = _WinAPI_RegOpenKey($H_KeyInfo, $s_RegKeyInfo, $KEY_READ) Local $A_KeyInfo = _WinAPI_RegQueryInfoKey($H_KeyInfoOpen) If @error Then Return SetError(1, 1, 0) _WinAPI_RegCloseKey($H_KeyInfoOpen) Local $A_RegVal[$A_KeyInfo[2] + 1][2] Local $iV = 1, $s_RegRead = "" While 1 $s_RegVal = RegEnumVal($s_RegKey, $iV) If @error <> 0 Then ExitLoop $s_RegRead = RegRead($s_RegKey, $s_RegVal) If Not (@error) Then $A_RegVal[$iV][0] = $s_RegVal $A_RegVal[$iV][1] = $s_RegRead EndIf $iV += 1 WEnd $A_RegVal[0][0] = UBound($A_RegVal) - 1 If $A_RegVal[0][0] >= 1 Then Return $A_RegVal Else Return SetError(3, 3, 0) EndIf EndFunc ;==>_RegReadToArray i hope you benefit from it with my greetings
×
×
  • Create New...