I'm developing a long running process that hosts remoting objects. Due to design restrictions, I cannot use a Windows Service so the process is a background Forms application. I also cannot use WPF because we are restricted to .Net 2.0. In any case, since there is no guarantee that the background process is running, I want to be able to set a system wide flag from the process that I can check from another.
I read up and tried using Mutex's, but there doesn't seem to be a way to determine if a Mutex exists without creating it if it doesn't exist already(unless I'm missing something, which is always possible).
Ideally, a system wide variable with it's lifetime determined by the long running application would be ideal, not only to signal if it is running or not, but perhaps also to store primitive state data (like a simple integer enumeration).
Can anyone suggest a good way to accomplish this?