Hi,
I am using an example from here how to run only one process instate of my program.
DupThread = 0
kernel32=strcat(dirwindows(1),"kernel32.dll")
ERROR_ALREADY_EXISTS=183
mutexname="*mywinbatchappnamev1.x*"
hmutex=dllcall(kernel32,long:"CreateMutexA",lpnull,long:0,lpstr:mutexname)
if DllLastError()==ERROR_ALREADY_EXISTS ;mutex exist an hinstance is running
display(5,NameVer,"Only 1 instance of %tool% is allowed.")
exit
end if
It works fine when i run the exe directly. If i run it from the studio in regular mode or debug mode i get the message and the program exit.
Can you help me understand how to prevent that?
Thanks