我是靠谱客的博主 单身水蜜桃,最近开发中收集的这篇文章主要介绍如何得到其他程序焦点变化和启动的通知,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

Getting notifications of focus change and launching of other applications


From Forum Nokia Wiki

 

Description
Sometimes applications need to get notifications about the change of the application in focus or launching of another application.

 


Solution


The notifications can be enabled using the following code:

 

In the constructL of the AppUi, add the following lines:

 iCoeEnv->RootWin().EnableFocusChangeEvents();
 //To get notifications about Focus change events
 iCoeEnv->RootWin().EnableGroupChangeEvents();
 //To get notifications about launching of other applications

 

After these functions are called, the events are delivered to the window server every time the particular event occurs. The code to handle the notifications is as follows:

 

 void CMyAppUi::HandleWsEventL( const TWsEvent& aEvent, 
                                CCoeControl* aDestination )
     {
     if(aEvent.Type() == EEventFocusGroupChanged)
         {
         //Focus change event
         //Handling to be done here
         }
     else if(aEvent.Type() ==  EEventWindowGroupsChanged)
         {
         //Group change event (launching of other applications)
         //Handling to be done here
         }
     CAknAppUi::HandleWsEventL(aEvent,aDestination);
     }

最后

以上就是单身水蜜桃为你收集整理的如何得到其他程序焦点变化和启动的通知的全部内容,希望文章能够帮你解决如何得到其他程序焦点变化和启动的通知所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(33)

评论列表共有 0 条评论

立即
投稿
返回
顶部