I need to programmatically minimize and maximize a full-screen 16-bit application. Unfortunately, DosBox is not an option, as this app talks about some peripherals that are not supported by DosBox.
I managed to write code (heavy for Win32 API) that can set focus, send alt + enter keys and minimize / maximize.
Everything will work, but some users have found that Alt + Enter can exit full-screen mode and started to abuse it.
I can disable Alt + Enter using the settings in PIF, but this violates my approach to programmatically passing these keys.
Is there a better alternative for getting NTVDM to programmatically switch full screen mode than sending Alt + Enter?
I used Spy ++ and found that to achieve full-screen NTVDM, the system resolution changed to 640 x 480.
I tried calling the ChangeDisplaySettings API to switch permissions as needed, but when I installed 640x480 NTVDM, it still runs as a windowed application.
I am considering setting a low-level keyboard hook (http://msdn.microsoft.com/en-us/library/ms644985(v=vs .85) .aspx) to filter Alt + Enter. I could disconnect this hook for a short moment when the application sends it. This sounds like a dangerous hack that can have many side effects. I'm also not sure if this will work, since NTVDM does not use a message loop to process keyboard input. The SendMessage API does not produce results, and Alt + Enter must be sent using the keybd_event API. Any thoughts?