Further fix for #140; it didn't work correctly if you would e.g. press Shift-F5 in Visual Studio to stop the process. Hooking Application.Current.Exit is better in this regard than handling WM_CLOSE.
Bug fix for SendKeyEvent. Should always return something.