Microsoft KB Archive/42114

MSJ FREEMEM: Windows Program to Display Free Memory

PSS ID Number: Q42114 Article last modified on 05-23-1991

MS-DOS

Summary: The following is a summary of the program found in the “Microsoft Systems Journal” and in the Software/Data Library: Issue: March 1987, Vol. 2, No. 1, pages 33-40 Title: “Keep Track of Your Windows Memory with FREEMEM” Author: Charles Petzold Keyword: FREEMEM FREEMEM can be found in the Software/Data Library by searching on the keyword FREEMEM, the Q number of this article, or S10005. FREEMEM was archived using the PKware file-compression utility. The following text is taken from the cover of the “Microsoft Systems Journal”: Not every Microsoft Windows program is long and complex. This short (fewer than 100 lines of code), simple program not only displays the amount of available free memory in an icon at the bottom of the screen and updates it every second, it also reveals a good deal about programming in Windows.

More Information: The FREEMEM program displays the amount of free memory available for the currently active application in its icon area. If you have expanded memory enabled in your system, the amount of memory displayed by FREEMEM will be the amount of memory available when FREEMEM is running (since it is the active application when it is calculating the amount of free memory). Some of the Windows programming concepts that are used in FREEMEM are: 1. Causing an application to start as an icon 2. Drawing in an icon dynamically 3. Using timer messages 4. Calculating the amount of free memory available for the current application