Platforms to show: All Mac Windows Linux Cross-Platform
WindowsPowerStateMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Power | MBS Win Plugin | 6.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Notes:
Not all Windows versions call the same/all events.
Your application needs to run the event loop, so events get delivered.
This function listens for WM_POWERBROADCAST sent to all applications.
see
https://msdn.microsoft.com/en-us/library/windows/desktop/aa373247(v=vs.85).aspx
You need to run ListenForSuspendResumeNotification to receive suspend/resume events.
- 17 events
- event BatteryCapacityChanged(Percentage as Integer) New in 23.4
- event BatteryLow
- event LidSwitchStateChanged(LidState as Integer) New in 23.4
- event OEMEvent(eventcode as Integer)
- event PowerSettingChange(data as MemoryBlock) New in 23.4
- event PowerSourceChanged(power as Integer) New in 23.4
- event PowerStatusChange
- event QueryStandby(PromptUser as boolean) as boolean
- event QueryStandbyFailed
- event QuerySuspend(PromptUser as boolean) as boolean
- event QuerySuspendFailed
- event ResumeAutomatic
- event ResumeCritical
- event ResumeStandby
- event ResumeSuspend
- event Standby
- event Suspend
- 4 methods
- method ListenForBatteryCapacityChanged New in 23.4
- method ListenForLidSwitchStateChanged New in 23.4
- method ListenForPowerSourceChanged New in 23.4
- method ListenForSuspendResumeNotification New in 23.4
- 5 constants
Lid States
Constant | Value | Description |
---|---|---|
LidClosed | 0 |
The lid is closed. |
LidOpened | 1 |
The lid is opened. |
Power Source States
Constant | Value | Description |
---|---|---|
PowerSourceAC | 0 |
The computer is powered by an AC power source (or similar, such as a laptop powered by a 12V automotive adapter). |
PowerSourceDC | 1 |
The computer is powered by an onboard battery power source. |
PowerSourceUPS | 2 |
The computer is powered by a short-term power source such as a UPS device. |
This class has no sub classes.
Some examples using this class:
Blog Entries
The items on this page are in the following plugins: MBS Win Plugin.
WindowsPlayerMBS - WindowsPreviewHandlerMBS
