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).
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).
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.
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.
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
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
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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..
ASKER
Appearantly this seems the only way: in 32bit calling a 16bit routine !
What a pity!
But thanks to ms99y !
What a pity!
But thanks to ms99y !
________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