我们如何知道系统状态,例如关机,系统锁定等. [英] how can we know system status like shut down, system locked etc.

查看:80
本文介绍了我们如何知道系统状态,例如关机,系统锁定等.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个MFC应用程序,该应用程序在Windows启动时开始执行.当应用程序结束时,它将日志文件保存在temp文件夹中.有时,当发生不正确的关闭时,我的应用程序结束而没有写入日志文件.如何消除这种情况?我们如何知道系统状态,例如关闭,系统锁定等.请提供一些提示.

谢谢
Mithun Nair

Hi,
I have an MFC application and that starts execution when windows starts.When the application ends, It keeps a log file in temp folder. Some times,when improper shut down occurs, my application ends without writing the log file. How can I remove this situation? how can we know system status like shut down, system locked etc.. Please give some hints.

Thanks
Mithun Nair

推荐答案

只要发生任何更改,就立即写入日志?还是像MS Word的自动保存一样定期更新?
Write the log immediately, whenever some change occurs? Or update it periodically, like MS Word''s auto-save?




看看WM_QUERYENDSESSION消息:
http://msdn.microsoft.com/en-us/library/aa376890% 28VS.85%29.aspx [ ^
Hi,

have a look at the WM_QUERYENDSESSION message:
http://msdn.microsoft.com/en-us/library/aa376890%28VS.85%29.aspx[^


这篇关于我们如何知道系统状态,例如关机,系统锁定等.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆