//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();
}
}
GUI应用前后台切换
本文介绍了如何使用Symbian平台的API实现GUI应用程序在前台和后台之间的切换。具体包括将应用发送到后台的方法及从后台带回前台的方法,并处理键盘焦点变化的情况。

被折叠的 条评论
为什么被折叠?



