[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?- Home
- Sitemap
- Product Forums
- Rocket COBOL
- RocketĀ® ACUCOBOL
- [archive] Trapping Windows Shut Down
[archive] Trapping Windows Shut Down
- November 28, 2007
- 16 replies
- 0 views
16 replies
- Author
- Rocketeer
- November 28, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?- Author
- Rocketeer
- November 28, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?- Author
- Rocketeer
- November 28, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?When you shut down Windows, it causes a tidy shutdown of MS Office and other active applications that seem to know what the trick is. I do not know what the trick is !:(
- Author
- Rocketeer
- November 28, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?When you shut down Windows, it causes a tidy shutdown of MS Office and other active applications that seem to know what the trick is. I do not know what the trick is !:(
- Author
- Rocketeer
- November 28, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?When you shut down Windows, it causes a tidy shutdown of MS Office and other active applications that seem to know what the trick is. I do not know what the trick is !:(
- Author
- Rocketeer
- November 28, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?if I've understand well the problem (trapping Win Shutdown) maybe QUIT_MODE config. variable setted to a > 0 value can help You:
see AcuGt manual book 4 sez. H.2 for more explanations.
bye Gio.
- Author
- Rocketeer
- November 28, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?if I've understand well the problem (trapping Win Shutdown) maybe QUIT_MODE config. variable setted to a > 0 value can help You:
see AcuGt manual book 4 sez. H.2 for more explanations.
bye Gio.
- Author
- Rocketeer
- November 28, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?'Windows' must be nofifying running applications in some way that it intends to shut down - but I do not know how it does that or how Acu run-time can detect the condition.
- Author
- Rocketeer
- November 28, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?'Windows' must be nofifying running applications in some way that it intends to shut down - but I do not know how it does that or how Acu run-time can detect the condition.
- Author
- Rocketeer
- November 29, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?"If you start your program in "safe" mode with the "-s" runtime option, then QUIT_MODE will be initialized to "-2" instead of "0". This prevents the user from using the Close menu item. A QUIT_MODE entry in the configuration file takes precedence over the default handling of "-s".
If a user attempts to end the Windows session when it is not allowed, a pop-up message box asks the user to terminate the application first. You can customize the message that appears in the box by setting the TEXT configuration variable, message number 18."
so it seems that trying to close system Session can be trapped by runtime and than react to it.
Some more: when system ask shutdown send a WM_DESTROY message to all existing windows so can't you try to catch MSG-CLOSE event on app main window and than reject it setting event-action to event-action-fail to prevent closing?
- Author
- Rocketeer
- November 29, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?"If you start your program in "safe" mode with the "-s" runtime option, then QUIT_MODE will be initialized to "-2" instead of "0". This prevents the user from using the Close menu item. A QUIT_MODE entry in the configuration file takes precedence over the default handling of "-s".
If a user attempts to end the Windows session when it is not allowed, a pop-up message box asks the user to terminate the application first. You can customize the message that appears in the box by setting the TEXT configuration variable, message number 18."
so it seems that trying to close system Session can be trapped by runtime and than react to it.
Some more: when system ask shutdown send a WM_DESTROY message to all existing windows so can't you try to catch MSG-CLOSE event on app main window and than reject it setting event-action to event-action-fail to prevent closing?
- Author
- Rocketeer
- November 29, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?"If you start your program in "safe" mode with the "-s" runtime option, then QUIT_MODE will be initialized to "-2" instead of "0". This prevents the user from using the Close menu item. A QUIT_MODE entry in the configuration file takes precedence over the default handling of "-s".
If a user attempts to end the Windows session when it is not allowed, a pop-up message box asks the user to terminate the application first. You can customize the message that appears in the box by setting the TEXT configuration variable, message number 18."
so it seems that trying to close system Session can be trapped by runtime and than react to it.
Some more: when system ask shutdown send a WM_DESTROY message to all existing windows so can't you try to catch MSG-CLOSE event on app main window and than reject it setting event-action to event-action-fail to prevent closing?
- Author
- Rocketeer
- November 29, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?Keith
- Author
- Rocketeer
- November 29, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?Keith
- Author
- Rocketeer
- November 29, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?Trying to do with what we have and combining manual suggestions you can try:
QUIT_MODE 100
MENU_ITEM Hot_Key ="shutdown" 100
where shutdown is a program in wich user is adviced fro a cleanup exit and try set event-action variable to event-action-fail.
Another way:
set quit_mode to -2
try trapping msg-close of main window via event-procedure
and if msg-close event is processed without a certain flag raised (of ex. by pressing a custom push button for exit) you
set event-action to event-action-fail
maybe runtime will do the job to reject WM_DESTROY for you.
hope this helps, bye Gio
Other way
- Author
- Rocketeer
- November 29, 2007
[Migrated content. Thread originally posted on 28 November 2007]
Does anyone know how to trap the Windows Shut Down so that I can either prompt the user to sign out of the Acu application, or either terminate my acu application tidily before the op system has shut down, or stop the shut down completely whilst the application is running?Trying to do with what we have and combining manual suggestions you can try:
QUIT_MODE 100
MENU_ITEM Hot_Key ="shutdown" 100
where shutdown is a program in wich user is adviced fro a cleanup exit and try set event-action variable to event-action-fail.
Another way:
set quit_mode to -2
try trapping msg-close of main window via event-procedure
and if msg-close event is processed without a certain flag raised (of ex. by pressing a custom push button for exit) you
set event-action to event-action-fail
maybe runtime will do the job to reject WM_DESTROY for you.
hope this helps, bye Gio
Other way
Recent badge winners
Neil Morrishas earned the badge Consistent Trajectory
Kevin Hondhas earned the badge Orbit Established
Kevin Hondhas earned the badge Consistent Trajectory
OsmanShariffhas earned the badge Network Contributor
OsmanShariffhas earned the badge Orbit Established
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Scanning file for viruses.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
OKThis file cannot be downloaded
Sorry, our virus scanner detected that this file isn't safe to download.
OK