I have a situation where we run through several startup applications on our system and then eventually one of our applications calls system(main_gui.exe) to load a panel that is full screen. The taskbar is set to hidden on Windows 10. Once the main GUI is loaded, I would expect that a keyboard press would operate a button on the panel, but it does not do that until the panel is clicked (anywhere on the panel, does not have to be a button). It seems as if the panel is not in focus.
I've tried adding MakeApplicationActive(), ProcessSystemEvents(), and SetActivePanel() in various combinations and orders after the DisplayPanel() call. Nothing works.
We originally wrote the program for NT/XP on an embedded system many many years ago using CVI 5.0. We finally have upgraded to CVI 2015 SP1 and Windows 10 and I'm now experiencing this issue.
I believe the way Windows 10 tries to notify the user that the application launched (pops up the taskbar and blinks the icon) steals focus from CVI's panel until you either click on the panel or the taskbar icon.
I'm getting ready to try modifying ForegroundFlashCount to see if this might help the issue. I'm hoping that I don't have to modify ForegroundLockTimeout as I have no idea how this may impact applications written by other companies that run on our system.
Additional Info:
- Windows 10 with CVI 2015 SP1
- Panel size is set to screen resolution.
- Panel has no menu bar, no scroll bar, close control is None, set to Auto center on load.
- Everything is left unchecked in "Other Attributes" (Sizable, movable, can maximize, can minimize, title bar visible, has taskbar button, conform to system colors, use windows visual styles for controls, scale contents on resize)
- Panel is set to float always.
- Switching to a visible taskbar or making the panel float to never does not help.
- The buttons do not use callback functions, after the DisplayPanel() is called the app a while loop runs with GetUserEvent() to determine what key has been pressed.