This method is used for ending the capture session. It should be called whenever you close your application or whenever you want to stop capturing.

HRESULT EndCaptureSession ()

1) This method is synchronous (blocking), your application may wait 1-2 seconds until the WCaptureX component is unloaded.

2) Make sure you call this method before your application exits, otherwise the capturing component won't be unloaded from all the running applications.