AutomatickΘ spouÜt∞nφ aplikace po startu Windows

Postup:
V deklaraΦnφ Φßsti formulß°e zapiÜte:

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 Any, ByVal cbData 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 Const HKEY_LOCAL_MACHINE = &H80000002


Private Sub AddToStartup(ByVal sDesc As String, ByVal sFile As String)

   Dim lRegKey As Long

   RegOpenKey HKEY_LOCAL_MACHINE,_
      "Software\Microsoft\Windows\CurrentVersion\Run", lRegKey

   If lRegKey Then
      RegSetValueEx lRegKey, sDesc, 0, 1, ByVal sFile, Len(sApp)
      RegCloseKey lRegKey
   End If

End Sub

Pou₧itφ:
AddToStartup "Popis aplikace", "C:\MyApp\MyApp.exe"

Zp∞t

Autor: The Bozena