myWallJSON
myWallJSON

Reputation: 9502

Having a path to an .exe how can I find out if it is running?

I wonder If and how it is possible to find out if say Calc.exe from C:\Windows\System32 is running or not (on XP and above, not using external applications like WMIC ) (something like what System.Diagnostics with its Process.GetProcesses() gives for C# developers but for native winapi )?

Upvotes: 1

Views: 151

Answers (1)

Mahmoud Al-Qudsi
Mahmoud Al-Qudsi

Reputation: 29519

You just have to enumerate the processes and search for a match.

The APIs to use are Process32First and Process32Next. Sample code here.

Upvotes: 3

Related Questions