Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Avoiding Multiple Instances in EXE Mode
#1
My macro on startup checks for any of the three macros instance running if found kills the instance. Problem is it destroys itself. Here it the function KillPro used :

function
' Stores EXE Process name
ARRAY(str) a
' Stores Process ID (PID)
ARRAY(int) b
EnumProcessesEx &b &a
for(_i 0 a.len)
if a[_i]="BuyPro" or a[_i]="SellPro" or a[_i]="CashConfig"
ShutDownProcess b[_i] 1
ret

How can I have PID of my recent instance started so that I can check if there is any other instance of my macro I can kill it and save the recent instance been killed? Thus saving multiple instance of my program.
#2
pid of your instance is GetCurrentProcessId.
#3
Thanks, It solved the problem


Forum Jump:


Users browsing this thread: 1 Guest(s)