open and close applications via dialog