WindowsPowerStateMBS class

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

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
A class to watch for power changes on a computer using Microsoft Windows as operation system.

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.

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

Release notes


The items on this page are in the following plugins: MBS Win Plugin.


WindowsPlayerMBS   -   WindowsPreviewHandlerMBS


💬 Ask a question or report a problem