Does anyone know how to detect if a program has lost all focus? I want to minimize it if it has lost its focus. For example, if I have my app loaded and I click on the Microsoft Internet Explorer window, my program would have no focus at all and would minimize itself.