1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Public Const WS_CHILD As Long = &H40000000
Public Const WS_VISIBLE As Long = &H10000000
Optional nWidth As Long = 160
Optional nHeight As Long = 120
PictureDest As PictureBox
Public Const WM_CAP_DRIVER_CONNECT As Long = &H40A
Public Const WM_CAP_SET_PREVIEW As Long = &H432
Public Const WM_CAP_SET_PREVIEWRATE As Long = &H434
hwnd = capCreateCaptureWindow("Capture", WS_CHILD Or WS_VISIBLE, 0, 0, nWidth, nHeight, PictureDest.hwnd, 0)
If (hwnd <> 0) Then
retour = SendMessage(hwnd, WM_CAP_DRIVER_CONNECT, 0, 0)
retour = SendMessage(hwnd, WM_CAP_SET_PREVIEW, 1, 0)
retour = SendMessage(hwnd, WM_CAP_SET_PREVIEWRATE, Rate, 0) |