GetDevicePowerState

機能
システムのパワー状況を取得する
Declare Function GetDevicePowerState Lib "kernel32.dll" _
(ByVal hDevice As Long, pfOn As Long) As Long
Declare Function GetDevicePowerState Lib "kernel32.dll" _
(ByVal hDevice As Integer, pfOn As Integer) As Integer

BOOL GetDevicePowerState(
HANDLE hDevice,
BOOL pfOn
);
引数
hDevice

デバイスのハンドル
pfOn
(戻り値)情報を受け取るLong型変数
フル稼働中のとき              1
それ以外                      0
戻り値
正常終了のとき         0以外
エラーのとき              0
備考
Windows95,98,Meではデバイスのハンドルを取得する方法がないらしい
管理者の環境が現在はWindows2000なのでWindows95,98でサンプルが動作するかどうかは不明。
Windows2000ではサンプルは動作した。
サンプル
ダウンロード(GetDevicePowerState.lzh 3.86KB)