I have a group of programs written in DOS F77 that allowed the user to respond to various prompts, menus, etc. using a variety of keys, including F1 - F10. These programs must be upgraded. Trapping the extended key scan codes for the function keys is easy, so in general this is no problem, But, the F10 key is special. My program sees F10 and continues accordingly, but Windows also traps it and attempts to open the File object on the window's menu. Then, further input of keys is blocked until the user completes the menu action--something which of course he doesn't want to do.
A simple <escape> keypress would close the menu and allow the program to continue. But the client WANTS to use the F10 key and he doesn't WANT to follow with <esc> every time. I thought it should be easy to have my program simulate the <esc> keypress, but I can't get anything to work. I have tried using functions like:
I4 = SYSTEM (CHAR(27))
I4 = SYSTEMQQ (CHAR(27)
These work sometimes, but not consistently. Then I tried
I4 = SYSTEM (SendEscape.vbs) where SendEscape.wsh is a singel-line script file "wsecho chr(27)".
This seems to work, but unfortunately the screen flashes briefly while the script runs. Would be nice to turn this off, but I don't know how.