By Ken Tucker.
The avicap32.dll contains functions for connecting to and listing available video capture device on your system.
First load a list of available video capture devices into a listbox. To do this, use a loop that checks to see if there is a driver available. If there is, add it to a listbox.
To display the output from a video capture device, you need to create a capture window, connect to the device, scale the output to fit the window, set the preview rate, and finally tell it to start previewing. Create a child window with capCreateCaptureWindowA so you can display it in a picturebox.
To retrieve an image from the preview window, use SendMessage to copy the data to the clipboard. Then transfer the image to the picture box.
Finally, to close the preview window, disconnect from the device and destroy the preview window.
See the code for details.