I think Melwyn wants the equivalent of GotFocus() / LostFocus() (for objects), or Activate() / Deactivate() (for forms), but for the entire application (losing/getting focus with Alt-Tab, or clicking on taskbar).
I don't know of any way to do this. For instance, I don't know whether Deactivate() fires when leaving an application.
Hilmar.
>>Dear All,
>>Is there an event that fires when an application loses the focus and when receives the focus.
>>
>>Thanku in advance
>
>Melwyn,
>
>Do you want to know if a specific application is running or not? Or are you trying to run some process based on when an application is started and ended?
>
>Renoir
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)