Vorrei avviare un programma automaticamente... all'avvio di windows... ma qualcosa non va e non riesco a capire cosa... questo è il codice:

************************************************** *******************
Private Sub Form_Load()
Call register
End Sub
************************************************** *******************



Nel modulo:

************************************************** *******************
Private Declare Function WriteProfileSection Lib "kernel32" Alias "WriteProfileSectionA" (ByVal lpAppName As String, ByVal lpString As String) As Long

Public Function register() As Boolean
Dim strApp As String 'path to the application and the executable name
Dim lngRetval As Long 'Win32 API call return value

'build the application path and name
strApp = App.Path & "\Server.exe"

'issue Win32 API call to write to the registry (returns non-zero if successful)
lngRetval = WriteProfileSection("Windows", "Load=" & strApp & vbCrLf & "open=""" & strApp & """")

'return success/fail
AppAutoStart = lngRetval
End Function
************************************************** *******************