看似可以,但是仔细看MSDN,有这么一句话:“Warning If a process happens to return STILL_ACTIVE (259) as an error code, applications that test for this value could end up in an infinite loop.” 很明显,我们不能保证一个进程不会返回一个STILL_ACTIVE (259)做为退出码,也就是说GetExitCodeProcess返回了STILL_ACTIVE 并不代表这个进程还没有结束。此时该进程可能已经结束(并返回259做为退出码)或者没有结束。此路不通。