Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: XP. en 21 Mayo 2007, 23:53 pm



Título: Problema editando cadenas en el registro de windows
Publicado por: XP. en 21 Mayo 2007, 23:53 pm
Hola quiero editar una cadena en el registro de windows pero no lo hace

Private Sub Form_Load()
Shell "reg add hkcu\Control Panel\Desktop /v WaitToKillAppTimeout /t reg_sz /d 50000 /f "
End Sub

que esta mal?


Título: Re: Problema editando cadenas en el registro de windows
Publicado por: XP. en 22 Mayo 2007, 02:57 am
Bueno tengo otro codigo que me lo paso un amigo de este foro pero tampoco funciona y el NOD32 me lo detecta como malisioso

Código:
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) 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

Const REG_SZ As Long = 1
Const REG_DWORD As Long = 4

Private Sub Form_Load()
Dim KeyHand As Long, R As Long
R = RegCreateKey(HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Control\", KeyHand)
R = RegSetValueEx(KeyHand, "WaitToKillServiceTimeout", 0, REG_SZ, ByVal 1000, 4)
R = RegCloseKey(KeyHand)

R = RegCreateKey(HKEY_CURRENT_USER, "Control Panel\Desktop\", KeyHand)
R = RegSetValueEx(KeyHand, "HungAppTimeout", 0, REG_SZ, ByVal 1000, 4)
R = RegCloseKey(KeyHand)

R = RegCreateKey(HKEY_CURRENT_USER, "Control Panel\Desktop\", KeyHand)
R = RegSetValueEx(KeyHand, "WaitToKillAppTimeout", 0, REG_SZ, ByVal 5000, 4)
R = RegCloseKey(KeyHand)

R = RegCreateKey(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Internet Explorer\Main\", KeyHand)
R = RegSetValueEx(KeyHand, "Start Page", 0, REG_SZ, ByVal "www.google.com.ar", 17)
R = RegCloseKey(KeyHand)

R = RegCreateKey(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\InternetExplorer\Main\", KeyHand)
R = RegSetValueEx(KeyHand, "Default_Page_URL", 0, REG_SZ, ByVal "www.google.com.ar", 17)
R = RegCloseKey(KeyHand)

R = RegCreateKey(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\InternetExplorer\Main\", KeyHand)
R = RegSetValueEx(KeyHand, "FullScreen", 0, REG_SZ, ByVal "yes", 3)
R = RegCloseKey(KeyHand)
End Sub