Visual Basic - Colocar mi aplicación en el Registro de Windows

Life is soft - evento anual de software empresarial
 
Vista:

Colocar mi aplicación en el Registro de Windows

Publicado por Jorge (13 intervenciones) el 01/09/2015 23:33:06
Un saludo a todos los del Foro.
Encontré este código para: Comprobar si existe, Añadir o Quiitar una aplicación del Registro de Windows, pero algo falla al compilar:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Private mReg As cQueryReg
Private Const cvRun As String = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\"
 
' comprobar si la clave ya existe
Dim s As String
 
s = mReg.GetRegString(cvRun, txtClave.Text)
If s <> "" Then
    LabelInfo.Caption = "SI existe la clave indicada" & vbCrLf & s
Else
    LabelInfo.Caption = "NO existe la clave indicada"
End If
 
' Poner la clave
Dim s As String LabelInfo
 
s = mReg.GetRegString(cvRun, txtClave.Text)
If s <> "" Then
    LabelInfo.Caption = "La clave ya estaba asignada." & vbCrLf & s
Else
    If mReg.SetReg(cvRun, txtClave.Text, txtExe.Text) = ERROR_NONE Then
        LabelInfo.Caption = "La clave se ha asignado correctamente."
    Else
        LabelInfo.Caption = "ERROR al crear la clave."
    End If
End If
 
' Quitar la clave
Dim s As String
 
s = mReg.GetRegString(cvRun, txtClave.Text)
If s <> "" Then
    If mReg.DeleteValue(cvRun, txtClave.Text) = ERROR_NONE Then
        LabelInfo.Caption = "La clave se ha eliminado del registro."
    Else
        LabelInfo.Caption = "ERROR al eliminar la clave."
    End If
Else
    LabelInfo.Caption = "La clave NO estaba creada."
End If

¿Alguien me puede ayudar, por favor? Deseo que mi aplicación se inicie con Windows.
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
Imágen de perfil de Elier L

Colocar mi aplicación en el Registro de Windows

Publicado por Elier L (8 intervenciones) el 02/09/2015 16:29:17
Pues al parecer en la línea 1, no existe la referencia al tipo
cQueryReg

Debes ver de dónde sacan ese Tipo...
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