4

如何使用 C# for Windows Mobile 5.0 执行冷启动和热启动?

是否有任何程序可以在 windows-mobile 5.0 上运行命令提示符?

提前致谢

4

1 回答 1

5
[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 博客上还有另一篇很棒的文章,我强烈建议你也去看看。

于 2011-04-18T09:39:59.360 回答