VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Add your program to the registry to startup when windows starts

DiskJunky  (16 Submissions)   Registry   Visual Basic 5.0   Unknown Difficulty   Tue 16th January 2001   Mon 8th February 2021

Add your program to the registry to startup when windows starts

API Declarations


'---------
'If StartUp Then
' Call MakeStartUp(AddFile(App.Path, (App.EXEName & ".exe")))
'Else
' Call DeleteFromStartup(AddFile(App.Path, (App.EXEName & ".exe")))
'End If
'==================================



Option Explicit

Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Public Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long
Public Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long
Public Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public 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
Public 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 Any, ByVal cbData As Long) As Long


Public Const REG_SZ = 1 ' Unicode nul terminated String
Public Const REG_DWORD = 4 ' 32-bit number
Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_USER = &H80000001
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const HKEY_USERS = &H80000003
Public Const HKEY_PERFORMANCE_DATA = &H80000004
Public Const ERROR_SUCCESS = 0&


'Option Explicit
Const UNIT_NAME = "UTILITY"

Rate Add your program to the registry to startup when windows starts (2(2 Vote))
Add your program to the registry to startup when windows starts.bas

Add your program to the registry to startup when windows starts Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters