<bdo id='ahJyR'></bdo><ul id='ahJyR'></ul>
        <tfoot id='ahJyR'></tfoot>
      1. <i id='ahJyR'><tr id='ahJyR'><dt id='ahJyR'><q id='ahJyR'><span id='ahJyR'><b id='ahJyR'><form id='ahJyR'><ins id='ahJyR'></ins><ul id='ahJyR'></ul><sub id='ahJyR'></sub></form><legend id='ahJyR'></legend><bdo id='ahJyR'><pre id='ahJyR'><center id='ahJyR'></center></pre></bdo></b><th id='ahJyR'></th></span></q></dt></tr></i><div id='ahJyR'><tfoot id='ahJyR'></tfoot><dl id='ahJyR'><fieldset id='ahJyR'></fieldset></dl></div>

        <small id='ahJyR'></small><noframes id='ahJyR'>

        <legend id='ahJyR'><style id='ahJyR'><dir id='ahJyR'><q id='ahJyR'></q></dir></style></legend>
      2. 关闭 C++ 控制台应用程序时会发生什么

        时间:2023-08-02
          <bdo id='uMp4y'></bdo><ul id='uMp4y'></ul>
            <tbody id='uMp4y'></tbody>
        • <small id='uMp4y'></small><noframes id='uMp4y'>

          • <legend id='uMp4y'><style id='uMp4y'><dir id='uMp4y'><q id='uMp4y'></q></dir></style></legend>
            <tfoot id='uMp4y'></tfoot>

              <i id='uMp4y'><tr id='uMp4y'><dt id='uMp4y'><q id='uMp4y'><span id='uMp4y'><b id='uMp4y'><form id='uMp4y'><ins id='uMp4y'></ins><ul id='uMp4y'></ul><sub id='uMp4y'></sub></form><legend id='uMp4y'></legend><bdo id='uMp4y'><pre id='uMp4y'><center id='uMp4y'></center></pre></bdo></b><th id='uMp4y'></th></span></q></dt></tr></i><div id='uMp4y'><tfoot id='uMp4y'></tfoot><dl id='uMp4y'><fieldset id='uMp4y'></fieldset></dl></div>

                  本文介绍了关闭 C++ 控制台应用程序时会发生什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我想这个问题说明了一切,但是,如果有人关闭了 C++ 控制台应用程序会发生什么?如,单击顶角的x".它会立即关闭吗?它会抛出某种异常吗?这是未定义的行为吗?

                  I guess the question says it all, but, what happens if someone closes a c++ console app? As in, clicks the "x" in the top corner. Does it instantly close? Does it throw some sort of exception? Is it undefined behavior?

                  推荐答案

                  关闭带有x"在顶角的 c++ 控制台应用程序会抛出一个 CTRL_CLOSE_EVENT,如果您设置,您可以捕获和处理使用 SetConsoleCtrlHandler 函数的控制处理程序.在那里,您可以覆盖关闭功能并执行您想做的任何事情,然后仍然可以选择执行默认行为.

                  Closing a c++ console app with the "x" in the top corner throws an CTRL_CLOSE_EVENT which you could catch and process if you set a control handler using the SetConsoleCtrlHandler function. In there you could override the close functionality and perform whatever you wished to do, and then optionally still perform the default behavior.

                  这篇关于关闭 C++ 控制台应用程序时会发生什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:键盘输入Win32 消息循环 下一篇:使用 SendInput 发送两个或更多字符

                  相关文章

                  最新文章

                    <bdo id='v29Hp'></bdo><ul id='v29Hp'></ul>
                    <tfoot id='v29Hp'></tfoot>

                  1. <small id='v29Hp'></small><noframes id='v29Hp'>

                      <i id='v29Hp'><tr id='v29Hp'><dt id='v29Hp'><q id='v29Hp'><span id='v29Hp'><b id='v29Hp'><form id='v29Hp'><ins id='v29Hp'></ins><ul id='v29Hp'></ul><sub id='v29Hp'></sub></form><legend id='v29Hp'></legend><bdo id='v29Hp'><pre id='v29Hp'><center id='v29Hp'></center></pre></bdo></b><th id='v29Hp'></th></span></q></dt></tr></i><div id='v29Hp'><tfoot id='v29Hp'></tfoot><dl id='v29Hp'><fieldset id='v29Hp'></fieldset></dl></div>
                    1. <legend id='v29Hp'><style id='v29Hp'><dir id='v29Hp'><q id='v29Hp'></q></dir></style></legend>