The following example connects the capture window with the handle hWndC to the MSVIDEO driver and then disconnects them using the capDriverDisconnect macro:
fOK = SendMessage (hWndC, WM_CAP_DRIVER_CONNECT, 0, 0L);
//
// Or, use the macro to connect to the MSVIDEO driver:
// fOK = capDriverConnect(hWndC, 0);
//
// Place code to set up and capture video here.
//
capDriverDisconnect (hWndC);