Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

当N93从肖像模式调整到风景模式时如何保持当前程序在前台工作

From Wiki
Jump to: navigation, search
Article Metadata

兼容于
平台:
Symbian

文章
huwell 在 30 Jun 2007 创建
最后由 hamishwillee 在 08 May 2013 编辑
  • 设备, 软件 版本:

S60 3rd Edition

  • 描述:

一般来说如果将N93的摄像头进行翻转操作,则当前程序会切换到后台,而摄像机程序会出现在前台。

但有时为了防止这样的情况发生,我们可以通过如下方式来操作:


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();
}
}
}
}
This page was last modified on 8 May 2013, at 00:05.
33 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×