htools
System resources in Windows 98



'The following code snippet shows the percentages of free system resources in Windows 98 

'You have to install the "Resource Meter" in order to use it.
'
'


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 this project