This source code is for Visual Basic 5 or 6, it should load and compile cleanly in either one. It was written using the MS Visual Studio IDE, and tested numerous times in production programs of both my own and others. If you use any of this and find a bug, or just want to tell me it was useful, please contact me to tell me about it.
The Code
This code is somewhat dated, being originally written in VB3, then converted to 4, then
rewritten in VB5. I believe that most, if not all, of the functions are still valid. I say
it is dated because, for example, several new versions of Windows have come out since I
wrote the fstrGetWinVersion function.
System Information Module
The source code for the system info module is a small module of functions to retrieve system information: the Windows version, the number of colors supported by the video adapter, the temporary files folder, etc.
What does it do?
- The code is contained in a module (modsystm.bas) which has a variety of functions. There is a small visual form to demonstrate some of them, although there are more functions in the module than are actually demonstrated.
- I originally wrote this module for Windows95/NT, lo those many years ago. The functions still work on Windows2000/XP.
- Some of the functions are:
- fintNumColors: returns the bit depth supported by the video adapter
- flngScreenWidth, flngScreenHeight : return the desktop size in pixels
- flngTotalRAM : returns the amount of physical memory (RAM) in the machine
- fstrGetUserName : returns the currently logged on user's logon name
- fstrGetWinVersion : returns the major, minor and revision version numbers of Windows.
- fstrGetTempDir : returns the temporary files directory
- fstrGetSysDir : returns the system files directory
- fstrGetWinDir : returns the directory Windows is installed to
- Notes: There are a few more miscellaneous functions in the module, they are well documented and fairly simple to use
