Okay, I'll eat the donuts. Although I don't need them either.
>But take a look at the line you snipped:
>
>"We want the 2nd EXE to close whenever the primary exe is closed."
>
>To me this calls for automatic, not manual closing.
>
To me it doesn't specify if the child .exe is allowed to close itself. And it certainly would be easy enough to add a (perhaps hidden) method to do so.
Proper error handling would make sure semaphore is always deleted. Except for C0005 exceptions. And if there are enough of those happening, he's got bigger fish to fry (figure out that problem) than worrying about how the user closed program2.
Have I made you hungry yet with food talk? :)
Steve Gibson