Compiled with 2.7 SDK, using new Launch Reason API to decide whether to close/hide windows