That works just fine, but I'd like to pass along a word of warning to anyone
else unfamiliar with this...
In Bill's sample he calls mt.Close() after using the mutex. I skipped this
part. The app worked as expected in debug mode, but failed in release mode. I
expect that the mutex was optimized away after I checked the boolean, as it
wasn't being used anymore. The result being that the mutex no longer existed
when another instance of my app started.
By adding the call to Close() or ReleaseMutex(), you ensure that the
resource will live long enough to be useful.