uses SDL;
function SDL_GetAppState : UInt8;
This function returns the current state of the application. The value returned is a bitwise combination of:
SDL_ActiveEvent