Registro de windows desde visual basic 6

Hola estoy buscando como acceder al registro de windows para poder leerlo y editarlo desde mi programa en visual basic 6 o como acceder a las variables internacionales de windows como el separador de dias el formato de fecha etc etc

1 Respuesta

Respuesta
1
Fijate si esto te sirve, yo lo uso en win98 (con el visor de api busca las propiedades LOCAL que te interesen)
Option Explicit
Private Declare Function GetTickCount& Lib "kernel32" ()
Private Declare Function GetCaretBlinkTime Lib "user32" () As Long
Private Declare Function GetDoubleClickTime Lib "user32" () As Long
Private Declare Function GetKeyboardType Lib "user32" (ByVal nTypeFlag As Long) As Long
Private Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As Long
Private Const LOCALE_USER_DEFAULT = &H400
Private Const LOCALE_SMONDECIMALSEP = &H16
Private Const LOCALE_STHOUSAND = &HF
Private Const LOCALE_SCURRENCY = &H14
Private Const LOCALE_SDATE = &H1D
Private Const LOCALE_SLONGDATE = &H20
Private Const LOCALE_SSHORTDATE = &H1F
Function GetCaretBlink()
GetCaretBlink = GetCaretBlinkTime
End Function
Function GetDoubleClick()
GetDoubleClick = GetDoubleClickTime
End Function
Function KeyboardInfo()
Dim X
X = GetKeyboardType(0)
If X = 1 Then
KeyboardInfo = "PC or compatible 83-key keyboard"
ElseIf X = 2 Then
KeyboardInfo = "Olivetti 102-key keyboard"
ElseIf X = 3 Then
KeyboardInfo = "AT or compatible 84-key keyboard"
ElseIf X = 4 Then
KeyboardInfo = "Enhanced 101- or 102-key keyboard"
ElseIf X = 5 Then
KeyboardInfo = "Nokia 1050 keyboard"
ElseIf X = 6 Then
KeyboardInfo = "Nokia 9140 keyboard"
ElseIf X = 7 Then
KeyboardInfo = "Japanese keyboard"
End If
End Function
Function MilliToHMS(Milliseconds)
Dim Sec, Min0, Min, Hr
Hr = Fix(Milliseconds / 3600000)
Min0 = Fix(Milliseconds Mod 3600000)
Min = Fix(Min0 / 60000)
Sec = Fix(Min0 Mod 60000)
Sec = Fix(Sec / 1000)
If Len(Sec) = 1 Then
Sec = "0" & Sec
End If
If Len(Min) = 1 Then
Min = "0" & Min
End If
If Len(Hr) = 1 Then
Hr = "0" & Hr
End If
MilliToHMS = Hr & ":" & Min & ":" & Sec
End Function
Function GetTimeOnWindows()
GetTimeOnWindows = MilliToHMS(GetTickCount&)
End Function
Public Function CortarCadena(ByVal varString As String) As String
Dim varNullPos As Integer
varNullPos = InStr(varString, Chr(0))
If varNullPos > 0 Then
CortarCadena = Left(varString, varNullPos - 1)
Else
CortarCadena = ""
End If
End Function
Public Function BuscarConfiguracion(Optional ByVal prmPropiedad As Long = LOCALE_SMONDECIMALSEP) As String
Dim varBuffer As String * 100
Dim rtnGetSysInfo As Long
rtnGetSysInfo = GetLocaleInfo(LOCALE_USER_DEFAULT, prmPropiedad, varBuffer, 99)
BuscarConfiguracion = CortarCadena(varBuffer)
End Function
Private Sub Form_Activate()
Dim varInfo As String
varInfo = "Hora Actual: " & Time & vbCrLf
varInfo = varInfo & "Día: " & Date & vbCrLf
varInfo = varInfo & "Tiempo que corre Win: " & GetTimeOnWindows & vbCrLf
varInfo = varInfo & "Tiempo Double Click: " & GetDoubleClick & "ms" & vbCrLf
varInfo = varInfo & "Cursor Texto Parpadeo: " & GetCaretBlink & "ms" & vbCrLf
varInfo = varInfo & "Teclado: " & KeyboardInfo & vbCrLf
varInfo = varInfo & "Portapapeles: " & Clipboard.GetText & vbCrLf
varInfo = varInfo & "Resolucion: " & Screen.Width / Screen.TwipsPerPixelX & &quo

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas