How to terminate my application?



1 comment

  • Avatar

    You can use built-in actions and rules to implement checking that process exists and waiting for it to exit. You can either bundle an application that sends an appropriate message (i.e. using SendMessage() API) or use the built-in <kill> action.

    The example with shipping an application to quit is as follows:

            <title>Requesting myapp to exit</title>

    This checks that myapp.exe is running, if it is, it asks the application to exit and waits for it to exit. It also shows a progress dialog so user is aware what is happening.

    It keeps sending the quit message until the process exits. It can be moved to before the <while> action so that sending the message is only done once.

    As for using the <kill> action, you can simply replace <runProgram> with:


    This will terminate the application, however, it will prevent asking user to perform certain actions - i.e. ask if it should write unsaved data.

Please sign in to leave a comment.