开发者

how to perform cold-boot & warm-boot by C# code on windows-mobile 5.0?

How to perform cold-boot & warm开发者_运维技巧-boot using C# for Windows Mobile 5.0?

and is there any program that can run command prompt on windows-mobile 5.0 ?

thanks in advance


[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);

        }

More informations and how to use the code can be obtained from CodeProject. There is another great article about this at Psion Cummunity Blog, that I highly recommend you to check out too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜