易截截图软件、单文件、免安装、纯绿色、仅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、C++中的const和指针

偶然的因素,对const来了点兴趣,做了一下实验:
1. 语法:const、指针
       在gcc中, 对于C语言,下面的语句是合法的:
const int a=0;
int *p=&a;
      而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 ......

C小程序(增删改查全面练习)

1.排序小程序:练习排序基本算法和函数的应用,并体味函数用法的好处。
 #include "stdio.h"
#include "stdlib.h"
#include "string.h"
#define DATA 10
int ArrGrounp[ DATA ];
int ArrGrounp1[DATA];
#define DEFINE1 "请输入10个数:\n"
#define DEFINE2 "满足条件的数有:"
#define DEFINE3 "\n满足条件 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号