// viddywell.cpp : Defines the entry point for the console application. // #include #include "stdafx.h" #include #include HWND hwnd; #define FILE "h:\\webcamtmp\\cap.bmp" //#define FILE "c:\\cap.bmp" int main(int argc, char* argv[]) { int wIndex=0; /*char szDeviceName[80]; char szDeviceVersion[80]; for (wIndex = 0; wIndex < 10; wIndex++) { if (capGetDriverDescription (wIndex, szDeviceName, sizeof (szDeviceName), szDeviceVersion, sizeof (szDeviceVersion))) { printf("%i %s\n %s\n",wIndex,szDeviceName,szDeviceVersion); }*/ hwnd = capCreateCaptureWindow( "Viddywell", WS_CHILD /* WS_VISIBLE */, 0, 0, 320, 240, GetDesktopWindow(), 0 ); SendMessage(hwnd,WM_CAP_DRIVER_CONNECT,0,0); while(1) { capGrabFrame(hwnd); remove(FILE); capFileSaveDIB(hwnd, FILE); //printf("saved\n"); //SendMessage(hwnd,WM_CAP_DRIVER_CONNECT,0,0); //capOverlay(hwnd,TRUE); Sleep(60000); } return 0; }