用 ExitWindowsEx 重新启动智能手机
来源:互联网 发布:少儿英语培训 知乎 编辑:程序博客网 时间:2024/06/10 05:59
我玩 Windows Mobile 也有两年多的时间了。但是大多数时间还是玩得多,自己动手少。最近入手一个 HTC Tornado(Dopod 577w),突然想到要自己做一个方便重新启动的程序,这样可以不用再关机、开机地折腾。
查了下 Windows Mobile Version 5.0 SDK,发现了一个新增的函数:ExitWindowsEx。要说这个函数对于 Windows Application 开发人员来说也不算陌生。但是对于 Windows Mobile 却是新的。看一下在 C# 中的声明。
[DllImport("Aygshell.dll")]
static extern bool ExitWindowsEx(uint uFlags, int dwReserved);
其中 uFlags 的值对于 Smartphone 版本来说可以是 EWX_POWEROFF 或者 EWX_REBOOT。可以这样定义:
private const uint EWX_REBOOT = 2;
private const uint EWX_POWEROFF = 8;
调用这个方法就更简单了:
ExitWindowsEx(EWX_REBOOT, 0); // 重新启动设备
很容易吧。我为 Tornado 专门做了一个小程序,也适用于其他 QVGA 分辨率的 Windows Mobile 5 Smartphone(由于时间有限,而且用的是 .NET CF 1.0,所以没有写根据设备分辨率自动调整画面的代码)。
这个小玩具可以在下列地址找到:http://forum.xda-developers.com/viewtopic.php?t=43553
- 用 ExitWindowsEx 重新启动智能手机
- ExitWindowsEx
- ExitWindowsEx
- ExitWindowsEx 函数
- 智能手机
- 智能手机
- 智能手机?
- 智能手机
- Linux用Tomcat重新启动脚本
- HookAPI 之 ExitWindowsEX
- ExitWindowsEx函数调用前需提权
- API函数ExitWindowsEx关机
- ExitWindowsEx函数 关闭计算机
- 重新启动用Whirr建立的Hadoop集群
- ExitWindowsEx 实现关机、重启
- Windows硬件系统函数 - ExitWindowsEx
- Window关机函数ExitWindowsEx详解
- ExitWindowsEx()函数的相关用法
- 理清各种Java开发方面概念的文章,超级好
- 我的博客
- PropertyGrid用法总结
- 使用ODBCTOOL创建DSN.
- mod_python官方手册翻译-全文
- 用 ExitWindowsEx 重新启动智能手机
- 装修日记-主材采购
- 开始按新方法学日语了--特发此文以示纪念
- Linux的配置-挺常用的
- Velocity Quick Start [5] - 在模板中使用对象属性、方法
- 博客连连看 7.0
- Prefactoring 2.6节 的两篇补充资料(sidebar)
- 装修日记——装修时间
- SNMP_PP_CHS Charpter 18