>Hello,
>
>But what is wrong then with the code i send?
First, there has to be a common directory that's writable and this directory muse exist on every machine that uses the application. You could rely on the current default, however. Unfortunately, if the setup of the drive (on a network for example) is such that the user only has read access, but not write, you're back at square one. Second, if you're out of disk space or some other error occurs in attempting to create the file, the program may not run when it should.
There are a number of ways to accomplish this: Set up the program as a DDE server iterate through all open windows, create a mutex or event, use the method you posted. If it works for you, fine with me. However, I would prefer a method that was 100% reliable, and 99.99% isn't 100%.
George
Ubi caritas et amor, deus ibi est