Add support for windows forms
Check with exception anf form closing