Link to home
Create AccountLog in
Avatar of sfearnley
sfearnley

asked on

Video Capture

I am programming in Delphi 7. Using:

    SFhWnd:=capCreateCaptureWindow ( 'SFWindow',
               WS_CHILD or WS_VISIBLE ,
               WebCamLeft,WebCamTop, WebCamWidth,WebCamHeight,
               MainForm.Handle,0);  
    capCaptureGetSetup(SFhWnd,@VideoCapturePararameters,sizeof(VideoCapturePararameters));
    VideoCapturePararameters.fYield:=true;
    capCaptureSetSetup( SFhWnd,@VideoCapturePararameters,sizeof(VideoCapturePararameters));

   capCaptureSequence (SFhWnd); etc . . .

To capture input from WebCam to file.
How do I get the program to return control to MainForm without actually clicking with the mouse on the form.
(That works) I wish to process the WebCam input in realt time.
[I have tried SetPriorityClass(MainForm.Handle,HIGH_PRIORITY_CLASS)]
I do not know how to set two threads going which may be an answer?
Avatar of ZhaawZ
ZhaawZ
Flag of Latvia image

> How do I get the program to return control to MainForm without actually clicking with the mouse on the form.
Did you mean SetForegroundWindow(handle) ?
Avatar of sfearnley
sfearnley

ASKER

SetForegroundWindow(handle)  is not the problem - the main program 'freezes' (I assume by having lost focus) , though the recording continues and the video window stays live. I have tried running the video on another form and using MainForm.Setfocus - it does not work.

Problem now solved by myself - re-wrote the code from scratch and the program no longer freezes.
(VideoCapturePararameters.fYield:=true; now seems to be working!)
Avatar of Wayne Barron
If you have solved your problem yourself.
Then you can ask to have this question [PAQ] & [Refunded]
https://www.experts-exchange.com/Community_Support/askQuestion.jsp

I would PAQ it for the simple reason, that someone might find your own information handy.

Take Care
Carrzkiss
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer