Dan might be onto something.
But I can reproduce a situation like yours with a project as simple as only having a main.prg with this code:
Code:
On Shutdown Clear Events
Read Events
No embedded config.fpw.
This EXE will do nothing but READ EVENTS. The ON SHUTDOWN beforehand is there to be able to cause the CLEAR EVENTS, in itself it is not running CLEAR EVENTs, just like ON ERROR errhand() does no call to the error handler, it just says to do so in case of an error. So here a shutdown of either Windows itself or the process will cause the CLEAR EVENTS necessary to break out of the READ EVENTS.
If you start this I get a message about an invalid resource file (that's foxuser.dbf) and whether I want to overwrite it with a new empty one. It doesn't matter if you say yes or no, the app starts and what you'll see is the _SCREEN, and it has exactly the minimum menu you show in your screenshot, that's what the runtime offers as sysmenu, it lacks items that are only part of the IDE vfp9.exe, not in the runtime screen, but it simply is the full sysmenu.
Exiting by clicking the upper right _screen close button the app gives another message about foxuser.dbf, this time saying it can't write into the file C:\Windows\System32\foxuser.fpt. And if you confirm this you get into the flickering to the _screen and are only able to kill the process.
This is similar what you show and so I guess you get to this base situation, you're quite near to a final exit, but you're stuck, just not seeing these error messages. Maybe you have ON ERROR set to log errors or even suppress them in this phase. But also maybe - as said - Dan is onto something and your problem isn't about the foxuser.dbf at all.
It seems to me Windows UAC causes VFPs legacy use of System32 to not be redirected to SysWow64 all the time and that causes trouble it seems both at start and exit of a VFP process about the foxuser.dbf it manages. To avoid such problems one straight forward solution is to avoid using any foxuser.dbf resource file for your apps, so include a config.fpw with RESOURCE=OFF. I would also say this whole situation is awkward as the foxuser.dbf usually would be created in the folder of your EXE, neither in System32 nor SysWow64, so UAC would never be involved. But I've seen this message about invalid foxuser.dbf in a newly installed or built EXE with no foxuser.dbf present earlier, too, even under XP. So it's not the first time the foxuser.dbf resource file of an application was more destructive than constructive.
Test it for yourself, it might still be something completely different in your case. Dangling object references, anything still on the call stack that keeps VFP stuck in it can cause CLEAR EVENTS to never become effectively going to the line after READ EVENTS. Here it surely does. Still, the stub of any EXE VFP creates and/or the runtime initialization and initialization has and/or causes trouble with foxuser.dbf handling.
Bye, Olaf.
Olaf Doschke Software Engineering