How do I determine if my form lost its focus to another program?

cheers