For more information about VFW, see ~~~~~~
Http://www.diybl.com/course/3_program/c++/cppjs/20090409/164675.html
Http://blog.csdn.net/xilyu/archive/2008/02/17/2100636.aspx
Http://www.yuanma.org/data/2006/0730/article_1264.htm
Http://blog.csdn.net/wang_cww/archive/2008/02/26/2122300.aspx
Hwndc = capcreatecapturewindow (
(Lpstr) "My capture window", // window name if Pop-up
Ws_child | ws_visible, // window style
0, 0,160,120, // window position and dimensions
(Hwnd) This-> m_hwnd,
(INT) 1/* child id */); // create a video window
// Fok = sendmessage (hwndc, wm_cap_driver_connect, 0, 0l );
: Sendmessage (hwndc, wm_cap_driver_connect, 0, 0l); // connect to the driver
: Sendmessage (hwndc, wm_cap_driver_get_caps, sizeof (capdrivercaps), (long) (lpvoid) & capdrvcaps); // get the capture capability of the driver
// Or, use the macro to connect to the msvideo DRIVER:
// (Capdriverconnect (hwndc, 0) // use a macro to connect to the driver, the same below
// Capdrivergetcaps (hwndc, & capdrvcaps, sizeof (capdrivercaps ));
Cappreviewrate (hwndc, 66); // rate, in milliseconds, set the Capture Rate
Cappreview (hwndc, true); // starts preview, preview
The above code can be used to display videos of USB cameras. For other settings, see the above URL.