Start Keystroke Intercept (50)

Top  Previous  Next

This function intercepts keystrokes sent to a session by the user.

 

Prerequisite Functions

 

There are no prerequisite functions for this function.

 

 

Syntax

 

WinHLLAPIAsync (hWnd, lpwFunction, lpbyString, lpwLength, lpwReturnCode)

 

 

Call Parameters

 

Parameter

Description

Data String

A 6-byte string in the following format:

Byte 1  Session short name, or space or null for the current Host session.
Byte 2  Keystroke intercept code. "D" causes only AID keystrokes to be intercepted; "L" causes all keystrokes to be intercepted.
Bytes 3-6  Reserved

Data Length

Variable (256 is recommended)

PS Position

NA

 

 

Return Code

 

Code

Description

WHLLOK

Keystroke intercept has been initiated.

WHLLNOTCONNECTED

The Host session presentation space is invalid.

WHLLPARAMETERERROR

One or more parameters are invalid.

WHLLPSBUSY

Session is busy.

WHLLSYSERROR

Function failed due to a system error.

WHLLCANCEL

Asynchronous function was cancelled.

 

 

Remarks

 

The function initiates keystroke intercept and immediately returns control to your Windows HLLAPI application. This frees your application to perform other tasks while waiting for keystrokes. Once initiated, the function will post a WinHLLAPIAsync message to the window specified by hWnd whenever the user sends a key to the PS. After notification, the intercepted keystrokes can be handled in any way that is allowed by a normal EHLLAPI application. Take note that the keystroke buffer is of limited size so each keystroke should be handled and removed from the buffer.