智能终端定制开发 ad
MTK/瑞芯微/高通-Android,智能模块/智能终端方案商

深度定制各类智能终端和智能硬件产品,提供硬件选型咨询、参考设计、元器件推荐、驱动开发、行业模块集成、操作系统定制与算法集成等软硬件定制服务。
contact.aspx

Android核心板产品覆盖2G、3G、4G通讯,双核、四核、八核CPU,可选的平台有MTK6580、MTK6737、MTK6750等,Android版本有5.1 6.0 7.0等。
contact.aspx

可广泛应用于低端智能POS、安防监控、车载设备、低端智能机器人、智能家居、智能硬件、工业智能手持设备、低端智能对讲设备、低端警务或执法设备、智能穿戴、贩卖机、物流柜、智能门禁系统等行业和设备。
contact.aspx

可提供以太网转串口透传,WIFI转串口透传,蓝牙转串口透传,CAN总线模拟量控制输出模块等。
contact.aspx

带3G或4G通讯功能,运行android系统,有多个串口,可以外挂各种模块:条码扫描、RFID、指纹识别、身份证识别、磁条卡、ID卡、GPS/北斗模块等。
contact.aspx

具有4G通讯功能,多个RS232或RS485接口,以太网接口,USB接口,CAN接口,多个AD输入。基于Android系统智能平台,方便APP应用开发。器件严格选型,运行稳定,质量可靠。
contact.aspx

编写控制面板程序
[WinCE WM] 2009-06-16

控制面板应用程序是一个以cpl为后缀的文件(把项目生成的dll文件后缀改为cpl,或者从VS中修改配置直接生产cpl文件)。cpl文件中的回调函数CPlApplet为ctlpnl.exe进程进入你的cpl的入口点(需要导出,不管你在def文件里面,还是在函数前制定dllexport 属性),一个cpl可以支持多个applets,见下面的代码中的注释。

LONG CPlApplet(
HWNDhwndCPl, //Handle to the main window of the controlling application.
UINTmsg, //Message being sent to the Control Panel application.
LPARAMlParam1,
LPARAMlParam2
);

msg有:

CPL_INIT
初始化,控制面板应用程序此时做一些全局的初始化工作,如内存分配。

CPL_GETCOUNT
获取控制面板应用程序支持的dialog boxes个数。

CPL_NEWINQUIRE
查询控制面板应用程序的dialog boxes的信息,信息包含在lParam2参数中,使用(LPNEWCPLINFO)lParam2获得指针。

typedef struct tagNEWCPLINFO {
DWORDdwSize;
DWORDdwFlags;
DWORDdwHelpContext;
LONGlData;
HICONhIcon; //Handle to the icon that represents the dialog box.
TCHARszName[32]; //The name is intended to be displayed below the icon.
TCHARszInfo[64]; //The description is intended to be displayed when the icon for the dialog
box is selected.
TCHARszHelpFile[128]; //忽略。要想使用帮助,处理WM_NOTIFY消息,然后取
得“lppsn= (LPPSHNOTIFY)lParam;”判断是否等于PSN_HELP,如果是即可调出帮助文档。
} NEWCPLINFO;

 

CPL_IDNAME
获得控制面板应用程序的名称,通过设置注册表键值[HKEY_LOCAL_MACHINE\ControlPanel\<ID name>]可以改变应用位于控制面板属性页的位置,主键值"Group"默认为dword类型1,也就是说当你不指定位置时,默认放在系统这个tab中。另外还有如下值可以选择:
0               
Personal
1 (default value)   System
2                           Connections

CPL_DBLCLK
当用户双击控制面板上的icon时,系统会发送这个消息给你的控制面部应用程序,此时你可以弹出一个dialog box。处理完这个消息之后返回0表示你成功处理这个消息了(其它消息也一样),非0表示其它。

CPL_STOP
关闭控制面部应用程序之前那一刻发送这个消息给你的控制面板应用程序。

CPL_EXIT
释放DLL文件之前那一刻发送这个消息给你的控制面板应用程序。

////////////////////////////////////////////////////////
// This is the entry point called by ctlpnl.exe
//
////////////////////////////////////////////////////////
extern"C"
__declspec(dllexport)
LONG WINAPI CPlApplet(HWND hwndCPL, UINT uMsg, LONG lParam1, LONG lParam2)
{
staticintiInitCount = 0;
intiApplet;

switch(uMsg)
{
// First message sent. It is sent only once to
// allow the dll to initialize its applet(s)
caseCPL_INIT:
if(!iInitCount)
{
if(!InitApplet(hwndCPL))
returnFALSE;
}
iInitCount++;
returnTRUE;

// Second message sent. Returnthe count of appletssupported
// by this dll
caseCPL_GETCOUNT:
// Return the number of applets we support
return(LONG)((sizeof(SystemApplets))/(sizeof(SystemApplets[0])));

// Third message sent. Sent once for each applet supported by this dll.
// The lParam1 contains the number that indicates which applet this is
// for, from 0 to 1 less than the count of applets.
// lParam2 is a NEWCPLINFO that should be filled with information about
// this applet before returning
caseCPL_NEWINQUIRE:
{
LPNEWCPLINFO lpNewCPlInfo;

lpNewCPlInfo = (LPNEWCPLINFO)lParam2;
iApplet = (int)lParam1;
lpNewCPlInfo->dwSize = (DWORD)sizeof(NEWCPLINFO);
lpNewCPlInfo->dwFlags = 0;
lpNewCPlInfo->dwHelpContext = 0;
lpNewCPlInfo->lData = SystemApplets[iApplet].icon;
lpNewCPlInfo->hIcon =
LoadIcon(g_hInstance,
(LPCTSTR)MAKEINTRESOURCE(SystemApplets[iApplet].icon));
lpNewCPlInfo->szHelpFile[0] = \0;

LoadString(g_hInstance,SystemApplets[iApplet].namestring,
lpNewCPlInfo->szName,32);
LoadString(g_hInstance,SystemApplets[iApplet].descstring,
lpNewCPlInfo->szInfo,64);
}

break;

// This is sent whenever the user clicks an icon in Settings for one of
// the applets supported by this dll. lParam1 contains the number indicating
// which applet. Return 0 if applet successfully launched, non-zero otherwise
caseCPL_DBLCLK:
iApplet = (UINT)lParam1;
if(!CreatePropertySheet(hwndCPL,iApplet))
return1;
break;

// Sent once per applet, before CPL_EXIT
caseCPL_STOP:
break;

// Sent once before the dll is unloaded
caseCPL_EXIT:
iInitCount--;
if(!iInitCount)
TermApplet();
break;

default:
break;
}

return0;
}

更详细的代码请见例子\Samples\PocketPC\CPP\win32\myBackLight,或者点这里下载。

关于任何调试cpl代码,请参照下面的文章。
------------------------------------------------------------------------------------------------------

[WinCE WM添加评论 | 评论/阅读(0/422)
评论
昵称
主页
内容
递交


Copyright @ 我的开发笔记     2008 - 2017         粤ICP备19155526号-1