11-16-2008, 06:07 AM
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.
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.