
20/01/2006, 18:43
|
 | | | Fecha de Ingreso: septiembre-2005 Ubicación: Usulután, El Salvador
Mensajes: 477
Antigüedad: 19 años, 6 meses Puntos: 1 | |
Bueno, para ejecutar un programa de forma "invisible", basta con "ocultar" el Form: Me.Hide.
Ahora bien para que el programa se inicie con Windows, tendrias que hacer algo como esto:
Código:
Private Sub Form_Load()
SaveString HKEY_LOCAL_MACHINE, "SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN", "Transparent Analog Clock", App.Path & "\" & App.EXEName & ".exe"
End Sub
' Y en un Modulo
Public Const REG_SZ = 1
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey 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 Any, ByVal cbData As Long) As Long
Public Sub SaveString(hKey As Long, strPath As String, strValue As String, strData As String)
Dim Ret
'Create a new key
RegCreateKey hKey, strPath, Ret
'Save a string to the key
RegSetValueEx Ret, strValue, 0, REG_SZ, ByVal strData, Len(strData)
'close the key
RegCloseKey Ret
End Sub
Espero te sirva 
Saludos |