| |
|
|
|
Description:
GetSystemPowerStatus supply Information over The Stromquellen the Rechners back. These function there not under WindowsNT.
Deklaration:
DEF @GetSystemPowerStatus(1) !kernel32,GetSystemPowerStatus
Parameter:
1.Parameter: SYSTEM_POWER_STATUS Structure or 12 Bytes large Memory-Variable, The Information over The Stromquellen aufnimmt. => byte 0 = Flag the angibt, whether the computer on a Steckdose connected is: -0 = No -1 = Yes -255 = is uncharted. byte 1 = Kombinationsflag, the whom Ladestatus the batteries zurückgibt: -1 = load high. -2 = load lowly. -4 = load critically. -8 = battery becomes loaded. -128 = No Systembatterie present. -255 = Unbekannter Ladestatus byte 2 = Prozentuale load the Akkus: -0 To 100 = load in percent. -255 = load uncharted. byte 3 = reserved, must 0 his. byte 4-7 = One LongIntwert the angibt, How many sec The battery yet holds. If here $FFFFFFFF standing, is the Time uncharted. byte 8-11 = The Time in sec, The the battery pack holds, if it fully aufgeladen is or $FFFFFFFF, if The Time uncharted is.
Return Value:
1 with erfolgreichem Reading, 0 with Error.
Examples:
DEF @GetSystemPowerStatus(1) !"kernel32","GetSystemPowerStatus"
Declare SystemPowerStaus#
Windowstyle 31
Windowtitle "Angeschlossene Hauptstromquelle"
Window 0,0-640,440
While 0=0
sleep 10
DIM SystemPowerStaus#,12
@GetSystemPowerStatus(SystemPowerStaus#)
IF @BYTE(SystemPowerStaus#,1)=0
DrawText 0,0,"Batterie "
Startpaint %HDC
drawtext 0,0,"Batterie "
endpaint
Startpaint %HDC2
drawtext 0,0,"Batterie "
endpaint
elseIF @BYTE(SystemPowerStaus#,0)=1
DrawText 0,0,"Steckdose "
Startpaint %HDC
drawtext 0,0,"Steckdose "
endpaint
Startpaint %HDC2
drawtext 0,0,"Steckdose "
endpaint
else
DrawText 0,0,"Stromquelle unbekannt"
Startpaint %HDC
drawtext 0,0,"Stromquelle unbekannt"
endpaint
Startpaint %HDC2
drawtext 0,0,"Stromquelle unbekannt"
endpaint
endif
Dispose SystemPowerStaus#
Wend
[keywords:6d439a8811] network Steckdose battery battery pack load Time Ladezeit read inquire current supply [/keywords:6d439a8811] |
|
|
| |
|
|