c++ - How to automatically close my GUI application from within? -


Let me explain your question with an example. In my app, I have to provide a way to stop myself from within "myself". (An example of such a task is when my app's installer / updater needs to close it before installing an update. Another example is that when my app performs the schedule and after completing it automatically

I think that this window will be completed in the simplest position to post your message to WM_CLOSE , but there are some such cases which That its L will not work:

  • My app can display an arbitrary number of child dialog window.

  • My app may be displaying a normal control window, such as open file dialog:

     Enter image details here

    Or this one, but there may be others:

    Enter image details here

    • And at the end if no close button is available What can you do:

      Enter currently, I just want to Process I suppose to finish (either from <code> exit () </ code> method or <code> TerminateProcess </ code> from outside.) </ P> <p> But I'm curious, if <Em> Beautiful </ em> is the way to close my GUI app (from within)? </ P> </ div> <P> <div class = < P> There is no answer, it depends on the architecture of your app and what it is doing. I do not quite understand why you want to force your application to shut down while It is in a common dialogue, but if you do, then exit () is safe, in that case the process is actually shut down from the perspective of the operating system, which is in opposition to forced termination (Terminaprops) in TerminateProcess OS The objects (DLL, global data and such) may leave in an inconsistent state, and exit () will become cleaner in that respect. Generally though I'm avoiding that visible UI, the user has just vanished and instead of turning off windows in response to some users' choice.

      But, exit () will work.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -