如何使用C# for Windows Mobile5.0进行冷启动和热启动?
有没有可以在windows-mobile 5.0上运行命令提示符的程序?
提前感谢
发布于 2011-04-18 17:39:59
[DllImport("coredll.dll")]
public static extern int KernelIoControl(int dwIoControlCode, IntPtr lpInBuf, int nInBufSize, IntPtr lpOutBuf, int nOutBufSize,ref int lpBytesReturned);
private int CTL_CODE(int DeviceType, int Func, int Method, int Access)
{
return (DeviceType << 16) | (Access << 14) | (Func << 2) | Method;
}
private int ResetPocketPC()
{
const int FILE_DEVICE_HAL = 0x101;
const int METHOD_BUFFERED = 0;
const int FILE_ANY_ACCESS = 0;
int bytesReturned = 0;
int IOCTL_HAL_REBOOT;
IOCTL_HAL_REBOOT = CTL_CODE(FILE_DEVICE_HAL, 15, METHOD_BUFFERED, FILE_ANY_ACCESS);
return KernelIoControl(IOCTL_HAL_REBOOT, IntPtr.Zero, 0, IntPtr.Zero, 0, ref bytesReturned);
}有关更多信息以及如何使用代码,可以从CodeProject获取。在Psion Cummunity Blog上有另一篇关于这方面的很好的文章,我强烈建议你也去看看。
https://stackoverflow.com/questions/5700737
复制相似问题