// upssvc.h
void UPSWaitForStateChange(
[in] DWORD aCurrentState,
[in] DWORD anInterval
);
View the official Windows Driver Kit DDI referenceNo description available.
The UPSWaitForStateChange function waits until a specified UPS state changes, or until a time-out interval elapses.
aCurrentState [in]Specifies the UPS state on which to wait. When the state of the UPS system changes from the specified state to any other state, the function returns. The specified value can be one of the following:
Utility-supplied power is normal.
Utility-supplied power is inadequate, and the UPS batteries are discharging.
Utility-supplied power is inadequate, and the UPS batteries are critically low.
Communication with the UPS is not currently established.
anInterval [in]Specifies a time-out interval, in milliseconds, for the function. If the UPS state has not changed from the specified state when the interval elapses, the function returns. A value of INFINITE means the interval never elapses.
The UPSWaitForStateChange function must wait until either the state of the UPS changes from the value specified by aCurrentState, or until the time specified by anInterval has elapsed, whichever occurs first.
A call to UPSCancelWait interrupts UPSWaitForStateChange and causes it to return.