×
Namespaces

Variants
Actions

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

From Nokia Developer 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 03:05.
41 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.

×