|
各位:
在Au3中该如何读取注册表的数据类型
由于我才接触Au3
这个问题我研究了很久都没研究出来
在VB我知道怎么读取
Private Declare Function RegOpenKeyEx 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
Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
Private Sub Form_Load()
Dim Handle As Long
Dim resBinary(0 To 1023) As Byte
Dim valueType As Long
Call RegOpenKeyEx(&H80000002, "SOFTWARE\Classes\JSFile\Shell\Open\Command", 0, &H20019, Handle)
Call RegQueryValueEx(Handle, "", 0, valueType, resBinary(0), 1024)
MsgBox valueType
End Sub
就可以获取到数据类型
我知道用API(RegOpenKeyEx,RegQueryValueEx)
能读取,但是在AU3里面该怎么使用希望各位帮帮我
$hKey = _RegOpenKeyEx("&H80000002", "SOFTWARE\Classes\JsFile\Shell\Open\Command")
Func _RegOpenKeyEx($hMainKey, $sSubKey)
Local $iResult
$iResult = DllCall("Advapi32.dll", "long", "RegOpenKeyEx", "hWnd", $hMainKey, "str", $sSubKey, "dword", 0, "long", "&H20019", "hWnd*", 0)
$iResult = DllCall("Advapi32.dll", "long", "RegQueryValueEx", "hWnd", $hMainKey, "str", "", "dword", 0, "dword", "&H20019", "BYTE", 0, "dword", 1024)
MsgBox(0,"123",$iResult[5])
EndFunc ;==>_RegOpenKeyEx
我这样写根本读取不出来 |
|