home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / mswindo / programm / misc / 3488 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.6 KB  |  48 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!s5!is1.is.morgan.com!is.morgan.com!mpiet
  3. From: mpiet@is.morgan.com (Mark Pietrasanta)
  4. Subject: M% in U,G,M - HELP!
  5. Message-ID: <1992Nov17.105211@is.morgan.com>
  6. Sender: news@is.morgan.com
  7. Nntp-Posting-Host: is11
  8. Organization: Morgan Stanley - IS
  9. Date: Tue, 17 Nov 1992 15:52:11 GMT
  10. Lines: 36
  11.  
  12. Okay.  I can get the User and GDI percentages, but I can't get the
  13. Memory percentage.  This is what I'm currently doing:
  14.  
  15.         unsigned int UserP, GDIP;
  16.         unsigned long MemP;
  17.         MEMMANINFO lpmmi;
  18.  
  19.         UserP = GetFreeSystemResources(GFSR_USERRESOURCES);
  20.         GDIP = GetFreeSystemResources(GFSR_GDIRESOURCES);
  21.         lpmmi.dwSize = sizeof(lpmmi);
  22.         MemManInfo(&lpmmi);
  23.         MemP = ((lpmmi.dwMaxPagesAvailable*100)/lpmmi.dwTotalLinearSpace);
  24.  
  25.         wsprintf(resources, "U%02i G%02i M%02i\0", UserP, GDIP, MemP);
  26.  
  27. But this seems to be returning the percentage of free _contiguous_
  28. pages, not total free pages.  I've tried the other pieces of the record
  29. to no avail (all the ones with Total in them).
  30.  
  31. I thought I had it licked with this one, but NOPE!
  32.  
  33. Any help would be GREATLY appreciated, as I've run out of ideas.
  34.  
  35. Please e-Mail and I'll post the results.
  36.  
  37. Thanks,
  38. Mark Pietrasanta - mpiet@is.morgan.com
  39. * * * * * * * * *
  40.  
  41. "Great spirits have always encountered violent opposition from
  42. mediocre minds." - Albert Einstein
  43.  
  44. ----------------------------------------------------------------
  45. Disclaimer: These responses are my own and in no way reflect the
  46.             views of my employer.
  47. ----------------------------------------------------------------
  48.