Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Detect if a process is running

Name: Anonymous 2007-04-26 0:41 ID:BFlCOmid

How do you detect if a process is running by its name in Windows? In other words be able to input "program.exe" into a function and have it say if it is running.

Preferably in C++, but alternate languages are ok.

Name: Anonymous 2007-04-27 5:51 ID:FFV0r2Vu

Wait. How do you know if the program.exe is the same program.exe you think it is when you check if it is running?

This depends on what exactly you're trying to accomplish. If you're just doing something for yourself for the sake of convenience, you're probably fine to just test for a running process named program.exe.

But if this is something you plan to distribute, or part of some program that needs to be aware of some other running program, you'll probably need something more robust. For example if this is some kind of protection scheme (lol good luck with that), then if you just checked for a running program.exe, I might as well just make up my own no-op program named program.exe that does nothing but sleep, and keep your shitware happy.

That might also be a concern even if you aren't trying to make some backward security scheme. Even if you are just doing this for convenience, you should be aware that a program image name is not a unique identifier for a program.


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List