esta es la clave de registro q guarda la pag de inico de IE
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\Start Page
me gustaria q en un textbox se muestre la pagina actual establecida
gracias
Yo que tu voy leyendo algún tuto de VB e intento buscar antes, sino vas a tener muchas más preguntas de este tipo :rolleyes:
:silbar: (http://www.google.com/search?hl=es&q=site%3Aforo.elhacker.net+leer%2Bregistro%2Bvb)<---click
Saludos
es que se como modificar claves...agregar, etc
pero no se como leer una clave y mostrarla
esa clave guarda en dato la pagina de inico establecida
Bueno, pero ya te he dejado la referencia a la búsqueda, lee y verás que encuentras lo que buscas (solo tienes que variar un poco la manera en la que escribes para poder leer de registro)
Saludos
Dim objShell As Object
Set objShell = CreateObject("Wscript.Shell")
On Error Resume Next
Text2.Text = objShell.RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\Start Page")
Set objShell = Nothing
me autorespondo por si a alguien le interesa
mira aca te paso un ejemplo modificado del Api-Guide (http://allapi.mentalis.org/downloads/apiguide/agsetup.exe) para sacarlo mediante api:
Enum Rootkey
HKEY_CLASSES_ROOT = &H80000000
HKEY_CURRENT_USER = &H80000001
HKEY_LOCAL_MACHINE = &H80000002
HKEY_USERS = &H80000003
HKEY_CURRENT_CONFIG = &H80000005
End Enum
Const REG_SZ = 1
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
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 RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
Function RegQueryStringValue(ByVal hKey As Long, ByVal strValueName As String) As String
Dim lResult As Long, lValueType As Long, strBuf As String, lDataBufSize As Long
lResult = RegQueryValueEx(hKey, strValueName, 0, lValueType, ByVal 0, lDataBufSize)
If lResult = 0 Then
If lValueType = REG_SZ Then
strBuf = String(lDataBufSize, Chr$(0))
lResult = RegQueryValueEx(hKey, strValueName, 0, 0, ByVal strBuf, lDataBufSize)
If lResult = 0 Then
RegQueryStringValue = Left$(strBuf, InStr(1, strBuf, Chr$(0)) - 1)
End If
End If
End If
End Function
Function GetString(HKEY_ROOT As Rootkey, sPath As String, sValue As String)
Dim Ret As Long
RegOpenKey HKEY_ROOT, sPath, Ret
GetString = RegQueryStringValue(Ret, sValue)
RegCloseKey Ret
End Function
Private Sub Command1_Click()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim Str As String
Str = GetString(HKEY_CURRENT_USER, "SOFTWARE\Microsoft\Internet Explorer\Main", "Start Page")
Me.Caption = Str
End Sub
bajate el Api-Guide (http://allapi.mentalis.org/downloads/apiguide/agsetup.exe) es una herramienta muy util para visual basic.
Saludos