Symbian前后台转换程序

//The code above show you steps that will send your GUI application to the background
void 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 BringToForeground
void 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();
  }
 }

你可能感兴趣的:(application,Symbian,keyboard)