emeliku
emeliku

Reputation: 183

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

How to determinate if one process with GetProcess(Name) is background process or not ?

Upvotes: 1

Views: 1002

Answers (2)

George
George

Reputation: 1

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...

Upvotes: 0

Poul Bak
Poul Bak

Reputation: 10929

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

Upvotes: 1

Related Questions