//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "captura_cam.h"
#include "vfw.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm12 *Form12;



#define  WM_CAP_START = WM_USER;
#define  WM_CAP_STOP = WM_CAP_START + 68;
#define  WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10;
#define  WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 11;
#define  WM_CAP_SAVEDIB = WM_CAP_START + 25;
#define  WM_CAP_GRAB_FRAME = WM_CAP_START + 60;
#define  WM_CAP_SEQUENCE = WM_CAP_START + 62;
#define  WM_CAP_FILE_SET_CAPTURE_FILEA = WM_CAP_START + 20;*/

//---------------------------------------------------------------------------
__fastcall TForm12::TForm12(TComponent* Owner)
	: TForm(Owner)
{
//	HWND ventana;

}
//---------------------------------------------------------------------------
void __fastcall TForm12::Button1Click(TObject *Sender)
{
   bool fOK;

  id=capCreateCaptureWindowA("ventana", WS_CHILD,0,0,320,200,Form12->Handle,0);

  if (id!=0) {

	 fOK = capDriverConnect(id, 0);
	 capPreviewRate(id, 30);
	 capPreview(id, TRUE);



  } else {
	  ShowMessage("Hay algun problema con tu camara");
  }
}
//---------------------------------------------------------------------------

