Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
Option Explicit
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 RegCreateKey Lib "advapi32.dll" _
Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal _
lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" _
Alias "RegSetValueExA" (ByVal hKey As Long, ByVal _
lpValueName As String, ByVal Reserved As Long, _
ByVal dwType As Long, lpData As Long, ByVal cbData _
As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" _
(ByVal hKey As Long) As Long
Private Declare Function RegDeleteValue Lib "advapi32.dll" _
Alias "RegDeleteValueA" (ByVal hKey As Long, _
ByVal lpValueName As String) As Long
Const HKEY_CLASSES_ROOT As Long = &H80000000
Const HKEY_CURRENT_USER As Long = &H80000001
Const HKEY_LOCAL_MACHINE As Long = &H80000002
Const HKEY_USERS As Long = &H80000003
Const HKEY_PERFORMANCE_DATA As Long = &H80000004
Const HKEY_CURRENT_CONFIG As Long = &H80000005
Const HKEY_DYN_DATA As Long = &H80000006
Const KEY_QUERY_VALUE As Long = &H1&
Const KEY_SET_VALUE As Long = &H2&
Const KEY_CREATE_SUB_KEY As Long = &H4&
Const KEY_ENUMERATE_SUB_KEYS As Long = &H8&
Const KEY_NOTIFY As Long = &H10&
Const KEY_CREATE_LINK As Long = &H20&
Const KEY_READ As Long = KEY_QUERY_VALUE Or _
KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY
Const KEY_ALL_ACCESS As Long = KEY_QUERY_VALUE Or _
KEY_SET_VALUE Or KEY_CREATE_SUB_KEY Or _
KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY Or _
KEY_CREATE_LINK
Const ERROR_SUCCESS As Long = 0&
Const REG_NONE As Long = 0&
Const REG_SZ As Long = 1&
Const REG_EXPAND_SZ As Long = 2&
Const REG_BINARY As Long = 3&
Const REG_DWORD As Long = 4&
Const REG_DWORD_LITTLE_ENDIAN As Long = 4&
Const REG_DWORD_BIG_ENDIAN As Long = 5&
Const REG_LINK As Long = 6&
Const REG_MULTI_SZ As Long = 7&
Const REG_OPTION_NON_VOLATILE As Long = &H0&
Public Sub SetAutoRun()
Dim hKey&
Dim sname
sname = "test"
RegOpenKey HKEY_LOCAL_MACHINE "software\microsoft\windows\currentversion\run", hKey
RegSetValueEx hKey, sname, 0, REG_SZ
RegCloseKey hKey
End Sub
We use essential cookies to make this site work, and optional cookies to enhance your experience.