System resources in Windows 95/98

Windows 95/98 provides the Resource Meter utility that shows the percentages of free system resources on your system. This utility uses the rsrc32.dll for getting the information about the system resources.
The following code snippet shows how to use the rsrc32.dll for getting the percentages of free system resources in Windows 95/98.


'The following code snippet shows the percentages of free system resources in Windows 95 
'and Windows 98.
'You have to install the "Resource Meter" in order to use it.
'
'Written by Nir Sofer.
'
'Web site: http://nirsoft.mirrorz.com
'


Private Declare Function GetFreeSystemResources32 _
Lib "rsrc32.dll" Alias "_MyGetFreeSystemResources32@4" _
(ByVal fuSysResource As Integer) As Integer

Const ResourceTypeSystem = 0
Const ResourceTypeGDI = 1
Const ResourceTypeUser = 2


Public Function GetFreeResources(ResourceType As Integer) As Integer
    On Error GoTo not_avail
    GetFreeResources = GetFreeSystemResources32(ResourceType)
    Exit Function
    
not_avail:
    'Resource function is not available
    GetFreeResources = -1
End Function

Private Sub Command1_Click()
End Sub

Private Sub cmdShowResources_Click()
    MsgBox "System: " & GetFreeResources(ResourceTypeSystem) & vbCrLf & _
            "GDI: " & GetFreeResources(ResourceTypeGDI) & vbCrLf & _
            "User: " & GetFreeResources(ResourceTypeUser)
End Sub


Download the entire project