[url removed, login to view] Class for monitoring the Keyboard on terminal servers

In Progress

For a program to insert text blocks in other programs (eg MS Word) I need a [url removed, login to view] 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

KeyWatch-Properties

-------------------

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.

KeyWatch-Methoden

-----------------

Start()

Starts monitoring the keyboard

Stop()

Stops monitoring the keyboard

Block()

Prevents further keystrokes.

Open()

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.

InsertCB()

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-Event

--------------

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. #####

Example-Code:

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.

Skills: .NET, Visual Basic, Windows Server

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

Project ID: #1533465

Awarded to:

hardcoderz

Keyboard hook expert at your Service. Please check PM.

€205 EUR in 5 days
(13 Reviews)
5.3