This is a little 'edge case' for AppSuspended that I've run into a few times. I don't want anything to take place if the window isn't in focus (ie. Pause Mode), but on application startup, in this particular case (described below), the window is out of focus yet not suspended.
I realise it might be arguable, since the window hasn't yet been activated in order to then be suspended, but the practical result is that a window with no focus is taking actions I don't want while out of focus. I think it ought to be considered suspended if the window doesn't have focus on startup...
' * Please see comments before running! *
' Minimise/close ALL windows except the IDE, then run this...
Delay 2000 ' Minimise IDE here before app window opens...
' Keep clicking on an outer area of the desktop that WON'T
' be covered by the window when it opens...
Graphics 640, 480
' Window does not have focus here...
Repeat
Delay 10
Until AppSuspended () ' But app is considered active (doesn't quit).
' Click in window, then outside it to end...
End
The hiding of all windows isn't needed to always get this result -- it just seems a reliable way to demonstrate the effect. (On Windows 7 here.)
|