Hi all, some code curtasy of i cant remember now but his code need a slight correction and i got it working. No dll required just a couple decls which i have included at the end of the code. Have fun :)
Const WM_USER = 1024
Const WS_CHILD = $40000000
Const WS_VISIBLE = $10000000
Const WM_CAP_START = WM_USER
Const WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 11
Const WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10
Const WM_CAP_SET_PREVIEW = WM_CAP_START + 50
Const WM_CAP_SET_PREVIEWRATE = WM_CAP_START + 52
Const WM_CAP_SET_SCALE = WM_CAP_START + 53
Const WM_CAP_DLG_VIDEOFORMAT = WM_CAP_START + 41
Const WM_CAP_DLG_VIDEOSOURCE = WM_CAP_START + 42
window = CreateWindow("Capture Window",200,200,326,264,0,17)
hWndC = QueryObject(window,1)
hWndC_API = capCreateCaptureWindow("cap",WS_CHILD Or WS_VISIBLE,0,0,320,240,hWndC,0)
apiSendMessage(hWndC_API,WM_CAP_DRIVER_CONNECT,0,0)
apiSendMessage(hWndC_API,WM_CAP_SET_SCALE,False,0)
apiSendMessage(hWndC_API,WM_CAP_SET_PREVIEW,True,0)
apiSendMessage(hWndC_API,WM_CAP_SET_PREVIEWRATE,1,0)
;apiSendMessage(hWndC_API,WM_CAP_DLG_VIDEOFORMAT,0,0)
Repeat
Delay 40
If WaitEvent()=$803 Then Exit
Forever
apiSendMessage(hWndC_API,WM_CAP_DRIVER_DISCONNECT,0,0)
End
--------------
avicap32.decls
--------------
.lib "avicap32.dll"
capCreateCaptureWindow%(lpszWindowName$,dwStyle%,x%,y%,nWidth%,nHeight%,hWnd%,nID%):"capCreateCaptureWindowA"
------------
user32.decls
------------
.lib "user32.dll"
apiSendMessage%(hwnd%, wMsg%, wParam%, lParam%) : "SendMessageA"
--------------------------------------
Code has been updated to allow proper exit and added format dialog box command
Const WM_USER = 1024
Const WS_CHILD = $40000000
Const WS_VISIBLE = $10000000
Const WM_CAP_START = WM_USER
Const WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 11
Const WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10
Const WM_CAP_SET_PREVIEW = WM_CAP_START + 50
Const WM_CAP_SET_PREVIEWRATE = WM_CAP_START + 52
Const WM_CAP_SET_SCALE = WM_CAP_START + 53
Const WM_CAP_DLG_VIDEOFORMAT = WM_CAP_START + 41
Const WM_CAP_DLG_VIDEOSOURCE = WM_CAP_START + 42
window = CreateWindow("Capture Window",200,200,326,264,0,17)
hWndC = QueryObject(window,1)
hWndC_API = capCreateCaptureWindow("cap",WS_CHILD Or WS_VISIBLE,0,0,320,240,hWndC,0)
apiSendMessage(hWndC_API,WM_CAP_DRIVER_CONNECT,0,0)
apiSendMessage(hWndC_API,WM_CAP_SET_SCALE,False,0)
apiSendMessage(hWndC_API,WM_CAP_SET_PREVIEW,True,0)
apiSendMessage(hWndC_API,WM_CAP_SET_PREVIEWRATE,1,0)
;apiSendMessage(hWndC_API,WM_CAP_DLG_VIDEOFORMAT,0,0)
Repeat
Delay 40
If WaitEvent()=$803 Then Exit
Forever
apiSendMessage(hWndC_API,WM_CAP_DRIVER_DISCONNECT,0,0)
End
--------------
avicap32.decls
--------------
.lib "avicap32.dll"
capCreateCaptureWindow%(lpszWindowName$,dwStyle%,x%,y%,nWidth%,nHeight%,hWnd%,nID%):"capCreateCaptureWindowA"
------------
user32.decls
------------
.lib "user32.dll"
apiSendMessage%(hwnd%, wMsg%, wParam%, lParam%) : "SendMessageA"
--------------------------------------
Code has been updated to allow proper exit and added format dialog box command