Progged programming site

Programming source code, articles, tutorials, links and chat

Get the Windows XP serial number

This example shows how to list the serial number for your installed copy of Windows XP, you need to add a textbox caled TextBox1 to a form in this example
Sub WindowsSerial()
strComputer = “.”
Set objWMIService = GetObject(”winmgmts:\\” & strComputer & “\root\cimv2″)
Set colItems = objWMIService.ExecQuery(”Select * from Win32_OperatingSystem”, , 48)
For Each objItem In colItems
Text1.Text = objItem.SerialNumber
Next
End Sub
Private [...]

[ Back to top ]

Display all drives with Visual basic

This Visual basic example displays all drives on your system, you will need to place a combo box on the form.
Private Sub Form_Load()
Dim objfso As Scripting.FileSystemObject
Dim objDrives As drives, objDrive As drive
Set objfso = CreateObject(”Scripting.FileSystemObject”)
Set objDrives = objfso.drives
For Each objDrive In objobjDrives
Combo1.AddItem objDrive.DriveLetter
Next
End Sub

Bookmark It

Hide Sites

[ Back to top ]

rectangular form example

this example shows how to create a rectangular form in Visual basic
Private Declare Function CreateRectRgn Lib “gdi32″ (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function SetWindowRgn Lib “user32″ (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare [...]

[ Back to top ]

List all fonts present using Visual basic

This example using Visual basic will list all screen fonts that are present on your system. This example uses a list box to list all fonts
Dim i as interager
For i = 1 to screen.fontcount
list1.additem Screen.Font(i)
Next i

Bookmark It

Hide Sites

[ Back to top ]

Sponsors