Message XppApplication():xbe_SystemPowerStatus Foundation

A change has occured in the power state of the system.

:systemPowerStatus := {| nChange, uNIL, self | ... } --> nResponse
:systemPowerStatus( <nChange> ) --> nResponse
<nChange> is a numeric value which specifies the type of power status change that occured. The following table lists the possible values of this parameter.
Values passed in <nChange>
Power Status Change Values in parameter <nChange>
Suspend Request System requests permission to suspend the computer. <nChange> contains 0 or 1.
Suspend Notification A suspend operation is imminent. <nChange> contains 4 or 5.
Resume Notification System resumed after suspension. <nChange> contains 6, 7 or 18.

This method returns a numerical value which defines the application's reponse to the power state change. The following constants defined in the file APPLICTN.CH can be used for this value:

Return values for xbe_SystemPowerStatus
Constant Description
XPP_POWERQUERY_GRANT *) Grant request to suspend the computer
XPP_POWERQUERY_DENY **) Deny request to suspend the computer
  1. Default value
  2. See notes


The xbe_SystemPowerStatus event is generated by the operating system to inform the application about power state changes. A power state change occurs whenever the system enters standby or hibernate mode, or if a laptop computer is suspended due to low batteries.

Suspending a computer disconnects all network connections. In addition, all remote files opened by the application are closed. This may cause file handles obtained before the suspend operation to become invalid when the computer is resumed later on. For this reason, it is recommended to close and reopen all database connections, table and index files when a computer is resumed from standby or hibernate mode. Additionally, all remote files opened using the file API should also be closed and reopened.

Support for power status events varies significantly between Windows operating systems. Under Windows 2000, XP and Windows Server 2003, the application is expected to respond within 20 seconds if the event denotes a request to suspend the computer. Under Windows Vista, however, denying a request to suspend the computer is not supported. In addition, the time span allowed for responding is substantially shorter under Vista. In any case, performing lengthy operations while processing xbe_SystemPowerStatus is strongly discouraged. The maximum time for responding to a suspend notification should be kept below two seconds.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.