Can anyone get this going in Blitz/plus/3D?

Blitz3D Forums/Blitz3D Userlibs/Can anyone get this going in Blitz/plus/3D?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi AUK, this under blitzplus could cause problems when calling WM_CAP_DRIVER_CONNECT without first setting the video captures callback function using WM_CAP_SET_CALLBACK_CAPCONTROL as the driver connect request fails. (WM_CAP_SET_SCALE and WM_CAP_SET_PREVIEW also fail) im thinking that the best way to handle this would be to wrapp it into a .dll so have full access to the captures callback.

anyways heres the blitzplus code and decls, b.t.w ive no capture hardware so unsure if this even work. i do now though that the capture window is created a child of the blitzplus window.

;
; Blitz Basic Plus Decls
;

.lib "user32.dll"
API_SendMessage%(hwnd%,Message%,wParam%,lParam%):"SendMessageA"
API_GetWindowLong%(hwnd%,nIndex%):"GetWindowLongA"

.lib "Avicap32.dll"
capCreateCaptureWindow%(lpszWindowName$,dwStyle%,x%,y%,nWidth%,nHeight%,hWnd%,nID%):"capCreateCaptureWindowA"



;
;
;

Const GWL_WNDPROC = -4

;winuser.h constants
Const WM_USER = 1024
Const WS_CHILD = $40000000
Const WS_VISIBLE = $10000000

Const WM_CAP_START = WM_USER
Const WM_CAP_SET_CALLBACK_FRAME = WM_CAP_START + 5
Const WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10
Const WM_CAP_SET_OVERLAY = WM_CAP_START + 51
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_SET_CALLBACK_CAPCONTROL = (WM_CAP_START+ 85)

window = CreateWindow("Capture Window",200,200,400,400,0,11) 
hWndC = QueryObject(window,1)

winproc = API_GetWindowLong(hWndC,GWL_WNDPROC)
DebugLog winproc

hWndC_API = capCreateCaptureWindow("cap",WS_CHILD Or WS_VISABLE,0,0,320,240,hWndC,0) 
DebugLog hWndC_API

DebugLog API_SendMessage(hWndC_API,WM_CAP_SET_CALLBACK_CAPCONTROL,0,winproc)
DebugLog API_SendMessage(hWndC_API,WM_CAP_DRIVER_CONNECT,0,0)
DebugLog API_SendMessage(hWndC_API,WM_CAP_SET_SCALE,True,0)
DebugLog API_SendMessage(hWndC_API,WM_CAP_SET_PREVIEW,True,0)
DebugLog API_SendMessage(hWndC_API,WM_CAP_SET_PREVIEWRATE,24,0)


; wait until the user closes one of the windows 
Repeat 
If WaitEvent()=$803 Then Exit 
Forever 

End ; bye!