@pneumatic
Thank you, but your code only affects priority of one instance.
@swagfag
Thank you, but unfortunately it didn't affect priority at all. Maybe I should add some environment/libraries to make it work?
@teadrinker
Thank you, it works. I've added the timer to run it regulary (please let me know if it's done wrong).
Code: Select all
#Persistent
SetTimer , SetFirefoxPriority , 5000
SetFirefoxPriority:
{
processName := "firefox.exe"
PIDs := EnumProcessesByName(processName)
for k, PID in PIDs
Process, Priority, % PID, H
EnumProcessesByName(procName) {
if !DllCall("Wtsapi32\WTSEnumerateProcesses", Ptr, 0, UInt, 0, UInt, 1, PtrP, pProcessInfo, PtrP, count)
throw Exception("WTSEnumerateProcesses failed. A_LastError: " . A_LastError)
addr := pProcessInfo, PIDs := []
Loop % count {
if StrGet( NumGet(addr + 8) ) = procName
PID := NumGet(addr + 4, "UInt"), PIDs.Push(PID)
addr += A_PtrSize = 4 ? 16 : 24
}
DllCall("Wtsapi32\WTSFreeMemory", Ptr, pProcessInfo)
Return PIDs
}
}
But since I'm using different versions of Firefox, is it possible to track the child processes of the exact parent PID instead of all currently running firefox.exe instances? I understand that this is immodest, so if it's too time consuming, thank you anyway, your help is already substantial.