Back in my mainframe days, I used the HLLAPI (aka WHLLPAI, aka
HLLAPI32) interface of the terminal emulators to interact with the
mainframe. Worked beautifully...

If you're interested, I'm willing to extract the low-level code from
my old projects.

gegroet,
Erik V. - http://www.erikveen.dds.nl/