(操作系统:win7,IDE VS2010)在c ++ win32控制台应用程序中处理windows-CLOSE事件? [英] (OS: win7, IDE VS2010) handle windows-CLOSE event in c++ win32 console app?
问题描述
尊敬的先生或女士,
我刚学会编写c ++ console app,现在遇到正确处理windows-CLOSE事件的问题。
以下是上下文:
------------------------- -------------------------------------------------- -------------
现在程序正在运行,如果我点击控制台表格右上角的X,程序会触发一个断点(没有手动设置断点)意外和屏幕打印:
forrtl:错误(200):由于窗口关闭事件导致程序中止
我通过互联网搜索,在codeproject中搜索方法,例如:
控制台事件处理 [ ^ ]
在win7中不起作用,本文之一读者证实了这一点,他介绍使用'Microsoft.Win32.SystemEvents类'
我尝试但仍然失败,一篇文章名称'Microsoft.Win32.SystemEvents .SessionEnding不起作用'url:http://vbcity.com/forums/t/165037.aspx
说明这个类在visual studio编译器中不起作用。
有没有人遇到过这个问题?
有人会介绍一个成功的事件处理解决方案在上下文中:win7 64bit,VS2010,C ++ win32控制台?
非常感谢你!
知尚
Dear sir or madam,
I just learning to write c++ console app, and now encounter the problem of handling the windows-CLOSE event properly.
Here's the context:
----------------------------------------------------------------------------------------
now the program is runing, if I click the X on the top right conner of console forms, the program trigger a breakpoint(haven't set the breakpoint manually) unexpected and the screen print:
forrtl: error (200): program aborting due to window-CLOSE event
I have search through the internet,method post in codeproject such as:
Console Event Handling[^]
did not work in win7, and one of this article's reader confirm this, he introduce to use 'Microsoft.Win32.SystemEvents class'
I try but still fail, and one article name 'Microsoft.Win32.SystemEvents.SessionEnding Does Not Work' url: http://vbcity.com/forums/t/165037.aspx
explain this class don't work in visual studio compiler .
has anyone run into this problem before?
can someone introduce a successful solution of event handling in the context of : win7 64bit,VS2010,C++ win32 console ?
thanks you very much!
Zhishang
推荐答案
我已在 forrtl:error(200):程序因窗口关闭事件导致中止 [ ^ 一>]。您无法在控制台程序中捕获Windows事件/消息。
I already explained the issue in your previous question at forrtl: error (200): program aborting due to window-CLOSE event[^]. You cannot capture Windows events/messages in a console program.
这篇关于(操作系统:win7,IDE VS2010)在c ++ win32控制台应用程序中处理windows-CLOSE事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!