Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Monitoring GDI, User and System resources

Monitoring GDI, User and System resources

Monitoring GDI, User and System resources

I need to Monitor GDI, User and System resources to allow my app to warn and go to a safe state before resources run out.
Does anyone know how to do this? I have used 16 bit API calls before - GetFreeSystemResources - but I
cannot seem to find the 32 bit equivalents
Thanks for any help

RE: Monitoring GDI, User and System resources

In the 16-bit world of Windows, the global memory and user information was obtained using the GetFreeSpace and GetFreeSystemResources APIs. Under Win32, these were dropped and replaced with the GlobalMemoryStatus API.

RE: Monitoring GDI, User and System resources

Yes, I know, I used GetFreeSystemResources in Win16, but GlobalMemoryStatus returns a MEMORYSTATUS
dwLength As Long
dwMemoryLoad As Long
dwTotalPhys As Long
dwAvailPhys As Long
dwTotalPageFile As Long
dwAvailPageFile As Long
dwTotalVirtual As Long
dwAvailVirtual As Long
End Type

Where are GDI, User and System resources?
I use the Win98 resource meter, which shows the info I want, but I need to get it programmatically and I cannot find it in a MEMORYSTATUS. Any idea is welcome please.

RE: Monitoring GDI, User and System resources


I haven't has an app run out of resources like that in a while now (not since I left the heady days of programming for MS WFW behind me in fact), must be quite an app for you to be having problems.

What does it do?


Mike Lacey
Cargill's Corporate Web Site

RE: Monitoring GDI, User and System resources

Have a look at www.controldraw.co.uk and follow "Whats coming"
But back to the resources question, does anyone have any ideas?

RE: Monitoring GDI, User and System resources

In 16-bit versions of Visual Basic, you can determine free system resources by calling the GetFreeSystemResources Windows API function. For 32-bit versions of Visual Basic, there is no Win32 API function that provides that information. To determine free system resources in a 32-bit Visual Basic application, you must call a 16-bit application. This article includes instructions to:

Create a 16-bit Visual Basic 4.0 OLE server that determines free system resources and provides that information to OLE clients.

Call the 16-bit OLE server from a 32-bit version of Visual Basic and get free system resources from it.

look at :


RE: Monitoring GDI, User and System resources

Thanks very much, I will try that.

RE: Monitoring GDI, User and System resources

Try the following:

Const SR = 0
Const GDI = 1
Const USR = 2

Declare Function pBGetFreeSystemResources Lib "rsrc32.dll" Alias "_MyGetFreeSystemResources32@4" (ByVal iResType As Long) As Long

This returns the free System, User and GDI resources depenging on which of the constants is passed to it.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close