How could i detect that a form lost the mouse focus, it means the mouse move on another part but not on the form.

How could i detect that another form takes the focus.

Note that the other form could be a form of another application.

thanks