Visual Basic - COMO PEUDO HACER PARA AGREGAR UNA CADENA DE VALOR

Life is soft - evento anual de software empresarial
 
Vista:

COMO PEUDO HACER PARA AGREGAR UNA CADENA DE VALOR

Publicado por AGUSTIN (49 intervenciones) el 22/07/2001 02:51:27
COMO PEUDO HACER PARA AGREGAR UNA CADENA DE VALOR EN HKEY_LOCAL_MACHINE/SOFTWARE/MICROSOFT/W.../CURRE..../RUN.
OSEA PARA QUE SE EJECUTE UN PROGRAMA CADA VEZ QUE SE INICIA LA PC.
COMO SE HACE Y SI ME PODES MANDAR UN EJEMPLO TE LO AGRADECERIA..
GRACIAS
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:COMO PEUDO HACER PARA AGREGAR UNA CADENA DE VAL

Publicado por Luis C. (26 intervenciones) el 22/07/2001 06:06:49
Mira yo encontre este codigo en internet y me ha funcinado perfectamente. espero que a ti tambien. Te envio un ejemplo por Mail.
Ok. Suerte....

Const REG_SZ = 1
Const REG_BINARY = 3
Const HKEY_LOCAL_MACHINE = &H80000002

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 RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) 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

Private Sub Command1_Click()
SaveString HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", "Cal", "c:\winnt\system32\calc.exe"
End Sub

Private Sub Command2_Click()
DelSetting HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", "Cal"
End Sub

Private Sub Form_Load()
Command1.Caption = "PONER CALCULADORA"
Command2.Caption = "QUITAR CALCULADORA"
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar