//The code above show you steps that will send your GUI application to the backgroundvoid CAirLightAppUi::SendToBackground() { TApaTask task ( CEikonEnv::Static()->WsSession() );
task.SetWgId( CEikonEnv::Static()->RootWin().Identifier() );
task.SendToBackground(); }
//The code above show you steps that will send your GUI application to the BringToForegroundvoid CAirLightAppUi::BringToForeground() { TApaTask task ( CEikonEnv::Static()->WsSession() );
task.SetWgId( CEikonEnv::Static()->RootWin().Identifier() ); task.BringToForeground(); }
// Handles changes in keyboard focus when an application switches to, or from, the foreground.void CAirLightAppUi::HandleForegroundEventL(TBool aForeground) { if (aForeground) { BringToForeground(); } else { SendToBackground(); } }