Page 1 of 1

space and diskinfo

PostPosted: Wed May 06, 2009 11:10 pm
by Silvio
How cal this function ?



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);
}

Re: space and diskinfo

PostPosted: Thu May 07, 2009 4:50 am
by Antonio Linares
Silvio,

Those functions return arrays.

The first one returns a 4 elements array, and the second one a two elements array.

Re: space and diskinfo

PostPosted: Thu May 07, 2009 8:08 am
by Silvio
How I can show all the informations ?

Re: space and diskinfo

PostPosted: Thu May 07, 2009 9:40 am
by Antonio Linares
Silvio,

AEval( MemInfo(), { | n | MsgInfo( n ) } )