When your application is in the background the visible property of all controls will return false. So you can check the visible control of a control that should be visible and if it's false then your application is running in the background.
Calling Form.Show will activate your application.