In C++, I am listening to WM_POWERBROADCAST message sent to my
application, the wParam is telling you :
// 0x9 Battery power is low.
case PBT_APMBATTERYLOW:
break;
// 0xB OEM-defined event occurred.
case PBT_APMOEMEVENT:
break;
// 0xA Power status has changed.
case PBT_APMPOWERSTATUSCHANGE:
break;
// 0x0 Request for permission to suspend.
case PBT_APMQUERYSUSPEND:
break;
// 0x2 Suspension request denied.
case PBT_APMQUERYSUSPENDFAILED:
break;
// 0x12 Operation resuming automatically after event.
case PBT_APMRESUMEAUTOMATIC:
break;
// 0x6 Operation resuming after critical suspension.
case PBT_APMRESUMECRITICAL:
break;
// 0x7 Operation resuming after suspension.
case PBT_APMRESUMESUSPEND:
break;
// 0x4 System is suspending operation.
case PBT_APMSUSPEND:
break;
If you can catch this message in J, if you get the PBT_APMSUSPEND param,
then you can try to communicate with the user, or safely close your
software directly.
Have a nice day!
Simon
Le 2007-07-04 01:40, Devon McCormick a écrit :
Members of the Forum -
I have a J process that runs in the background and spawns other processes.
The problem is, when I shut down my system, the shutdown halts with a
message
telling me the system couldn't shut down J and asking if I want to proceed.
Does anyone know how I can catch the system shutdown signal, assuming there
is such a thing, and make my program a better (Windows) citizen? That is,
I'd
like it to shut itself down without requiring manual intervention when
everything else
is being shut down.
Thanks,
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm