Is there a way for me to catch that my application is no longer the active application?
Printable View
Is there a way for me to catch that my application is no longer the active application?
\Code:Declare Function GetActiveWindow Lib "user32" Alias "GetActiveWindow" () As Long
If GetActiveWindow <> Form1.hWnd then
'what happens if your application isn't the active one
end if
you can change the form1 to whatever form is your main form
Make sure you place that code in a Timer, otherwsie the code with not execute.
You can also subclass the form to detect when your form has lost focus, take a look at this post for an example.