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,
             PackDDElParam(WM_DDE_POKE,
             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 char  poke[(sizeof(DDEPOKE)-1)];
  unsigned short uTextType;                /* Type of keystrokes
  unsigned short uRetryCount;              /* Retry count 1 .. 16
  unsigned char  szKeyData[1];      /* Keystrokes
} KEYSTROKES;

typedef union tagDDE_SENDKEYSTROKES
{
  DDEPOKE     DDEpoke;
  KEYSTROKES  DDEkeys;
} DDE_SENDKEYSTROKES, *lpDDE_SENDKEYSTROKES;
The following key text types are supported:
 PCS_PURETEXT   0         /* Pure text, no HLLAPI commands
 PCS_HLLAPITEXT 1         /* Text, including HLLAPI tokens
Note:
If the keystrokes are pure text, then specifying PCS_PURETEXT will transfer the keystrokes to the host in the fastest possible manner. If PCS_HLLAPITEXT is specified, then the keystroke data can contain HLLAPI commands interspersed with the text.
aKEYS
Identifies keystrokes as the item.