>>>>>I'll semaphorize the processes to resolve conflicts.
>>>>>
>>>>And why will that be any problem? A small part of VFP will remain in memory for a few more nanoseconds, doing clean up, that's all.
>>>
>>>It's for an updater, the second process must ensure the calling process is completely off-cpu.
>>
>>If you want to replace the running program, you try something that's simply not possible. Instead you need what's called a "loader" or a "launcher".
>>Check Message#
1314363>
>As I said, Tore, I want to replace not the running program, but the caller program. That's why I need to assure it's not running anymore.
If you use ShellExecute in the caller program, and then "quit" it, the caller program will not be running when the main program is running (or stop running). And to be 110% sure that the caller is not running, you can use Sergey's code to check if it's still running, and kill it if necessary.
Or am I still missing something?