首 页 | 新 闻 | Symbian | Android| Windows Mobile | J2ME | 下载中心 | 游戏策划招聘与求职 | 购书指南 | 视频教程
您现在的位置: 开发视界 >> Symbian >> 用户界面 >> 正文
N93从肖像模式调整到风景模式时如何保持当前程序在前台工作
作者:hoolee    文章来源:诺基亚论坛    更新时间:2007-11-24 17:09:41
一般来说如果将N93的摄像头进行翻转操作,则当前程序会切换到后台,而摄像机程序会出现在前台。
但有时为了防止这样的情况发生,我们可以通过如下方式来操作:
Code:
MCoeForegroundObserver::HandleLosingForeground()
{
  const TUid KNativeCameraAppUID = { 0x101ffa86}; //The UID of the native camera application

  TUid id( KNativeCameraAppUID);

  TApaTaskList taskList( CEikonEnv::Static()->WsSession() );

  TApaTask task = taskList.FindApp( id );

  if ( task.Exists() )  //If the native camera application is running
  {

          RWsSession WsSession = CCoeEnv::Static()->WsSession();

          TWsEvent event;

          TInt ForegroundWinGroup = WsSession.GetFocusWindowGroup();

          if (task.WgId()==ForegroundWinGroup)   //If the native camera application is on the foreground
          {

               const TUid KCurrentAppUID = { 0x20004A79 }; //The UID of current runing application

               TUid thisid( KCurrentAppUID );

               TApaTaskList taskList1( CEikonEnv::Static()->WsSession() );

               TApaTask task1 = taskList1.FindApp( thisid );

               if ( task1.Exists() )
               {
                      task1.BringToForeground();
               }
          }
    }
}
相关文章:
没有相关文章
 

站点地图 | 加入收藏 | 联系站长 | 广告服务 |
QQ:280529124  Tel:0592-8271361 辽ICP备05021703号