易截截图软件、单文件、免安装、纯绿色、仅160KB

按挂机键后程序退到后台运行,按c键结束程序

目的:当程序在前台运行时,按挂机键程序不退出,只是退到后台运行,程序在后台运行时,按c键能把程序结束
方法:在HandleWsEventL()中屏蔽挂机键KAknUidValueEndKeyCloseEvent,在值在avkon.hrh中定义,实践中发现8.0sdk的avkon.hrh没有定义KAknUidValueEndKeyCloseEvent,唯有手工添加定义#define  KAknUidValueEndKeyCloseEvent   0x101F87F0
测试:在3230,N70和E61i上测试通过
void CMyClientAppUi::HandleWsEventL(const TWsEvent &aEvent, CCoeControl *aDestination)
{
 switch (aEvent.Type())
 {
 case KAknUidValueEndKeyCloseEvent:
 break;
 default:
 CAknAppUi::HandleWsEventL(aEvent, aDestination);
 }
}
// ----------------------------------------------------
// CPocoClientAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CMyClientAppUi::HandleCommandL(TInt aCommand)
{
 switch ( aCommand )
 {
 case EEikCmdExit:
  {
   Exit();     
   break;
  }
  // TODO: Add Your command handling code here
  
 default:
  break;     
 }
 
}


相关文档:

C/C++求最大公约数和最小公倍数(转)

下面用到的方法叫辗转相除法,具做步骤如下   
    
   先用小的一个数除大的一个数,得第一个余数;   
   再用第一个余数除小的一个数,得第二个余数;   
   又用第二个余数除第一个余数,得第三个余数; &nb ......

C的动态内存管理 mallac()和free()

      关于c的动态内存管理一直是个经久不衰的话题,面试也是基本上都会考的,本来感觉已经明白了,但是今天使用的时候一不小心导致程序崩溃了,因此深入的去查了下资料,收获不少...贴出来与大家分享...
     先贴个错误代码:
     int * ptr = (int *)mal ......

extern "C"

extern "C"



  extern "C" 包含双重含义,从字面上即可得到:首先,被它修饰的目标是“extern”的;其次,被它修饰的目标是“C”的。让我们来详细解读这两重含义。
  (1) 被extern "C"限定的函数或变量是extern类型的;
  extern是C/C++语言中表 ......

实例解析linux内核I2C体系结构

一、概述
谈到在linux系统下编写I2C驱动,目前主要有两种方式,一种是把I2C设备当作一个普通的字符设备来处理,另一种是利用linux I2C驱动体系结构来完成。下面比较下这两种驱动。
第一种方法的好处(对应第二种方法的劣势)有:
        ●    思路比较直接,不需要 ......

The meaning of the c in calloc

The meaning of the c in calloc was vividly discussed in comp.lang.c in October 2000 (see here), with both clear (because, unlike malloc, calloc clears the memory it returns) and count (because, unlike malloc, calloc is passed a count of elements to allocate) suggested as possible explanations, howev ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号