Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
未保存文件时,记事本等程序可以停止计算机关机过程。如何编写一个停止关机过程的程序(在 C 中)?
对于 Windows Vista 及更高版本,在 User32.dll (User32.lib) 中定义了一个名为“ShutdownBlockReasonCreate”的函数。 它有两个参数: -窗口句柄 -表示要显示的消息的字符串 如果调用成功,您的应用程序将阻止窗口关闭。 这是一个强大的功能,不应该被滥用!