简体   繁体   中英

C# How to determinate if Process is background process or not

如何确定一个带有 GetProcess(Name) 的进程是否是后台进程?

For the Process class, you can examine the MainWindowHandle property. It will be IntPtr.Zero if the process doesn't have a window.

There must be a better way to determine if the process is running background. For example, it can happend, that MSAccess process doesn't close correctly. The MSAccess.exe process appears under background processes list even if has MainWindowHandle...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM