问题描述
我的要求就是这样,当我关闭电源关闭按钮,或者系统要求立即重启时,
之后我想保持系统关机执行直到我的活动完成,在我的活动中我正在开始新的流程。
其实发生了什么事,在关闭系统时,操作系统不允许启动新进程并出现错误,无法运行该进程
他们是否有任何方式来保持关闭并运行新进程并在执行新进程后,系统将关闭执行。
谢谢你b $ b
迪帕克夏尔马
Hi,
My requirement is like that, when I turn off the power off button, or system is asking for restart immediately,
after that I want to hold the system shutdown execution until my activity completed, In my activity i'm starting new process.
Actually what's happened, While shutting down the system,Operating system doesn't allow to start the new process and getting error, unable to run the process
Is their any way to hold the the shutting down the and run the new process and after executing new process, then system shut down execution happen.
Thanks
Deepak Sharma
推荐答案
论坛的这一部分适用于C Sharp语言而非OS启动/关闭。
This section of the forum is for C Sharp language not OS startup/shutdown.
但是,当操作系统因任何原因想要关机或重启时。
However, when the OS wants to shutdown or restart for whatever reason.
每个会话1进程(通常是用户)都会发出一个命令来释放
Every Session 1 process, normally the User, is issued a command to release
内存资源,如Handles和Threads to Finalize and Stop。  ;然后
memory of resources like Handles and Threads to Finalize and Stop. Then
会话0开始自己的操作系统关闭/重启过程。
the Session 0 begins its own procedure for a OS shutdown/restart.
您的应用程序应该知道操作系统是否通过消息请求终止
Your application should be aware if the OS requests termination via Message
泵所有Windows应用程序/服务都由操作系统管理。
Pump as does all Windows application/services are governed by OS.
您究竟要求的是什么?
谢谢:)
这篇关于如何在执行新进程时保持系统关闭进程执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!