So my idea: Drop an error message alike
- exe cannot be created
- program already started by another location or so
I haven't tested with a VM, but if I start the project1.exe (outside the IDE, which is what the VM would do) and then make changes and try to compile, I get:
project1.lpr(24,1) Error: Can't create object file: C:\Users\martin\AppData\Local\Temp\project1.exe (error code: 5)
project1.lpr(24,1) Error: Can't create executable C:\Users\martin\AppData\Local\Temp\project1.exe
So there is an error.
I don't know what the VM will show, that depends on how the VM implements the shared file system.
If files are edited in both IDE then the other IDE should ask to reload them.
That should at least work outside the VM.
The IDE inside the VM may not... Because, each IDE checks when the IDE is getting Focus.
But if the entire VM was unfocused, then the IDE may not know, and the IDE in the VM may have always had (virtual) focus.
Not sure what else to do...
Maybe create a lockfile for the project. So it can be detected when it is open already.
In any case, this kind of thing is what I would advice to put into a package, and then any 3rd party could implement it.