VB.NET Class for monitoring the Keyboard on terminal servers

For a program to insert text blocks in other programs (eg MS Word) I need a VB.NET assembly to monitor the keyboard. The program will later be able to run on a terminal server in user sessions. I want both the DLL and the source code. Then name of the Monitor-Class will be "KeyWatch"

In the following I describe the monitoring class: KeyWatch



EventKey ->Type: Array of Integer

In EventKey I can have one or more deposit keycodes that cause the KeyWatch event.

SplitText ->Type: Array of Integer

In SplitText, I may deposit one or more separators.




Starts monitoring the keyboard


Stops monitoring the keyboard


Prevents further keystrokes.


Removed to prevent the keyboard

Send( text as String ) as Boolean

Send( iKeyCode as Integer [, Repeat as Integer ]) as Boolean

Sends the specified text or KeyCodes to the keyboard. Return True if Successfully.


Add the contents of the clipboard into the program (As if the user presses Strg-V)

So that I can insert graphics as well.



KeyWatch( KeyText as string )

If a key is pressed, which is stored in "EventKey" KeyWatch the event is triggered. The parameter (KeyText) is the text passed that was entered prior to the event are, to a separator that is stored in Split text.

##### If that does not work, I am grateful for every suggestion. #####


Public Class Form1

Dim WithEvents oKW As New KeyWatch

Dim aST(1) as Integer

Dim aEK(0) as integer

Private Sub Form1_Load(ByVal sender As Object, ByVal e As [url removed, login to view]) Handles [url removed, login to view]

'The delimiter are the carriage return and the space

aST(0) = vbLF

aST(1) = Asc( " ")

'The event will be triggered by the # sign.

aEK(0) = Asc( "#" )

oKW. SplitText = aST

oKW. EventKey = aEK

'Then monitoring starts

[url removed, login to view]

End Sub

Private Sub Form1_Disposed(ByVal sender As Object, ByVal e As [url removed, login to view]) Handles Me. Disposed

'If the window is closed, the monitoring of the keyboard are stop.

oWK. Stop

End Sub

Private Sub KeyWatch( KeyText as String ) Handles oKW. KeyWatch

'keyboard lock

[url removed, login to view]

If (KeyText = "car#" ) then

'Delete (KeyCode 8) the last 4 Chars, the Word "car#"

[url removed, login to view]( 8, 4 )

'Adds the specified text and makes a return.

[url removed, login to view]( "Jetzt soll hier dieser Text stehen!" & vbCrLf )

End If

'keyboard unlock

[url removed, login to view]

End Sub

End Class

If the user writes the following text: "The customer gets his car#"

with the touch of the #-sign triggered the event and the text (from right to left) to the first delimiter (space between "his" and "car") passed to the event -> "car#"

I apologize for my bad English, because I understand only the language with a translation program.

Kemahiran: .NET, Visual Basic, Windows Server

Lihat lagi: code keyboard monitoring, visual basic net array, vb programs, vb net program code, vb.net if, vb.net example programs, vb net example programs, vb net array example, vb net array, string the, server assembly, programs for vb.net, if vb net, gets source code, example of vb.net, example of vb net, car hier, array program in vb.net, array in vb.net with example, 16 handles, net terminal class, vb.net for, vb.net, sign language for work, server 2012 terminal server

Tentang Majikan:
( 3 ulasan ) Voerde (Niederrhein), Germany

ID Projek: #1533465

Dianugerahkan kepada:


Keyboard hook expert at your Service. Please check PM.

€205 EUR dalam 5 hari
(13 Ulasan)