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();
  }
 }

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章