Solved

System Resources

Posted on 1998-06-19
11
285 Views
Last Modified: 2010-04-04
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).
0
Comment
Question by:titz
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 5

Expert Comment

by:knowlton
ID: 1354182
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
0
 
LVL 1

Author Comment

by:titz
ID: 1354183
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.

0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1354184
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.
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1354185
sorry, I have just checked it and it doesn't complie with Delphi32.
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1354186
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
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 5

Expert Comment

by:ronit051397
ID: 1354187
0
 
LVL 1

Author Comment

by:titz
ID: 1354188
"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

0
 

Accepted Solution

by:
ms99y earned 50 total points
ID: 1354189

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,
0
 

Expert Comment

by:ms99y
ID: 1354190

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,
0
 

Expert Comment

by:ms99y
ID: 1354191

Sorry for doubling the message..
0
 
LVL 1

Author Comment

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

But thanks to ms99y !
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now