Deactivate event will be raised when you will switch focus to another application too. How to prevent this ?