WHat you see is definitely odd. App should close when last window is closed.
Your app not reaching app's Close event tells me it either has open windows handles (displayed or hidden windows) - or the process thread hangs, potentially deadlocked.
Your finding re the printer spooler indicates likewise. Somehow, somewhere in your code their is likely functionality calling the printing feature, perhaps code starting some printjob but not closing the printjob.
Alternative I sometimes see weird behavior if an app has duplicate events mapped to same EventID.
EX 1: User event mapped to pbm_close of a window may have the user event fire but not that window's regular Close event.
EX 2: User event mapped to a printing event ID and triggered by code using the event name - which may (inside the PB VM) initiate some printing functionality.
I can't tell exactly where code hits the print feature. For debug purposes I would:
- Insert as first line of app's Open event: RETURN
This should force app to immediately jump to its Close event and then close.
- Then gradually allow more code in app's Open event before "short circuit" RETURN
This should still force app to Close.
- At some point you may need to move the short circuit RETURN to the app manager's pfc_Open and continue.
- As long as you follow this process, each Run! of your app should be very fast.
- At some point you should see that adding one extra line suddenly starts blocking your app from closing
- and - there's your culprit statement I expect!
HTH /Michael