05-30-2006, 09:00 AM
Yes, it is only available in QM 2.1.8. You can create function GetProcessId and paste this code:
Delete both these functions when you'll upgrade to 2.1.8 or later.
This is not tested on 2.1.6. May give more unknown identifier errors.
;/
function# $exename
int pid fl hs k; str s se(exename); lpstr ss
if(se.endi(".exe")) fl|1
hs=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS 0); if(hs==-1) ret
PROCESSENTRY32 pe.dwSize=sizeof(PROCESSENTRY32)
k=Process32First(hs &pe)
rep
,if(!k) break
,ss=&pe.szExeFile
,s.getfilename(ss fl)
,if(s~se) pid=pe.th32ProcessID; break
,k=Process32Next(hs &pe)
,
CloseHandle(hs)
ret pid
Delete both these functions when you'll upgrade to 2.1.8 or later.
This is not tested on 2.1.6. May give more unknown identifier errors.