找回密码
 加入
搜索
查看: 2977|回复: 4

[系统综合] 如何读取注册表数据类型

[复制链接]
发表于 2010-2-19 02:44:47 | 显示全部楼层 |阅读模式
各位:
在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

我这样写根本读取不出来
发表于 2010-2-19 08:27:51 | 显示全部楼层
#Include <WinAPIEx.au3>
_WinAPI_RegQueryValue
 楼主| 发表于 2010-2-19 14:35:50 | 显示全部楼层
#Include
_WinAPI_RegQueryValue
netegg 发表于 2010-2-19 08:27



不好意思,我是新手,找不到WinApiE.au3
 楼主| 发表于 2010-2-19 17:24:03 | 显示全部楼层
研究了一下午终于研究出来了
发表于 2010-2-20 07:29:35 | 显示全部楼层
如果是问题,请修改标题为[已解决]
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-17 00:51 , Processed in 0.241885 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表