Link to home
Start Free TrialLog in
Avatar of titz
titz

asked on

System Resources

Under WIN 3.1 there was the API-function
getfreesystemresources.
Under WIN95 or WIN NT4.0 this function is not available.
But i am sure, that there will be an equivalent.
I want to know either in percent or in bytes how many resources are used (or free).
Avatar of Tom Knowlton
Tom Knowlton
Flag of United States of America image

This is from the HELP for Delphi 2.  Does this help?  Just open help and tyep GLOBALMEMORYSTATUS

________Here it is_________

The GlobalMemoryStatus function retrieves information about current available memory. The function returns information about both physical and virtual memory. This function supersedes the GetFreeSpace function.

VOID GlobalMemoryStatus(

    LPMEMORYSTATUS  lpBuffer       // pointer to the memory status structure  
   );      
Parameters

lpBuffer

Points to a MEMORYSTATUS structure in which information about current memory availability is returned. Before calling this function, the calling process should set the dwLength member of this structure.

Return Value

This function does not return a value.

Remarks

An application can use the GlobalMemoryStatus function to determine how much memory it can allocate without severely impacting other applications.
The information returned is volatile, and there is no guarantee that two sequential calls to this function will return the same information.

See Also

MEMORYSTATUS
Avatar of titz
titz

ASKER

MEMORYSTATUS only shows the use of (some kind of) memory, but not the use of resources. That's very different.
I want to see the use of resources for I want to know wether in my program are some resources which are not destroyed.

See 'Resource Monitor'  in 'Sample Code' section in the 'Delphi Source':
http://www.doit.com/delphi/
or I can send you the zip file by EMail.
sorry, I have just checked it and it doesn't complie with Delphi32.
I have done some checking:
If you are working with Win95, then the file rsrc32.dll located in <WinSysDir> includes the function GetFreeSystemResources and you should call it directly from that dll, because Delphi32 doesn't have a unit for that.
As for WinNT I don't know the answer because it doesn't have the rsrc32.dll
Avatar of titz

ASKER

"Getfreesystemresources" is only available under 16Bit.
That is my trouble.
I am looking for a good equivalent under 32Bit and delphi3.
And i need it under WIN95, WIN98 and NT4.0

ASKER CERTIFIED SOLUTION
Avatar of ms99y
ms99y

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

Hi, titz

 I am giving the information that I have found from the MSD,

 there’s no way in Win32 to get this kind of information. If you want to know the free system resources in a Win32-based program, you’ll need to thunk down to a 16-bit DLL and call SystemHeapInfo or GetFreeSystemResources. This is what SHELL32.DLL does to display the free system resources in the About boxes of all the standard Windows 95 utilities.


Later,

Sorry for doubling the message..
Avatar of titz

ASKER

Appearantly this seems the only way: in 32bit calling a 16bit routine !
What a pity!

But thanks to ms99y !