Public Const GFSR_SYSTEMRESOURCES = 0
Public Const GFSR_GDIRESOURCES = 1
Public Const GFSR_USERRESOURCES = 2
Public Declare Function GetFreeResources Lib "RSRC32" _
Alias "_MyGetFreeSystemResources32@4" (ByVal lWhat As Long) As Long
'----------------
Private Function MemoryCheck() As Boolean
If Not m_blnWindows98 Then
MemoryCheck = False
Exit Function
End If
MemoryCheck = True
If GetFreeResources(GFSR_SYSTEMRESOURCES) < 20 Then
MsgBox " Windows' ""Free System Resources"" have dropped " & _
vbCrLf & " below 20 per cent. " & vbCrLf & _
vbCrLf & " MyProgram cannot open another record. Please close " & _
vbCrLf & " one or more records or another Windows program before " & _
vbCrLf & " opening another record.", _
vbExclamation, "MyProgram Windows 98 Resource Tracker"
Exit Function
End If
If GetFreeResources(GFSR_GDIRESOURCES) < 20 Then
MsgBox " Windows' ""Free Graphical Device Interface (GDI) Resources"" " & _
vbCrLf & " have dropped below 20 per cent. " & vbCrLf & _
vbCrLf & " MyProgram cannot open another record. Please close " & _
vbCrLf & " one or more records or another Windows program before " & _
vbCrLf & " opening another record.", _
vbExclamation, "MyProgram Windows 98 Resource Tracker"
Exit Function
End If
If GetFreeResources(GFSR_USERRESOURCES) < 20 Then
MsgBox " Windows' ""Free User Resources"" have dropped " & _
vbCrLf & " below 20 per cent. " & vbCrLf & _
vbCrLf & " MyProgram cannot open another record. Please close " & _
vbCrLf & " one or more records or another Windows program before " & _
vbCrLf & " opening another record.", _
vbExclamation, "MyProgram Windows 98 Resource Tracker"
Exit Function
End If
MemoryCheck = False
End Function