Win32 API 日本語リファレンス
ホームSystem.Power › SYSTEM_POWER_CAPABILITIES

SYSTEM_POWER_CAPABILITIES

構造体
サイズx64: 76 バイト / x86: 76 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
PowerButtonPresentBOOLEAN1+0+0電源ボタンが存在するかどうかを示すブール値。
SleepButtonPresentBOOLEAN1+1+1スリープボタンが存在するかどうかを示すブール値。
LidPresentBOOLEAN1+2+2ノートPCの蓋(リッド)が存在するかを示すブール値。
SystemS1BOOLEAN1+3+3システムがS1スリープ状態をサポートするかを示す。
SystemS2BOOLEAN1+4+4システムがS2スリープ状態をサポートするかを示す。
SystemS3BOOLEAN1+5+5システムがS3スリープ状態をサポートするかを示す。
SystemS4BOOLEAN1+6+6システムがS4休止状態をサポートするかを示す。
SystemS5BOOLEAN1+7+7システムがS5(ソフトオフ)状態をサポートするかを示す。
HiberFilePresentBOOLEAN1+8+8休止ファイルが存在するかどうかを示すブール値。
FullWakeBOOLEAN1+9+9完全なウェイクをサポートするかどうかを示すブール値。
VideoDimPresentBOOLEAN1+10+10ディスプレイ輝度低下機能が存在するかを示すブール値。
ApmPresentBOOLEAN1+11+11APM(旧式電源管理)が存在するかを示すブール値。
UpsPresentBOOLEAN1+12+12UPS(無停電電源装置)が存在するかを示すブール値。
ThermalControlBOOLEAN1+13+13温度制御機能をサポートするかどうかを示すブール値。
ProcessorThrottleBOOLEAN1+14+14プロセッサのスロットリングをサポートするかを示す。
ProcessorMinThrottleBYTE1+15+15プロセッサの最小スロットリング値。パーセントで表す。
ProcessorMaxThrottleBYTE1+16+16プロセッサの最大スロットリング値。パーセントで表す。
FastSystemS4BOOLEAN1+17+17高速なS4移行をサポートするかどうかを示すブール値。
HiberbootBOOLEAN1+18+18高速スタートアップ(ハイバーブート)対応かを示す。
WakeAlarmPresentBOOLEAN1+19+19ウェイクアラームが存在するかどうかを示すブール値。
AoAcBOOLEAN1+20+20Always On Always Connected対応かを示すブール値。
DiskSpinDownBOOLEAN1+21+21ディスクのスピンダウンをサポートするかを示すブール値。
HiberFileTypeBYTE1+22+22休止ファイルの種別を示す値。
AoAcConnectivitySupportedBOOLEAN1+23+23AoAc時の接続維持をサポートするかを示すブール値。
spare3BYTE6+24+24将来の拡張用に予約された予備領域。
SystemBatteriesPresentBOOLEAN1+30+30システムバッテリが存在するかどうかを示すブール値。
BatteriesAreShortTermBOOLEAN1+31+31バッテリが短期(UPS的)用途かを示すブール値。
BatteryScaleBATTERY_REPORTING_SCALE24+32+32バッテリ残量報告のスケール情報配列。
AcOnLineWakeSYSTEM_POWER_STATE4+56+56AC接続時にウェイク可能な最深システム電源状態。
SoftLidWakeSYSTEM_POWER_STATE4+60+60蓋開きでウェイク可能な最深システム電源状態。
RtcWakeSYSTEM_POWER_STATE4+64+64RTC(リアルタイムクロック)でウェイク可能な最深状態。
MinDeviceWakeStateSYSTEM_POWER_STATE4+68+68デバイスがウェイク可能な最小システム電源状態。
DefaultLowLatencyWakeSYSTEM_POWER_STATE4+72+72既定の低遅延ウェイクに使うシステム電源状態。

各言語での定義

#include <windows.h>

// BATTERY_REPORTING_SCALE  (x64 8 / x86 8 バイト)
typedef struct BATTERY_REPORTING_SCALE {
    DWORD Granularity;
    DWORD Capacity;
} BATTERY_REPORTING_SCALE;

// SYSTEM_POWER_CAPABILITIES  (x64 76 / x86 76 バイト)
typedef struct SYSTEM_POWER_CAPABILITIES {
    BOOLEAN PowerButtonPresent;
    BOOLEAN SleepButtonPresent;
    BOOLEAN LidPresent;
    BOOLEAN SystemS1;
    BOOLEAN SystemS2;
    BOOLEAN SystemS3;
    BOOLEAN SystemS4;
    BOOLEAN SystemS5;
    BOOLEAN HiberFilePresent;
    BOOLEAN FullWake;
    BOOLEAN VideoDimPresent;
    BOOLEAN ApmPresent;
    BOOLEAN UpsPresent;
    BOOLEAN ThermalControl;
    BOOLEAN ProcessorThrottle;
    BYTE ProcessorMinThrottle;
    BYTE ProcessorMaxThrottle;
    BOOLEAN FastSystemS4;
    BOOLEAN Hiberboot;
    BOOLEAN WakeAlarmPresent;
    BOOLEAN AoAc;
    BOOLEAN DiskSpinDown;
    BYTE HiberFileType;
    BOOLEAN AoAcConnectivitySupported;
    BYTE spare3[6];
    BOOLEAN SystemBatteriesPresent;
    BOOLEAN BatteriesAreShortTerm;
    BATTERY_REPORTING_SCALE BatteryScale[3];
    SYSTEM_POWER_STATE AcOnLineWake;
    SYSTEM_POWER_STATE SoftLidWake;
    SYSTEM_POWER_STATE RtcWake;
    SYSTEM_POWER_STATE MinDeviceWakeState;
    SYSTEM_POWER_STATE DefaultLowLatencyWake;
} SYSTEM_POWER_CAPABILITIES;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct BATTERY_REPORTING_SCALE
{
    public uint Granularity;
    public uint Capacity;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SYSTEM_POWER_CAPABILITIES
{
    [MarshalAs(UnmanagedType.U1)] public bool PowerButtonPresent;
    [MarshalAs(UnmanagedType.U1)] public bool SleepButtonPresent;
    [MarshalAs(UnmanagedType.U1)] public bool LidPresent;
    [MarshalAs(UnmanagedType.U1)] public bool SystemS1;
    [MarshalAs(UnmanagedType.U1)] public bool SystemS2;
    [MarshalAs(UnmanagedType.U1)] public bool SystemS3;
    [MarshalAs(UnmanagedType.U1)] public bool SystemS4;
    [MarshalAs(UnmanagedType.U1)] public bool SystemS5;
    [MarshalAs(UnmanagedType.U1)] public bool HiberFilePresent;
    [MarshalAs(UnmanagedType.U1)] public bool FullWake;
    [MarshalAs(UnmanagedType.U1)] public bool VideoDimPresent;
    [MarshalAs(UnmanagedType.U1)] public bool ApmPresent;
    [MarshalAs(UnmanagedType.U1)] public bool UpsPresent;
    [MarshalAs(UnmanagedType.U1)] public bool ThermalControl;
    [MarshalAs(UnmanagedType.U1)] public bool ProcessorThrottle;
    public byte ProcessorMinThrottle;
    public byte ProcessorMaxThrottle;
    [MarshalAs(UnmanagedType.U1)] public bool FastSystemS4;
    [MarshalAs(UnmanagedType.U1)] public bool Hiberboot;
    [MarshalAs(UnmanagedType.U1)] public bool WakeAlarmPresent;
    [MarshalAs(UnmanagedType.U1)] public bool AoAc;
    [MarshalAs(UnmanagedType.U1)] public bool DiskSpinDown;
    public byte HiberFileType;
    [MarshalAs(UnmanagedType.U1)] public bool AoAcConnectivitySupported;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] spare3;
    [MarshalAs(UnmanagedType.U1)] public bool SystemBatteriesPresent;
    [MarshalAs(UnmanagedType.U1)] public bool BatteriesAreShortTerm;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public BATTERY_REPORTING_SCALE[] BatteryScale;
    public int AcOnLineWake;
    public int SoftLidWake;
    public int RtcWake;
    public int MinDeviceWakeState;
    public int DefaultLowLatencyWake;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure BATTERY_REPORTING_SCALE
    Public Granularity As UInteger
    Public Capacity As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SYSTEM_POWER_CAPABILITIES
    <MarshalAs(UnmanagedType.U1)> Public PowerButtonPresent As Boolean
    <MarshalAs(UnmanagedType.U1)> Public SleepButtonPresent As Boolean
    <MarshalAs(UnmanagedType.U1)> Public LidPresent As Boolean
    <MarshalAs(UnmanagedType.U1)> Public SystemS1 As Boolean
    <MarshalAs(UnmanagedType.U1)> Public SystemS2 As Boolean
    <MarshalAs(UnmanagedType.U1)> Public SystemS3 As Boolean
    <MarshalAs(UnmanagedType.U1)> Public SystemS4 As Boolean
    <MarshalAs(UnmanagedType.U1)> Public SystemS5 As Boolean
    <MarshalAs(UnmanagedType.U1)> Public HiberFilePresent As Boolean
    <MarshalAs(UnmanagedType.U1)> Public FullWake As Boolean
    <MarshalAs(UnmanagedType.U1)> Public VideoDimPresent As Boolean
    <MarshalAs(UnmanagedType.U1)> Public ApmPresent As Boolean
    <MarshalAs(UnmanagedType.U1)> Public UpsPresent As Boolean
    <MarshalAs(UnmanagedType.U1)> Public ThermalControl As Boolean
    <MarshalAs(UnmanagedType.U1)> Public ProcessorThrottle As Boolean
    Public ProcessorMinThrottle As Byte
    Public ProcessorMaxThrottle As Byte
    <MarshalAs(UnmanagedType.U1)> Public FastSystemS4 As Boolean
    <MarshalAs(UnmanagedType.U1)> Public Hiberboot As Boolean
    <MarshalAs(UnmanagedType.U1)> Public WakeAlarmPresent As Boolean
    <MarshalAs(UnmanagedType.U1)> Public AoAc As Boolean
    <MarshalAs(UnmanagedType.U1)> Public DiskSpinDown As Boolean
    Public HiberFileType As Byte
    <MarshalAs(UnmanagedType.U1)> Public AoAcConnectivitySupported As Boolean
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> Public spare3() As Byte
    <MarshalAs(UnmanagedType.U1)> Public SystemBatteriesPresent As Boolean
    <MarshalAs(UnmanagedType.U1)> Public BatteriesAreShortTerm As Boolean
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public BatteryScale() As BATTERY_REPORTING_SCALE
    Public AcOnLineWake As Integer
    Public SoftLidWake As Integer
    Public RtcWake As Integer
    Public MinDeviceWakeState As Integer
    Public DefaultLowLatencyWake As Integer
End Structure
import ctypes
from ctypes import wintypes

class BATTERY_REPORTING_SCALE(ctypes.Structure):
    _fields_ = [
        ("Granularity", wintypes.DWORD),
        ("Capacity", wintypes.DWORD),
    ]

class SYSTEM_POWER_CAPABILITIES(ctypes.Structure):
    _fields_ = [
        ("PowerButtonPresent", ctypes.c_byte),
        ("SleepButtonPresent", ctypes.c_byte),
        ("LidPresent", ctypes.c_byte),
        ("SystemS1", ctypes.c_byte),
        ("SystemS2", ctypes.c_byte),
        ("SystemS3", ctypes.c_byte),
        ("SystemS4", ctypes.c_byte),
        ("SystemS5", ctypes.c_byte),
        ("HiberFilePresent", ctypes.c_byte),
        ("FullWake", ctypes.c_byte),
        ("VideoDimPresent", ctypes.c_byte),
        ("ApmPresent", ctypes.c_byte),
        ("UpsPresent", ctypes.c_byte),
        ("ThermalControl", ctypes.c_byte),
        ("ProcessorThrottle", ctypes.c_byte),
        ("ProcessorMinThrottle", ctypes.c_ubyte),
        ("ProcessorMaxThrottle", ctypes.c_ubyte),
        ("FastSystemS4", ctypes.c_byte),
        ("Hiberboot", ctypes.c_byte),
        ("WakeAlarmPresent", ctypes.c_byte),
        ("AoAc", ctypes.c_byte),
        ("DiskSpinDown", ctypes.c_byte),
        ("HiberFileType", ctypes.c_ubyte),
        ("AoAcConnectivitySupported", ctypes.c_byte),
        ("spare3", ctypes.c_ubyte * 6),
        ("SystemBatteriesPresent", ctypes.c_byte),
        ("BatteriesAreShortTerm", ctypes.c_byte),
        ("BatteryScale", BATTERY_REPORTING_SCALE * 3),
        ("AcOnLineWake", ctypes.c_int),
        ("SoftLidWake", ctypes.c_int),
        ("RtcWake", ctypes.c_int),
        ("MinDeviceWakeState", ctypes.c_int),
        ("DefaultLowLatencyWake", ctypes.c_int),
    ]
#[repr(C)]
pub struct BATTERY_REPORTING_SCALE {
    pub Granularity: u32,
    pub Capacity: u32,
}

#[repr(C)]
pub struct SYSTEM_POWER_CAPABILITIES {
    pub PowerButtonPresent: u8,
    pub SleepButtonPresent: u8,
    pub LidPresent: u8,
    pub SystemS1: u8,
    pub SystemS2: u8,
    pub SystemS3: u8,
    pub SystemS4: u8,
    pub SystemS5: u8,
    pub HiberFilePresent: u8,
    pub FullWake: u8,
    pub VideoDimPresent: u8,
    pub ApmPresent: u8,
    pub UpsPresent: u8,
    pub ThermalControl: u8,
    pub ProcessorThrottle: u8,
    pub ProcessorMinThrottle: u8,
    pub ProcessorMaxThrottle: u8,
    pub FastSystemS4: u8,
    pub Hiberboot: u8,
    pub WakeAlarmPresent: u8,
    pub AoAc: u8,
    pub DiskSpinDown: u8,
    pub HiberFileType: u8,
    pub AoAcConnectivitySupported: u8,
    pub spare3: [u8; 6],
    pub SystemBatteriesPresent: u8,
    pub BatteriesAreShortTerm: u8,
    pub BatteryScale: [BATTERY_REPORTING_SCALE; 3],
    pub AcOnLineWake: i32,
    pub SoftLidWake: i32,
    pub RtcWake: i32,
    pub MinDeviceWakeState: i32,
    pub DefaultLowLatencyWake: i32,
}
import "golang.org/x/sys/windows"

type BATTERY_REPORTING_SCALE struct {
	Granularity uint32
	Capacity uint32
}

type SYSTEM_POWER_CAPABILITIES struct {
	PowerButtonPresent byte
	SleepButtonPresent byte
	LidPresent byte
	SystemS1 byte
	SystemS2 byte
	SystemS3 byte
	SystemS4 byte
	SystemS5 byte
	HiberFilePresent byte
	FullWake byte
	VideoDimPresent byte
	ApmPresent byte
	UpsPresent byte
	ThermalControl byte
	ProcessorThrottle byte
	ProcessorMinThrottle byte
	ProcessorMaxThrottle byte
	FastSystemS4 byte
	Hiberboot byte
	WakeAlarmPresent byte
	AoAc byte
	DiskSpinDown byte
	HiberFileType byte
	AoAcConnectivitySupported byte
	spare3 [6]byte
	SystemBatteriesPresent byte
	BatteriesAreShortTerm byte
	BatteryScale [3]BATTERY_REPORTING_SCALE
	AcOnLineWake int32
	SoftLidWake int32
	RtcWake int32
	MinDeviceWakeState int32
	DefaultLowLatencyWake int32
}
type
  BATTERY_REPORTING_SCALE = record
    Granularity: DWORD;
    Capacity: DWORD;
  end;

  SYSTEM_POWER_CAPABILITIES = record
    PowerButtonPresent: ByteBool;
    SleepButtonPresent: ByteBool;
    LidPresent: ByteBool;
    SystemS1: ByteBool;
    SystemS2: ByteBool;
    SystemS3: ByteBool;
    SystemS4: ByteBool;
    SystemS5: ByteBool;
    HiberFilePresent: ByteBool;
    FullWake: ByteBool;
    VideoDimPresent: ByteBool;
    ApmPresent: ByteBool;
    UpsPresent: ByteBool;
    ThermalControl: ByteBool;
    ProcessorThrottle: ByteBool;
    ProcessorMinThrottle: Byte;
    ProcessorMaxThrottle: Byte;
    FastSystemS4: ByteBool;
    Hiberboot: ByteBool;
    WakeAlarmPresent: ByteBool;
    AoAc: ByteBool;
    DiskSpinDown: ByteBool;
    HiberFileType: Byte;
    AoAcConnectivitySupported: ByteBool;
    spare3: array[0..5] of Byte;
    SystemBatteriesPresent: ByteBool;
    BatteriesAreShortTerm: ByteBool;
    BatteryScale: array[0..2] of BATTERY_REPORTING_SCALE;
    AcOnLineWake: Integer;
    SoftLidWake: Integer;
    RtcWake: Integer;
    MinDeviceWakeState: Integer;
    DefaultLowLatencyWake: Integer;
  end;
const BATTERY_REPORTING_SCALE = extern struct {
    Granularity: u32,
    Capacity: u32,
};

const SYSTEM_POWER_CAPABILITIES = extern struct {
    PowerButtonPresent: u8,
    SleepButtonPresent: u8,
    LidPresent: u8,
    SystemS1: u8,
    SystemS2: u8,
    SystemS3: u8,
    SystemS4: u8,
    SystemS5: u8,
    HiberFilePresent: u8,
    FullWake: u8,
    VideoDimPresent: u8,
    ApmPresent: u8,
    UpsPresent: u8,
    ThermalControl: u8,
    ProcessorThrottle: u8,
    ProcessorMinThrottle: u8,
    ProcessorMaxThrottle: u8,
    FastSystemS4: u8,
    Hiberboot: u8,
    WakeAlarmPresent: u8,
    AoAc: u8,
    DiskSpinDown: u8,
    HiberFileType: u8,
    AoAcConnectivitySupported: u8,
    spare3: [6]u8,
    SystemBatteriesPresent: u8,
    BatteriesAreShortTerm: u8,
    BatteryScale: [3]BATTERY_REPORTING_SCALE,
    AcOnLineWake: i32,
    SoftLidWake: i32,
    RtcWake: i32,
    MinDeviceWakeState: i32,
    DefaultLowLatencyWake: i32,
};
type
  BATTERY_REPORTING_SCALE {.bycopy.} = object
    Granularity: uint32
    Capacity: uint32

  SYSTEM_POWER_CAPABILITIES {.bycopy.} = object
    PowerButtonPresent: uint8
    SleepButtonPresent: uint8
    LidPresent: uint8
    SystemS1: uint8
    SystemS2: uint8
    SystemS3: uint8
    SystemS4: uint8
    SystemS5: uint8
    HiberFilePresent: uint8
    FullWake: uint8
    VideoDimPresent: uint8
    ApmPresent: uint8
    UpsPresent: uint8
    ThermalControl: uint8
    ProcessorThrottle: uint8
    ProcessorMinThrottle: uint8
    ProcessorMaxThrottle: uint8
    FastSystemS4: uint8
    Hiberboot: uint8
    WakeAlarmPresent: uint8
    AoAc: uint8
    DiskSpinDown: uint8
    HiberFileType: uint8
    AoAcConnectivitySupported: uint8
    spare3: array[6, uint8]
    SystemBatteriesPresent: uint8
    BatteriesAreShortTerm: uint8
    BatteryScale: array[3, BATTERY_REPORTING_SCALE]
    AcOnLineWake: int32
    SoftLidWake: int32
    RtcWake: int32
    MinDeviceWakeState: int32
    DefaultLowLatencyWake: int32
struct BATTERY_REPORTING_SCALE
{
    uint Granularity;
    uint Capacity;
}

struct SYSTEM_POWER_CAPABILITIES
{
    ubyte PowerButtonPresent;
    ubyte SleepButtonPresent;
    ubyte LidPresent;
    ubyte SystemS1;
    ubyte SystemS2;
    ubyte SystemS3;
    ubyte SystemS4;
    ubyte SystemS5;
    ubyte HiberFilePresent;
    ubyte FullWake;
    ubyte VideoDimPresent;
    ubyte ApmPresent;
    ubyte UpsPresent;
    ubyte ThermalControl;
    ubyte ProcessorThrottle;
    ubyte ProcessorMinThrottle;
    ubyte ProcessorMaxThrottle;
    ubyte FastSystemS4;
    ubyte Hiberboot;
    ubyte WakeAlarmPresent;
    ubyte AoAc;
    ubyte DiskSpinDown;
    ubyte HiberFileType;
    ubyte AoAcConnectivitySupported;
    ubyte[6] spare3;
    ubyte SystemBatteriesPresent;
    ubyte BatteriesAreShortTerm;
    BATTERY_REPORTING_SCALE[3] BatteryScale;
    int AcOnLineWake;
    int SoftLidWake;
    int RtcWake;
    int MinDeviceWakeState;
    int DefaultLowLatencyWake;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SYSTEM_POWER_CAPABILITIES サイズ: 76 バイト(x64)
dim st, 19    ; 4byte整数×19(構造体サイズ 76 / 4 切り上げ)
; PowerButtonPresent : BOOLEAN (+0, 1byte)  poke st,0,値  /  値 = peek(st,0)
; SleepButtonPresent : BOOLEAN (+1, 1byte)  poke st,1,値  /  値 = peek(st,1)
; LidPresent : BOOLEAN (+2, 1byte)  poke st,2,値  /  値 = peek(st,2)
; SystemS1 : BOOLEAN (+3, 1byte)  poke st,3,値  /  値 = peek(st,3)
; SystemS2 : BOOLEAN (+4, 1byte)  poke st,4,値  /  値 = peek(st,4)
; SystemS3 : BOOLEAN (+5, 1byte)  poke st,5,値  /  値 = peek(st,5)
; SystemS4 : BOOLEAN (+6, 1byte)  poke st,6,値  /  値 = peek(st,6)
; SystemS5 : BOOLEAN (+7, 1byte)  poke st,7,値  /  値 = peek(st,7)
; HiberFilePresent : BOOLEAN (+8, 1byte)  poke st,8,値  /  値 = peek(st,8)
; FullWake : BOOLEAN (+9, 1byte)  poke st,9,値  /  値 = peek(st,9)
; VideoDimPresent : BOOLEAN (+10, 1byte)  poke st,10,値  /  値 = peek(st,10)
; ApmPresent : BOOLEAN (+11, 1byte)  poke st,11,値  /  値 = peek(st,11)
; UpsPresent : BOOLEAN (+12, 1byte)  poke st,12,値  /  値 = peek(st,12)
; ThermalControl : BOOLEAN (+13, 1byte)  poke st,13,値  /  値 = peek(st,13)
; ProcessorThrottle : BOOLEAN (+14, 1byte)  poke st,14,値  /  値 = peek(st,14)
; ProcessorMinThrottle : BYTE (+15, 1byte)  poke st,15,値  /  値 = peek(st,15)
; ProcessorMaxThrottle : BYTE (+16, 1byte)  poke st,16,値  /  値 = peek(st,16)
; FastSystemS4 : BOOLEAN (+17, 1byte)  poke st,17,値  /  値 = peek(st,17)
; Hiberboot : BOOLEAN (+18, 1byte)  poke st,18,値  /  値 = peek(st,18)
; WakeAlarmPresent : BOOLEAN (+19, 1byte)  poke st,19,値  /  値 = peek(st,19)
; AoAc : BOOLEAN (+20, 1byte)  poke st,20,値  /  値 = peek(st,20)
; DiskSpinDown : BOOLEAN (+21, 1byte)  poke st,21,値  /  値 = peek(st,21)
; HiberFileType : BYTE (+22, 1byte)  poke st,22,値  /  値 = peek(st,22)
; AoAcConnectivitySupported : BOOLEAN (+23, 1byte)  poke st,23,値  /  値 = peek(st,23)
; spare3 : BYTE (+24, 6byte)  varptr(st)+24 を基点に操作(6byte:入れ子/配列)
; SystemBatteriesPresent : BOOLEAN (+30, 1byte)  poke st,30,値  /  値 = peek(st,30)
; BatteriesAreShortTerm : BOOLEAN (+31, 1byte)  poke st,31,値  /  値 = peek(st,31)
; BatteryScale : BATTERY_REPORTING_SCALE (+32, 24byte)  varptr(st)+32 を基点に操作(24byte:入れ子/配列)
; AcOnLineWake : SYSTEM_POWER_STATE (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; SoftLidWake : SYSTEM_POWER_STATE (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; RtcWake : SYSTEM_POWER_STATE (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; MinDeviceWakeState : SYSTEM_POWER_STATE (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; DefaultLowLatencyWake : SYSTEM_POWER_STATE (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global BATTERY_REPORTING_SCALE
    #field int Granularity
    #field int Capacity
#endstruct

#defstruct global SYSTEM_POWER_CAPABILITIES
    #field bool1 PowerButtonPresent
    #field bool1 SleepButtonPresent
    #field bool1 LidPresent
    #field bool1 SystemS1
    #field bool1 SystemS2
    #field bool1 SystemS3
    #field bool1 SystemS4
    #field bool1 SystemS5
    #field bool1 HiberFilePresent
    #field bool1 FullWake
    #field bool1 VideoDimPresent
    #field bool1 ApmPresent
    #field bool1 UpsPresent
    #field bool1 ThermalControl
    #field bool1 ProcessorThrottle
    #field byte ProcessorMinThrottle
    #field byte ProcessorMaxThrottle
    #field bool1 FastSystemS4
    #field bool1 Hiberboot
    #field bool1 WakeAlarmPresent
    #field bool1 AoAc
    #field bool1 DiskSpinDown
    #field byte HiberFileType
    #field bool1 AoAcConnectivitySupported
    #field byte spare3 6
    #field bool1 SystemBatteriesPresent
    #field bool1 BatteriesAreShortTerm
    #field BATTERY_REPORTING_SCALE BatteryScale 3
    #field int AcOnLineWake
    #field int SoftLidWake
    #field int RtcWake
    #field int MinDeviceWakeState
    #field int DefaultLowLatencyWake
#endstruct

stdim st, SYSTEM_POWER_CAPABILITIES        ; NSTRUCT 変数を確保
st->PowerButtonPresent = 100
mes "PowerButtonPresent=" + st->PowerButtonPresent