Article ID: 146424
Article Last Modified on 10/15/2003
111508 How to Check Available Windows System Resources
* Beginning of Check System Resources program
LOCAL nGetSysRes, nRetVal
#DEFINE sysreso 0
#DEFINE gdireso 1
#DEFINE userreso 2
* Load the FOXTOOLS.FLL library
SET LIBRARY TO HOME() + "FOXTOOLS.FLL" ADDITIVE
* Call RegFN() to register the GetFreeSystemResources() function
nGetSysRes = RegFn("GetFreeSystemResources", "I","I")
* If RegFn() returned a value that is greater than -1, it can be
* assumed that the function was successfully registered.
IF nGetSysRes > -1
nRetVal = CallFn(nGetSysRes, sysreso)
WAIT WINDOW "Free System Resources:"+STR(nRetVal,3,0)+"%" TIMEOUT 1
nRetVal = CallFn(nGetSysRes, gdireso)
WAIT WINDOW "Free GDI Resources:"+STR(nRetVal,3,0)+"%" TIMEOUT 1
nRetVal = CallFn(nGetSysRes, userreso)
WAIT WINDOW "Free User Resources are:"+STR(nRetVal,3,0)+"%" TIMEOUT 1
ENDIF
* Unload FOXTOOLS.FLL from memory
RELEASE LIBRARY HOME()+ "FOXTOOLS.FLL"
* End of Check System Resources program
nGetSysRes = RegFn("GetFreeSystemResources", "I","I")
is modified to read as follows:
nGetSysRes = RegFn("GetFreeSystemResources", "I","I","USER.EXE")
the example will successfully return system resources in Windows 3.1x,
Windows 95, and Windows NT.
125699 GDI Objects and Windows 95 Heaps
125676 New User Heap Limits Under Windows 95
Additional query words: VFoxWin
Keywords: KB146424