Cross platform "IsMyWindowActive()" ?

BlitzMax Forums/BlitzMax Programming/Cross platform "IsMyWindowActive()" ?

Jake L.(Posted 2006) [#1]
Hi,

did anyone managed to dynamically increase/decrease a programs CPU usage? Example: normally I run my game with a delay(2) in my main loop. If my game-window gets inactive (minimized, other window on top or such), I could pause my game and do a delay(80) or higher in my main loop to give more time to the system.

Under Windows I would try to catch system events or maybe find an API-call that reveals the activestate of a window.
But before spending time with a windows-only solution I wonder if anyone knows a crossplatform way (using Max only code, maybe utilizing MaxGUI) to do this?


fredborg(Posted 2006) [#2]
Look up AppSuspended in the manual.


Brucey(Posted 2006) [#3]
In MaxGUI what would be nice is an event for window deactivation...


Dreamora(Posted 2006) [#4]
Does not need MaxGUI

App Events aren't gadget bound and thus can be used without problems.


Jake L.(Posted 2006) [#5]
Thanks, fredborg. Didn't saw AppSuspended before, but as I see it does exactly what I'm looking for...