I thaught that I have all VIO specific stuff solved (works really nice and handy, with two different positions of the VIO window dependent on the prompt state of the editor window, so nothing important is covered), but there's another special situation which is not programmed yet and where my program still fails:
[C:\] dir | moremore let rest the output at stdout and writes into stdout (not VIO!) an additional line
----more----and then it waits for a keypress via VIO. Stdin Input always requires pressing ENTER at the end of the line, and VIO accepts a single keystroke.
Now the behaviour of my program is like I have it programmed:
- The "dir" output is shown in the editor and ends with a "----more----" line
- the VIO window does not pop up because there's no output to show (it is still empty or unchanged)
- but the invisible and empty VIO window now expects a keystroke!
In the editor I distinguish between "prompt state" and "not prompt state" (the user types a new command or the last command is still executed). So I can simply send the user input in not prompt state (program is running) to the VIO window by a WM_CHAR message to the Vio Window handle, I think this should work (have not tried yet). But now I get a new problem: I need to know whether a program waits for stdin input (a character or a line which is finished by typing ENTER) or the VIO window waits for a single keystroke. I have no clear solution for this problem yet. Any hints are appreciated. Again, the helper program running in the VIO window could perhaps help me in observing something.
I would not have the problem if MORE would send the "----more----" line to VIO instead of stdout.
The MORE substitute on Hobbes (a VIO read only editor where you have to press "q" to quit) runs completely in VIO and makes no problems. Of course users of my program do not need MORE anymore, but it could appear in cmd files. And there's the question if there are other programs which require VIO console input without writing to VIO or MORE is the only case - all stdout programs with a "press ANY key" (not only ENTER) are candidates for this problem.
Of course, I could scan the last stdout line content by searching "more" or "any key" (oops, how much languages do exist?), but I hope we find a general solution like we did for VIO output by observing the whole screen text buffer.
Perhaps one of these calls can help:
http://www.edm2.com/index.php/Category:Kbdhttp://www.edm2.com/index.php/Category:Vio