Home General VB.NET List of Webcams
20 | 05 | 2012
This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade

List of Webcams PDF Print E-mail
User Rating: / 1
PoorBest 
Tutorials

Code below displays a list of all webcams connected into a listbox.

List of webcams.net

 

 

Show/Hidden vbnet code

View source
Public Class Form1
 
 
 
	'To make this code work make sure you have a button called btnGetDevices and a listbox called lstCams
 
 
 
	Declare Function capGetDriverDescriptionA Lib "avicap32.dll" (ByVal wDriver As Short, _
 
	ByVal lpszName As String, ByVal cbName As Integer, ByVal lpszVer As String, _
 
	ByVal cbVer As Integer) As Boolean
 
 
 
	Private Sub LoadCams()
 
	Dim strName As String = Space(100)
 
	Dim strVer As String = Space(100)
 
	Dim bReturn As Boolean
 
	Dim x As Integer = 0
 
 
 
	' Load name of all avialable devices into the lstcams .
 
 
 
	Do
 
	' Get Driver name and version
 
	bReturn = capGetDriverDescriptionA(x, strName, 100, strVer, 100)
 
	' If there was a device add device name to the list
 
	If bReturn Then lstcams.Items.Add(strName.Trim)
 
	x += 1
 
	Loop Until bReturn = False
 
	End Sub
 
 
 
	Private Sub btnGetDevices_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetDevices.Click
 
	LoadCams()
 
	End Sub
 
	End Class
 
 

 

Add comment


Security code
Refresh

This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade