you can also use the capXXX API functions, they are a bit older fashioned than DirectX, but work well on every windows. They use (if I'm right) the mmsystem.dll and are quite compatible to any kind of video / image capture device.

You also have a number of easy-to-use high level functions, like capDlgVideoDisplay() which displays a ready to use dialog (provided by the device driver) to adjust display parameters.

In my experience, those USB web cameras show up as one device when using VFW cap* API. The user has to manually select in the properties of that device which camera should be used. There is no way to do it programmatically.

you can supply a format to the func that sets it by passing a bitmapinfo struct. you ve no guarantee the device supprts it, but 640.480.rgb24 or 320.240 is likely to be accepted.

you can set the preview capture rate with another func

then you define a callback func that gets called each new frame (you ve got to set preview on, but you arent forced to display the preview window) (note: i think the preview wind must be a child or it wont work good). the callback func passes you a pointer to the data in the format you asked, if its been accepted.