Are the “System” and “System Idle Process” PIDs constant on Windows?
问题 On a couple of windows XP systems I've looked at, the "System Idle Process" always has PID 0, and the "System" process always has PID 4. In a Windows program which enumerates processes, is it safe to recognise these processes by these PIDs, or can they be different in some circumstances? 回答1: I have production code which assumes these PIDs are static, and it works on XP, Vista and Win 7. Not sure if it's the officially supported method though! Another couple of ways of approaching the problem