vb如何判断HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify\ 存在?
答案:2 悬赏:70 手机版
解决时间 2021-02-24 20:15
- 提问者网友:情歌越听越心酸
- 2021-02-23 23:22
zxx1173的方法提示 未定义变量
最佳答案
- 五星知识达人网友:我住北渡口
- 2021-02-23 23:59
你好!
用访问注册表的api函数
如有疑问,请追问。
用访问注册表的api函数
如有疑问,请追问。
全部回答
- 1楼网友:持酒劝斜阳
- 2021-02-24 00:43
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Sub Command1_Click()
Dim handle As Long
If RegOpenKey(HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify", handle) <> 0 Then
' 不存在时
Else
' 存在时
End If
RegCloseKey handle
End Sub
' 定义常量
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_CURRENT_USER = &H80000001
Const REG_SZ = 1
Const REG_DWORD = 4
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯