Clean Up

The Form1_FormClosing method checks if the live video is active. If it is, then it is stopped by passing the LiveDisplay method a zero (off) argument. The Exit method is then called to clean up WiT Engine.

[C#]
    WiT.engine.LiveDisplay("image", null, 0);
    WiT.engine.SetDisplayWnd(null, this.Handle);
    WiT.engine.Unload(exehandle);
    WiT.engine.Exit(withandle);

[Visual Basic]
    WiT.engine.LiveDisplay("image", Nothing, 0)
    WiT.engine.SetDisplayWnd(Nothing, Me.Handle)
    WiT.engine.Unload(exehandle)
    WiT.engine.Exit(withandle)

Previous 

Up