Source language: Translate to:

Find Out Application Exit Mode!

General questions about NeoBook

Moderator: Neosoft Support

Find Out Application Exit Mode!

Postby Cuttlas » Thu May 07, 2015 6:20 am

Hi

Is there any way to find out how an application will exit? Is there any differences between exit codes?
For example an application is doing something and it will take some minuets. At end it will close automatically, But I want to know if user has closed it by pressing on X button or not.

Possible?
User avatar
Cuttlas
 
Posts: 60
Joined: Wed Dec 07, 2011 10:45 am

Re: Find Out Application Exit Mode!

Postby HPW » Thu May 07, 2015 6:57 am

Hello,

Interesting question about an settable return-value for a neobook-app.

As long we have not have this, we can think about workarounds.
Do you have another app waitung for the end of the application?
If so, you can write a additional flag-file when it does the regular automatic end.
Then you other app could check the existence of that flag file.

You can also write the [ShutdownSource] to the flag file:
From the doc:
Code: Select all
[ShutdownStatus]  This variable can be used to abort a publication exit by setting it to “False” from within the Book Properties > Shutdown Action. For example:

SetVar "[ShutdownStatus]" "False"

Setting this variable anywhere other than in the Shutdown Action has no effect.
 
[ShutdownSource]  In addition to [ShutdownStatus] above, you can also examine the global [ShutdownSource] variable from within the Book Properties > Shutdown Action to determine what caused the publication to close. [ShutdownSource] may contain one of the following:

NeoBook  The shutdown request was triggered by NeoBook's Exit action.
 
Windows  The shutdown request originated with Windows. There are several Windows functions that could trigger a shutdown request, including: selecting "Turn off computer" from the Start Menu; the Task Manager's End Task command; or manually closing the application's icon from the System Tray. You should not normally refuse to close the publication when the requested to by Windows.
 
CloseButton  The user clicked on the publication window's close button, selected close from the system menu, or pressed Alt+F4.
 
For example, to minimize the publication instead of closing it when the source of the shutdown is the close button, do the following:

If "[ShutdownSource]" "=" "CloseButton"
  SetVar "[ShutdownStatus]" "False"
  SetVar "[WindowState]" "Minimized"
EndIf
 


Regards
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: Find Out Application Exit Mode!

Postby Cuttlas » Thu May 07, 2015 11:57 am

HPW wrote:As long we have not have this, we can think about workarounds.


Hi HPW, Thanks For reply.

I have another question. What Are Exit Codes? Are those Constant Values for each exe file in any OS? Is there any diffrence between normal close and force close in Application's Exit Code? and such questions to find out the exact values for exit codes so we can use them better and More efficient.
User avatar
Cuttlas
 
Posts: 60
Joined: Wed Dec 07, 2011 10:45 am

Re: Find Out Application Exit Mode!

Postby HPW » Thu May 07, 2015 1:05 pm

Hello,
What Are Exit Codes?


Exit Codes are often used with commandline Tools in Windows. I am not sure with other OS.
0 ist mostly set when the app worked successfull.
Other number means mostly error-codes.
I think there is no Standard which code is which error, so app dependent like their commandline Parameters.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: Find Out Application Exit Mode!

Postby Cuttlas » Fri May 08, 2015 6:00 am

I have tested two programs. In Normal Exit (Exit When Done) the Exit Code will be 0 or 1.
For Both programs if user exits them by pressing the X button the Exit code will be 3221225786. As you can see, same number for two different programs!
Is 3221225786 number for user exiting? Is this number the same in all windows? and such questions....
User avatar
Cuttlas
 
Posts: 60
Joined: Wed Dec 07, 2011 10:45 am

Re: Find Out Application Exit Mode!

Postby HPW » Fri May 08, 2015 7:34 am

Not sure if there any standard.

This may help a bit:

http://www.febooti.com/products/automat ... xit-codes/

But I think it is app-dependent. Using any standard meaning is not a must-to-do.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: Find Out Application Exit Mode!

Postby Cuttlas » Fri May 08, 2015 7:56 am

HPW wrote:http://www.febooti.com/products/automation-workshop/online-help/events/run-dos-cmd-command/exit-codes/


Thank You HPW, that is which I was looking for. That's GREAT. Helped me a lot 8)
User avatar
Cuttlas
 
Posts: 60
Joined: Wed Dec 07, 2011 10:45 am


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 0 guests