I have a COBOL program that opens a window and hosts a NET UserControl component, which has been declared in the Screen Section. I would like to allow the user to press the ESC key and have the program close. I have tried to capture the key in the NET component, but it looks like control goes directly back to COBOL and bypasses any event handlers in the component completely. I am OK with that, as I wanted to handle it in COBOL anyway. I started with a delegate event handler, as shown in AmortControl, but when I found that the key was not being captured in the component, I removed the event handler since there was no way to fire it.
The problem I have is that when the exception is caught in the screen accept statement, and I proceed to evaluate the value, it is MSG-VALIDATE. In other screens of the COBOL program, the ESC key (pressed in COBOL) closes the currently running program. I am unsure where MSG-VALIDATE came from. I ran AmortControl for comparison. When I press ESC when it is running, it also triggers the ON EXCEPTION of the accept statement, but I don't recognize any of the values I can see for event-occurred or event-type. And while the program does close, it seems the code processing is unnatural.
I have built AmortControl from the source code, running the DLL through NETDEFGEN to get the CPY and event DLL, making sure to put both DLLs in the folder with wrun32. But as I said, it doesn't appear that processing runs through the event DLL anyway. I'm running extend 10.0.0, Windows 10, 32-bit for development, just a desktop application for now, but the app will be run through a remote desktop also.
What am I not understanding?