Using the Sysinfo Control

Tuesday Nov 19th 2002 by Sam Huggill

Using the Sysinfo control

There are many obscure controls that come with VB 5, which are hardly used. I only discovered these when I chose 'VB Enterprise Edition Controls' from the New Project dialog.

The controls on my now huge toolbox were:(All Microsoft) Comm, Chart, Common Dialog, Data Bound Grid, Data Bound List, Flexi Grid, Internet Transfer, MAPI controls, Masked Edit, Multimedia, PictureClip, Remote Data, Rich Text Box, SysInfo, Tabbed Dialog, Windows Common Controls (1 & 2) and the Winsock controls.

Whew! Quite a lot. Most of them I hadn't even come across before. Including the SysInfo control. I learned of it when I looked at a demo project called 'Batmeter'.

It tells you the battery full time, life time, life percent, battery status, OS Platform, OS Version, OS Build, Scrollbar size, work area height, work area top, work area left and work area width. All of this was done using one form, one list box, a bit of code and the SysInfo control.

I won't tell you how to do all of them. Just a couple.

First of all, the OS Platform property. Make sure you have the SysInfo control drawn on your form. Open the code window for the form and add this code:

Private Sub Form_Load()
Select Case SysInfo1.OSPlatform
Case 0
List1.AddItem "OS Platform = Unknow 32-Bit Windows"
Case 1
List1.AddItem "OS Platform = Windows 95"
Case 2
List1.AddItem "OS Platform = Windows NT"
End Select
End Sub

That code checks which operating system you are running, and then print's it accordingly.

That was the most complicated bit. The others I want to show you are:

OS Version:

List1.AddItem "OS Version " = & SysInfo1.OSVersion

OS Build:

List1.AddItem "OS Build " = & SysInfo1.OSBuild
Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved