It is possible to have in the programm the level of battery ,
the level of WiFi signal , the amount of memory free ?
Regards Maurizio
www.nipeservice.com
HB_FUNC (BATTERYINFO)
{
BOOL iRet;
SYSTEM_POWER_STATUS_EX status;
iRet = GetSystemPowerStatusEx (&status, TRUE);
hb_reta (9);
hb_stornl ((INT) status.ACLineStatus, -1, 1);
hb_stornl ((INT) status.BatteryFlag, -1, 2);
hb_stornl ((INT) status.BatteryLifePercent, -1, 3);
hb_stornl ((ULONG) status.BatteryLifeTime, -1, 4);
hb_stornl ((ULONG) status.BatteryFullLifeTime, -1, 5);
hb_stornl ((INT) status.BackupBatteryFlag, -1, 6);
hb_stornl ((INT) status.BackupBatteryLifePercent, -1, 7);
hb_stornl ((ULONG) status.BackupBatteryLifeTime, -1, 8);
hb_stornl ((ULONG) status.BackupBatteryFullLifeTime, -1, 9);
}
HB_FUNC (MEMINFO)
{
MEMORYSTATUS st;
GlobalMemoryStatus (&st);
hb_reta (4);
hb_stornl ((ULONG) st.dwMemoryLoad, -1, 1);
hb_stornl ((ULONG) st.dwTotalPhys, -1, 2);
hb_stornl ((ULONG) st.dwTotalVirtual, -1, 3);
hb_stornl ((ULONG) st.dwAvailVirtual, -1, 4);
}
HB_FUNC (DISKINFO)
{
BOOL iRet;
unsigned __int64 iFreeBytesToCaller, iTotalBytes, iFreeBytes;
iRet = GetDiskFreeSpaceEx(NULL,
(PULARGE_INTEGER) &iFreeBytesToCaller,
(PULARGE_INTEGER) &iTotalBytes,
(PULARGE_INTEGER) &iFreeBytes);
hb_reta (2);
hb_stornl ((ULONG) iTotalBytes, -1, 1);
hb_stornl ((ULONG) iFreeBytes, -1, 2);
}
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
#include <aygshell.h>
// HB_FUNC (NAME)
// {
// }
#pragma ENDDUMP
I have tested info function and return value is Ok. Battery info doesn't work on emulator.
Pawel
Function Test ()
Local aBatInfo := BatteryInfo ()
Return .T.
#pragma BEGINDUMP
// #include file
HB_FUNC (BATTERYINFO)
{
// function body
}
#pragma ENDDUMP
Return to FiveWin for Pocket PC
Users browsing this forum: No registered users and 10 guests