Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Minimal Key Logger Using RAWINPUT

, 8 Mar 2013 CPOL
This is a VB.NET and C# version of "Minimal Key Logger Using RAWINPUT".
MessageOnlyWindowDemoCS-noexe.zip
MessageOnlyWindowDemo
MessageOnlyWindowDemo.suo
MessageOnlyWindowDemo
bin
Debug
WindowsFormsApplication1.vshost.exe.manifest
MessageOnlyWindowDemo.csproj.user
obj
Debug
WindowsFormsApplication1.Form1.resources
WindowsFormsApplication1.Properties.Resources.resources
Release
WindowsFormsApplication1.Form1.resources
WindowsFormsApplication1.Properties.Resources.resources
Properties
Settings.settings
MessageOnlyWindowDemoCS.zip
MessageOnlyWindowDemo.suo
MessageOnlyWindowDemo.exe
MessageOnlyWindowDemo.pdb
MessageOnlyWindowDemo.vshost.exe
WindowsFormsApplication1.vshost.exe
WindowsFormsApplication1.vshost.exe.manifest
Release
MessageOnlyWindowDemo.exe
MessageOnlyWindowDemo.pdb
MessageOnlyWindowDemo.csproj.user
MessageOnlyWindowDemo.csproj.GenerateResource.Cache
MessageOnlyWindowDemo.exe
MessageOnlyWindowDemo.pdb
Refactor
TempPE
WindowsFormsApplication1.Form1.resources
WindowsFormsApplication1.Properties.Resources.resources
MessageOnlyWindowDemo.csproj.GenerateResource.Cache
MessageOnlyWindowDemo.exe
MessageOnlyWindowDemo.pdb
TempPE
WindowsFormsApplication1.Form1.resources
WindowsFormsApplication1.Properties.Resources.resources
Settings.settings
MessageOnlyWindowDemoVB-noexe.zip
MessageOnlyWindowDemo.suo
WindowsApplication1.vshost.exe.manifest
MessageOnlyWindowDemo.vbproj.user
My Project
Application.myapp
Settings.settings
WindowsApplication1.Form1.resources
WindowsApplication1.Resources.resources
WindowsApplication1.Form1.resources
WindowsApplication1.Resources.resources
MessageOnlyWindowDemoVB.zip
MessageOnlyWindowDemo.suo
MessageOnlyWindowDemo.exe
MessageOnlyWindowDemo.pdb
MessageOnlyWindowDemo.vshost.exe
WindowsApplication1.vshost.exe
WindowsApplication1.vshost.exe.manifest
MessageOnlyWindowDemo.exe
MessageOnlyWindowDemo.pdb
MessageOnlyWindowDemo.vbproj.user
Application.myapp
Settings.settings
MessageOnlyWindowDemo.exe
MessageOnlyWindowDemo.pdb
MessageOnlyWindowDemo.vbproj.GenerateResource.Cache
My Project.Resources.Designer.vb.dll
WindowsApplication1.Form1.resources
WindowsApplication1.Resources.resources
MessageOnlyWindowDemo.exe
MessageOnlyWindowDemo.pdb
MessageOnlyWindowDemo.vbproj.GenerateResource.Cache
My Project.Resources.Designer.vb.dll
WindowsApplication1.Form1.resources
WindowsApplication1.Resources.resources
Public Class Form1
    Private InputHook As RawInputHook

    Public Sub InputFromKeyboard(ByVal riHeader As RAWINPUTHEADER, ByVal riKeyboard As RAWKEYBOARD)
        Dim s As String = ""
        s = s & "MCode: 0x" & riKeyboard.MakeCode.ToString("X4")
        s = s & "  VKey: 0x" & riKeyboard.VKey.ToString("X4")
        s = s & "  Mssg: 0x" & riKeyboard.Message.ToString("X4")
        s = s & "  Flag: 0x" & riKeyboard.Flags.ToString("X4")
        s = s & "   Rsrvd: 0x" & riKeyboard.Reserved.ToString("X4")
        s = s & "   ExInf: 0x" & riKeyboard.ExtraInformation.ToString("X4")
        s = s & "  Devc: 0x" & riHeader.hDevice.ToString("X4")
        s = s & "   .Size: 0x" & riHeader.dwSize.ToString("X4")
        s = s & "   .Type: 0x" & riHeader.dwType.ToString("X4")
        s = s & "   wPara: 0x" & riHeader.wParam.ToString("X4")
        s = s & Chr(13) & Chr(10)
        System.Diagnostics.Debug.Write(s)
        TextBox1.Text += s
    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        InputHook = New RawInputHook()
        AddHandler InputHook.OnRawInputFromKeyboard, AddressOf InputFromKeyboard
    End Sub
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

joejames111

United States United States
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.1411023.1 | Last Updated 8 Mar 2013
Article Copyright 2013 by joejames111
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid