Share via


capSetCallbackOnYield

The capSetCallbackOnYield macro sets a callback function in the application. AVICap calls this procedure when the capture window yields during streaming capture. You can use this macro or explicitly call the WM_CAP_SET_CALLBACK_YIELD message.

BOOL capSetCallbackOnYield(
  hwnd,  
  fpProc 
);

Parameters

hwnd

Handle to a capture window.

fpProc

Pointer to the yield callback function, of type capYieldCallback. Specify NULL for this parameter to disable a previously installed yield callback function.

Return Values

Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.

Remarks

Applications can optionally set a yield callback function. The yield callback function is called at least once for each video frame captured during streaming capture. If a yield callback function is installed, it will be called regardless of the state of the fYield member of the CAPTUREPARMS structure.

If the yield callback function is used, it must be installed before starting the capture session and it must remain enabled for the duration of the session. It can be disabled after streaming capture ends.

Applications typically perform some type of message processing in the callback function consisting of a PeekMessage, TranslateMessage, DispatchMessage loop, as in the message loop of a WinMain function. The yield callback function must also filter and remove messages that can cause reentrancy problems.

An application typically returns TRUE in the yield procedure to continue streaming capture. If a yield callback function returns FALSE, the capture window stops the capture process.

Requirements

**  Windows NT/2000/XP:** Included in Windows NT 3.1 and later.
**  Windows 95/98/Me:** Included in Windows 95 and later.
**  Header:** Declared in Vfw.h.

See Also

Video Capture, Video Capture Macros, CAPTUREPARMS, capYieldCallback, DispatchMessage, PeekMessage, TranslateMessage, WM_CAP_SET_CALLBACK_YIELD, WinMain