05-29-2007, 05:19 AM
So you need a function like IsProcessRunning("processname")? Can be used ProcessNameToId or EnumProcessesEx:
if(qm.ProcessNameToId("processname" 0)) ret ;;exit if the process is running
If it has windows, also can be used win:
if(win("" "" "processname")) ret ;;exit if the process is running
This code can be placed at the beginning of the macro. Filter functions are used only with key/mouse/window triggers. If in a filter function, it would be:
if(!qm.ProcessNameToId("processname" 0)) ret iid ;;allow the macro to run if the process is not running
Note: "qm." here is used only as a hint that all dll functions exported by QM are in the qm category. Easier to find. But not necessary.
Note2: ProcessNameToId also finds processes running in other user sessions (fast user switching). In the latest QM version, added function ProcessNameToId2 that can find processes in all or only in current session.
if(qm.ProcessNameToId("processname" 0)) ret ;;exit if the process is running
If it has windows, also can be used win:
if(win("" "" "processname")) ret ;;exit if the process is running
This code can be placed at the beginning of the macro. Filter functions are used only with key/mouse/window triggers. If in a filter function, it would be:
if(!qm.ProcessNameToId("processname" 0)) ret iid ;;allow the macro to run if the process is not running
Note: "qm." here is used only as a hint that all dll functions exported by QM are in the qm category. Easier to find. But not necessary.
Note2: ProcessNameToId also finds processes running in other user sessions (fast user switching). In the latest QM version, added function ProcessNameToId2 that can find processes in all or only in current session.
