加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – 如何以编程方式重启?

发布时间:2020-12-16 05:26:50 所属栏目:百科 来源:网络整理
导读:如何在c中重启? WinSDK有什么规定吗?我的程序(进程)必须这样做什么样的权限? 解决方法 有 ExitWindowsEx Function可以做到这一点.您需要传递EWX_REBOOT(0x00000002)标志来重新启动系统. 这里的重要提示(从MSDN引用): The ExitWindowsEx function returns
如何在c中重启? WinSDK有什么规定吗?我的程序(进程)必须这样做什么样的权限?

解决方法

有 ExitWindowsEx Function可以做到这一点.您需要传递EWX_REBOOT(0x00000002)标志来重新启动系统.

这里的重要提示(从MSDN引用):

The ExitWindowsEx function returns as soon as it has initiated the shutdown process. The shutdown or logoff then proceeds asynchronously. The function is designed to stop all processes in the caller’s logon session. Therefore,if you are not the interactive user,the function can succeed without actually shutting down the computer. If you are not the interactive user,use the InitiateSystemShutdown or InitiateSystemShutdownEx function.

您可以根据您的情况选择适当的功能.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读