Private Sub command1_Click()
Dim sFileName As String
Dim CAP_PARAMS As CAPTUREPARMS
Dim i As Integer
capCaptureGetSetup lwndC, VarPtr(CAP_PARAMS), Len(CAP_PARAMS)
CAP_PARAMS.dwRequestMicroSecPerFrame = (1 * (10 ^ 6)) / 30
CAP_PARAMS.fMakeUserHitOKToCapture = True
CAP_PARAMS.fCaptureAudio = False
capCaptureSetSetuplwndC , VarPtr(CAP_PARAMS), Len(CAP_PARAMS)
capCaptureSequence lwndC
End SubPrivate Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim lpszName As String * 200
  Dim lpszVer As String * 200
 capGetDriverDescriptionA 0, lpszName, 200, lpszVer, 200
lwndC = capCreatCaptureWindowA(lpszName, WS_CAPTION Or WS_THI - CKFRAME Or WS_visible Or ws_child, -5, -30, pic.Width, pic.Height, pic.hWnd, 0)
If capdriverconnect(lwndC, 0) Then
cappreviewscale lwndC, True
cappreviewrate lwndC, 66
cappreview lwndC, True
setwindowpos lwndC, hwnd_bottom, 0, 0, 400, 300, swp_nomove Or swp_nozorder
End If
End Sub