FREE RESOURCES:
VB Code:
Const GFSR_SYSTEMRESOURCES = 0 Const GFSR_GDIRESOURCES = 1 Const GFSR_USERRESOURCES = 2 Private Declare Function GetFreeResources Lib "RSRC32" Alias "_MyGetFreeSystemResources32@4" (ByVal lWhat As Long) As Long Private Sub Form_Load() Me.AutoRedraw = True Me.Print "Free System Resources: " + CStr(GetFreeResources(GFSR_SYSTEMRESOURCES)) + "%" Me.Print "Free GDI Resources: " + CStr(GetFreeResources(GFSR_GDIRESOURCES)) + "%" Me.Print "Free User Resources: " + CStr(GetFreeResources(GFSR_USERRESOURCES)) + "%" End Sub
GUI RESOURCES:
VB Code:
Private Const GR_GDIOBJECTS = 0 Private Const GR_USEROBJECTS = 1 Private Declare Function GetGuiResources Lib "user32.dll" (ByVal hProcess As Long, ByVal uiFlags As Long) As Long Private Declare Function GetCurrentProcess Lib "kernel32" () As Long Private Sub Form_Load() Debug.Print "GDI objects used by this application: " & GetGuiResources(GetCurrentProcess, GR_GDIOBJECTS) Debug.Print "User objects used by this application: " & GetGuiResources(GetCurrentProcess, GR_USEROBJECTS) End Sub



Reply With Quote