Cross platform "IsMyWindowActive()" ?

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

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?

Look up AppSuspended in the manual.

In MaxGUI what would be nice is an event for window deactivation...

Does not need MaxGUI

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

Thanks, fredborg. Didn't saw AppSuspended before, but as I see it does exactly what I'm looking for...