How do you get System/User/GDI resource values?
I've used the GlobalMemoryStatus function to retrieve the MemoryStatus structure, and it gives the dwMemoryLoad percentage (subtracted from 100 gives the resource available)..but it differs from the other resource monitors I have (Windows and Norton..which always agree).
And besides, this method doesn't give seperate values for User or GDI resources.
I've used the GlobalMemoryStatus function to retrieve the MemoryStatus structure, and it gives the dwMemoryLoad percentage (subtracted from 100 gives the resource available)..but it differs from the other resource monitors I have (Windows and Norton..which always agree).
And besides, this method doesn't give seperate values for User or GDI resources.
Found this in one of my helper apps (kinda like an archiver).
GL
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
'get resource information
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
GL
Hi Graebel,
I've seen a similar scheme on a couple of listings in Delphi and VB while Googling. I guess I just don't understand how to go about implementing/translating any of it into Masm.
I was hoping to find an API or some structure that would give me something to work with but haven't run across any yet.
I've seen a similar scheme on a couple of listings in Delphi and VB while Googling. I guess I just don't understand how to go about implementing/translating any of it into Masm.
I was hoping to find an API or some structure that would give me something to work with but haven't run across any yet.
OK (after a WILD night at work..and thinking a little clearer)..
Thanks to Graebel, I looked into RSRC32.DLL and see the function _MyGetFreeSystemResources32@4. I'll play with that for awhile now !
Thanks to Graebel, I looked into RSRC32.DLL and see the function _MyGetFreeSystemResources32@4. I'll play with that for awhile now !
Can anyone offer some clues on how to access the function _MyGetFreeSystemResources32@4 in RSRC32.DLL ?
Yeah, I would like to see that as well hehe. I was always a little in the dark on how Masm32 was including system DLLs. In other languages I can explicitly see the calls to some load function. Here its just a mystery so far.
Wish I could give you the answer gscundiff (beyond what API they used)... :rolleyes:
Wish I could give you the answer gscundiff (beyond what API they used)... :rolleyes:
Hi Graebel,
Guess I opened up a can o worms...after looking at this:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q190217
there's got to be a better way than thunking down to 16bit code from 32...
Guess I opened up a can o worms...after looking at this:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q190217
there's got to be a better way than thunking down to 16bit code from 32...
You're going to have to find another way if you want it to work on XP.
Thanks grv575,
That gives us something to play with !!
That gives us something to play with !!