Start Keystroke Intercept – Function 50
This function enables your Windows HLLAPI application to intercept keystrokes sent to a session by the user.
Prerequisite functions
None.
Function call
WinHLLAPI(STARTKSINTERCEPT,lpbyString,lpwLength,lpwReturnnCode)
WinHLLAPIAsync(hWnd,STARTKSINTERCEPT,lpbyString,lpwLength,lpwReturnnCode)
Call parameters
Parameter Description
Data String A 6-byte string in the following format:
Byte 1 Short name session ID of the desired Host session, 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 enabled.
WHLLNOTCONNECTED The Host session presentation space is invalid.
WHLLPARAMETERERROR One or more call parameters are invalid.
WHLLPSBUSY The Host session is busy.
WHLLSYSERROR The function failed due to a system error.
WHLLCANCEL The asynchronous function was cancelled.
Remarks
Once this function is called, the intercepted keystrokes can be:
•  Received with Get Key (function 51) and sent to the same session or another session with Send Key (function 3).
•  Accepted and rejected with Post Intercept Status (function 52).
•  Replaced by other keystrokes with Send Key (function 3).
•  Used in a specific manner as appropriate for your Windows HLLAPI application.
If position 2 of Data String is “D,” only AID keystrokes are intercepted. All other keystrokes are passed on to the appropriate Host session presentation space.