易截截图软件、单文件、免安装、纯绿色、仅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写的3D迷宫

          Boss说,要看OpenGL,看了快一个月,总算出了个像样的东西,用C写了个3D迷宫,
虽然只有350行
       代码,不过边学边写,足足写了一周时间,还是小有成就感的,活活活!
         &n ......

关于C、C++中的const和指针

偶然的因素,对const来了点兴趣,做了一下实验:
1. 语法:const、指针
       在gcc中, 对于C语言,下面的语句是合法的:
const int a=0;
int *p=&a;
      而C++中,需要手工强制转换才能编译通过:
        ......

C/C++语言void及void指针深层探索

C/C++语言void及void指针深层探索
1.概述
许多初学者对C/C++语言中的void及void指针类型不甚理解,因此在使用上出现了一些错误。本文将对void关键字的深刻含义进行解说,并详述void及void指针类型的使用方法与技巧。
2.void的含义
void的字面意思是“无类型”,void *则为“无类型指针”,void ......

extern "C"

extern "C"



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

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号