如何在Windows上的python可执行文件中忽略CTRL\u LOGOFF\u事件?

2024-09-29 21:36:24 发布

您现在位置:Python中文网/ 问答频道 /正文

我一直在搜索或寻找答案,但除了windows服务部分外,没有找到任何特定的内容。 当用户注销时,是否可以忽略Windows发送的注销信号,并保持python executalbe(py2exe)运行(除了使用Windows服务)?你知道吗

或者我可以用其他方法让它在用户注销后继续运行?用户没有管理员权限。你知道吗


Tags: 方法答案用户权限内容信号windows管理员
1条回答
网友
1楼 · 发布于 2024-09-29 21:36:24

只有服务接收CTRL_LOGOFF_EVENT。来自MSDN:

Note that this signal is received only by services. Interactive applications are terminated at logoff, so they are not present when the system sends this signal.

由于您的进程不是服务,它甚至不会接收到该信号,因此,不可能“忽略”它。你知道吗

相关问题 更多 >

    热门问题