Send Keystrokes

3270 5250 VT
Yes Yes Yes
The Send Keystrokes function sends keystrokes to the connected session. The client sends the following message to the session to send keystrokes.
PostMessage( hServerWnd,
             WM_DDE_POKE,
             hClientWnd,
             MAKELONG(hData, aKEYS) );
where:
hData Identifies a handle to a Windows global memory object that contains the keystrokes to be sent to the session. The global memory object contains the following structure:
typedef struct tagKeystrokes
{
 unsigned unused:13;              // ** unused **
 unsigned fRelease:1;             // Session frees memory
 unsigned freserved:2;            // ** reserved **
 int      cfFormat;               // Always CF_DSPTEXT
 unsigned uTextType;              // Type of keystrokes
 unsigned uRetryCount;            // Retry count 1 .. 16
 unsigned char szKeyData[1];      // Keystrokes
} KEYSTROKES, FAR *lpKEYSTROKES;
The following key text types are supported:
WC_PURETEXT   0 // Pure text, no AID, or included HLLAPI
                // commands
WC_HLLAPITEXT 1 // Text, including HLLAPI tokens
Note:
If the keystrokes are pure text then specifying WC_PURETEXT will transfer the keystrokes to the host in the fastest possible manner. If WC_HLLAPITEXT is specified then the keystroke data can contain HLLAPI commands interspersed with the text.
aKEYS Identifies keystrokes as the item.