Use the Exit method in the Form1_FormClosing procedure of the main form:
[C#] WiT.engine.Unload(exehandle); WiT.engine.Exit(withandle); [Visual Basic] WiT.engine.Unload(exehandle) WiT.engine.Exit(withandle)