AppSuspended on startup

Archives Forums/BlitzMax Bug Reports/AppSuspended on startup

BlitzSupport(Posted 2010) [#1]
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.)


GfK(Posted 2010) [#2]
Same here in Vista SP2.

Tried a few work-arounds but nothing that actually works yet. :/


Grey Alien(Posted 2010) [#3]
I found this issue too and countered it in my framework by using a Windows API call to check if it was focused or not after the app had booted.