I have had this happen a few times to me, but I cannot duplicate it at will. I'm telling you my experience in hope that if others have this happen, or it is happening now, a solution can be found.
My code is stable, meaning that 99+% of the code has had no changes in more than a year. When I do change the code, I'll run it, then the other closely related functions until I am satisfied the answers are correct and there are not faults in the code (as much as possible). Then I'll go through the remainder of the code looking for secondary effects of code changes, especially in support routines used throughout my product. So what happens is a mystery.
I was running through a change using the 'Common Dialog' that Paul has provided. In order to test the implementation, I would have to run through all the functions that use this file dialog.
From my main window after several minutes of running through other functions, I started the next function, and the program closed. It did not throw an error code. It just stopped. But it apparently left a bit of code running. I had to use the task manager to stop this. If I do not, I've found, I cannot update the EXE file (makes sense).
I then restarted (without recompiling) the code and ran through a similar sequence (I can't say the same since I was at least10 minutes into testing it by the time it stopped). I could not get the code to stop. I tried this from a 'cold' start 3 more times without an issue.
I have seen this in the past. It is not consistent with any particular function being started, nor any particular sequence of file open/close, nor anything else I can deduce.
And it is not common! That is a blessing, actually. And a curse, because if I can get a crash or stoppage consistently, I've been able to track down a root cause. This kind of problem (could be my code, I'll admit) is insidious and frustrating.
So, if you've had this kind of thing happen, and have been able to identify or isolate an issue, I'd love to hear of it.